@@ -1750,8 +1750,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
1750
1750
& mut self ,
1751
1751
current_trait : Option < Module < ' ra > > ,
1752
1752
parent_scope : & ParentScope < ' ra > ,
1753
- ctxt : SyntaxContext ,
1754
- assoc_item : Option < ( Symbol , Namespace ) > ,
1753
+ assoc_item : Option < ( Ident , Namespace ) > ,
1755
1754
) -> Vec < TraitCandidate > {
1756
1755
let mut found_traits = Vec :: new ( ) ;
1757
1756
@@ -1762,6 +1761,11 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
1762
1761
}
1763
1762
}
1764
1763
1764
+ let ctxt = if let Some ( ( ident, _) ) = assoc_item {
1765
+ ident. span . ctxt ( )
1766
+ } else {
1767
+ SyntaxContext :: root ( )
1768
+ } ;
1765
1769
self . visit_scopes ( ScopeSet :: All ( TypeNS ) , parent_scope, ctxt, |this, scope, _, _| {
1766
1770
match scope {
1767
1771
Scope :: Module ( module, _) => {
@@ -1784,7 +1788,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
1784
1788
fn traits_in_module (
1785
1789
& mut self ,
1786
1790
module : Module < ' ra > ,
1787
- assoc_item : Option < ( Symbol , Namespace ) > ,
1791
+ assoc_item : Option < ( Ident , Namespace ) > ,
1788
1792
found_traits : & mut Vec < TraitCandidate > ,
1789
1793
) {
1790
1794
module. ensure_traits ( self ) ;
@@ -1806,14 +1810,14 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
1806
1810
fn trait_may_have_item (
1807
1811
& mut self ,
1808
1812
trait_module : Option < Module < ' ra > > ,
1809
- assoc_item : Option < ( Symbol , Namespace ) > ,
1813
+ assoc_item : Option < ( Ident , Namespace ) > ,
1810
1814
) -> bool {
1811
1815
match ( trait_module, assoc_item) {
1812
- ( Some ( trait_module) , Some ( ( name , ns) ) ) => self
1816
+ ( Some ( trait_module) , Some ( ( ident , ns) ) ) => self
1813
1817
. resolutions ( trait_module)
1814
1818
. borrow ( )
1815
1819
. 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 ) ,
1817
1821
_ => true ,
1818
1822
}
1819
1823
}
0 commit comments