@@ -1750,8 +1750,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
17501750 & mut self ,
17511751 current_trait : Option < Module < ' ra > > ,
17521752 parent_scope : & ParentScope < ' ra > ,
1753- ctxt : SyntaxContext ,
1754- assoc_item : Option < ( Symbol , Namespace ) > ,
1753+ assoc_item : Option < ( Ident , Namespace ) > ,
17551754 ) -> Vec < TraitCandidate > {
17561755 let mut found_traits = Vec :: new ( ) ;
17571756
@@ -1762,6 +1761,11 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
17621761 }
17631762 }
17641763
1764+ let ctxt = if let Some ( ( ident, _) ) = assoc_item {
1765+ ident. span . ctxt ( )
1766+ } else {
1767+ SyntaxContext :: root ( )
1768+ } ;
17651769 self . visit_scopes ( ScopeSet :: All ( TypeNS ) , parent_scope, ctxt, |this, scope, _, _| {
17661770 match scope {
17671771 Scope :: Module ( module, _) => {
@@ -1784,7 +1788,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
17841788 fn traits_in_module (
17851789 & mut self ,
17861790 module : Module < ' ra > ,
1787- assoc_item : Option < ( Symbol , Namespace ) > ,
1791+ assoc_item : Option < ( Ident , Namespace ) > ,
17881792 found_traits : & mut Vec < TraitCandidate > ,
17891793 ) {
17901794 module. ensure_traits ( self ) ;
@@ -1806,14 +1810,14 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
18061810 fn trait_may_have_item (
18071811 & mut self ,
18081812 trait_module : Option < Module < ' ra > > ,
1809- assoc_item : Option < ( Symbol , Namespace ) > ,
1813+ assoc_item : Option < ( Ident , Namespace ) > ,
18101814 ) -> bool {
18111815 match ( trait_module, assoc_item) {
1812- ( Some ( trait_module) , Some ( ( name , ns) ) ) => self
1816+ ( Some ( trait_module) , Some ( ( ident , ns) ) ) => self
18131817 . resolutions ( trait_module)
18141818 . borrow ( )
18151819 . iter ( )
1816- . any ( |( key, _name_resolution) | key. ns == ns && key. ident . name == name) ,
1820+ . any ( |( key, _name_resolution) | key. ns == ns && key. ident . name == ident . name ) ,
18171821 _ => true ,
18181822 }
18191823 }
0 commit comments