@@ -2772,7 +2772,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
2772
2772
}
2773
2773
2774
2774
ItemDefaultImpl ( _, ref trait_ref) => {
2775
- self . resolve_trait_reference ( item . id , trait_ref, TraitImplementation ) ;
2775
+ self . with_optional_trait_ref ( Some ( trait_ref) , |_| { } ) ;
2776
2776
}
2777
2777
ItemImpl ( _, _,
2778
2778
ref generics,
@@ -3022,12 +3022,12 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
3022
3022
}
3023
3023
3024
3024
fn with_optional_trait_ref < T , F > ( & mut self ,
3025
- opt_trait_ref : & Option < TraitRef > ,
3025
+ opt_trait_ref : Option < & TraitRef > ,
3026
3026
f : F ) -> T where
3027
3027
F : FnOnce ( & mut Resolver ) -> T ,
3028
3028
{
3029
3029
let mut new_val = None ;
3030
- if let Some ( ref trait_ref) = * opt_trait_ref {
3030
+ if let Some ( trait_ref) = opt_trait_ref {
3031
3031
match self . resolve_trait_reference ( trait_ref. ref_id , & trait_ref. path , 0 ) {
3032
3032
Ok ( path_res) => {
3033
3033
self . record_def ( trait_ref. ref_id , path_res) ;
@@ -3057,7 +3057,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
3057
3057
this. visit_generics ( generics) ;
3058
3058
3059
3059
// Resolve the trait reference, if necessary.
3060
- this. with_optional_trait_ref ( opt_trait_reference, |this| {
3060
+ this. with_optional_trait_ref ( opt_trait_reference. as_ref ( ) , |this| {
3061
3061
// Resolve the self type.
3062
3062
this. visit_ty ( self_type) ;
3063
3063
0 commit comments