@@ -90,7 +90,7 @@ impl<'a> GuaranteeLifetimeContext<'a> {
90
90
Ok ( ( ) )
91
91
}
92
92
93
- mc:: cat_deref( ref base, derefs , mc:: GcPtr ) => {
93
+ mc:: cat_deref( ref base, _ , mc:: GcPtr ) => {
94
94
let base_scope = self . scope ( base) ;
95
95
96
96
// L-Deref-Managed-Imm-User-Root
@@ -102,7 +102,7 @@ impl<'a> GuaranteeLifetimeContext<'a> {
102
102
if !omit_root {
103
103
// L-Deref-Managed-Imm-Compiler-Root
104
104
// L-Deref-Managed-Mut-Compiler-Root
105
- self . check_root ( cmt , base , derefs , discr_scope )
105
+ Err ( ( ) )
106
106
} else {
107
107
debug ! ( "omitting root, base={}, base_scope={:?}" ,
108
108
base. repr( self . tcx( ) ) , base_scope) ;
@@ -187,61 +187,6 @@ impl<'a> GuaranteeLifetimeContext<'a> {
187
187
}
188
188
}
189
189
190
- fn check_root ( & self ,
191
- cmt_deref : & mc:: cmt ,
192
- cmt_base : & mc:: cmt ,
193
- derefs : uint ,
194
- discr_scope : Option < ast:: NodeId > ) -> R {
195
- debug ! ( "check_root(cmt_deref={}, cmt_base={}, derefs={:?}, \
196
- discr_scope={:?})",
197
- cmt_deref. repr( self . tcx( ) ) ,
198
- cmt_base. repr( self . tcx( ) ) ,
199
- derefs,
200
- discr_scope) ;
201
-
202
- // Make sure that the loan does not exceed the maximum time
203
- // that we can root the value, dynamically.
204
- let root_region = ty:: ReScope ( self . root_scope_id ) ;
205
- if !self . bccx . is_subregion_of ( self . loan_region , root_region) {
206
- return Err ( self . report_error (
207
- err_out_of_root_scope ( root_region, self . loan_region ) ) ) ;
208
- }
209
-
210
- // Extract the scope id that indicates how long the rooting is required
211
- let root_scope = match self . loan_region {
212
- ty:: ReScope ( id) => id,
213
- _ => {
214
- // the check above should fail for anything is not ReScope
215
- self . bccx . tcx . sess . span_bug (
216
- cmt_base. span ,
217
- format ! ( "cannot issue root for scope region: {:?}" ,
218
- self . loan_region) ) ;
219
- }
220
- } ;
221
-
222
- // If inside of a match arm, expand the rooting to the entire
223
- // match. See the detailed discussion in `check()` above.
224
- let root_scope = match discr_scope {
225
- None => root_scope,
226
- Some ( id) => {
227
- if self . bccx . is_subscope_of ( root_scope, id) {
228
- id
229
- } else {
230
- root_scope
231
- }
232
- }
233
- } ;
234
-
235
- // Add a record of what is required
236
- let rm_key = root_map_key { id : cmt_deref. id , derefs : derefs} ;
237
- let root_info = RootInfo { scope : root_scope} ;
238
-
239
- self . bccx . root_map . borrow_mut ( ) . insert ( rm_key, root_info) ;
240
-
241
- debug ! ( "root_key: {:?} root_info: {:?}" , rm_key, root_info) ;
242
- Ok ( ( ) )
243
- }
244
-
245
190
fn check_scope ( & self , max_scope : ty:: Region ) -> R {
246
191
//! Reports an error if `loan_region` is larger than `valid_scope`
247
192
0 commit comments