@@ -59,7 +59,7 @@ use rustc_span::{Span, DUMMY_SP};
59
59
use smallvec:: { smallvec, SmallVec } ;
60
60
use std:: cell:: { Cell , RefCell } ;
61
61
use std:: collections:: BTreeSet ;
62
- use std:: { cmp, fmt, mem , ptr} ;
62
+ use std:: { cmp, fmt, ptr} ;
63
63
use tracing:: debug;
64
64
65
65
use diagnostics:: { ImportSuggestion , LabelSuggestion , Suggestion } ;
@@ -966,8 +966,6 @@ pub struct Resolver<'a> {
966
966
registered_attrs : FxHashSet < Ident > ,
967
967
registered_tools : RegisteredTools ,
968
968
macro_use_prelude : FxHashMap < Symbol , & ' a NameBinding < ' a > > ,
969
- /// FIXME: The only user of this is a doc link resolution hack for rustdoc.
970
- all_macro_rules : FxHashMap < Symbol , Res > ,
971
969
macro_map : FxHashMap < DefId , Lrc < SyntaxExtension > > ,
972
970
dummy_ext_bang : Lrc < SyntaxExtension > ,
973
971
dummy_ext_derive : Lrc < SyntaxExtension > ,
@@ -1360,7 +1358,6 @@ impl<'a> Resolver<'a> {
1360
1358
registered_attrs,
1361
1359
registered_tools,
1362
1360
macro_use_prelude : FxHashMap :: default ( ) ,
1363
- all_macro_rules : Default :: default ( ) ,
1364
1361
macro_map : FxHashMap :: default ( ) ,
1365
1362
dummy_ext_bang : Lrc :: new ( SyntaxExtension :: dummy_bang ( session. edition ( ) ) ) ,
1366
1363
dummy_ext_derive : Lrc :: new ( SyntaxExtension :: dummy_derive ( session. edition ( ) ) ) ,
@@ -1912,11 +1909,6 @@ impl<'a> Resolver<'a> {
1912
1909
}
1913
1910
}
1914
1911
1915
- // For rustdoc.
1916
- pub fn take_all_macro_rules ( & mut self ) -> FxHashMap < Symbol , Res > {
1917
- mem:: take ( & mut self . all_macro_rules )
1918
- }
1919
-
1920
1912
/// For rustdoc.
1921
1913
/// For local modules returns only reexports, for external modules returns all children.
1922
1914
pub fn module_children_or_reexports ( & self , def_id : DefId ) -> Vec < ModChild > {
@@ -1928,8 +1920,12 @@ impl<'a> Resolver<'a> {
1928
1920
}
1929
1921
1930
1922
/// For rustdoc.
1931
- pub fn macro_rules_scope ( & self , def_id : LocalDefId ) -> MacroRulesScopeRef < ' a > {
1932
- * self . macro_rules_scopes . get ( & def_id) . expect ( "not a `macro_rules` item" )
1923
+ pub fn macro_rules_scope ( & self , def_id : LocalDefId ) -> ( MacroRulesScopeRef < ' a > , Res ) {
1924
+ let scope = * self . macro_rules_scopes . get ( & def_id) . expect ( "not a `macro_rules` item" ) ;
1925
+ match scope. get ( ) {
1926
+ MacroRulesScope :: Binding ( mb) => ( scope, mb. binding . res ( ) ) ,
1927
+ _ => unreachable ! ( ) ,
1928
+ }
1933
1929
}
1934
1930
1935
1931
/// Retrieves the span of the given `DefId` if `DefId` is in the local crate.
0 commit comments