File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/rustc/middle/borrowck Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -84,17 +84,24 @@ fn req_loans_in_expr(ex: @ast::expr,
84
84
// the pointer to be borrowed as immutable even if it
85
85
// is mutable in the caller's frame, thus effectively
86
86
// passing the buck onto us to enforce this)
87
+ //
88
+ // FIXME---this handling is not really adequate. For
89
+ // example, if there is a type like, {f: [int]}, we
90
+ // will ignore it, but we ought to be requiring it to
91
+ // be immutable (whereas something like {f:int} would
92
+ // be fine).
87
93
88
94
alt opt_deref_kind( arg_ty. ty ) {
89
95
some( deref_ptr( region_ptr) ) |
90
96
some ( deref_ptr ( unsafe_ptr) ) {
91
97
/* region pointers are (by induction) guaranteed */
92
98
/* unsafe pointers are the user's problem */
93
99
}
100
+ some ( deref_comp ( _) ) |
94
101
none {
95
102
/* not a pointer, no worries */
96
103
}
97
- some( _ ) {
104
+ some( deref_ptr ( _ ) ) {
98
105
let arg_cmt = self . bccx . cat_borrow_of_expr ( arg) ;
99
106
self . guarantee_valid ( arg_cmt, m_const, scope_r) ;
100
107
}
You can’t perform that action at this time.
0 commit comments