@@ -26,7 +26,7 @@ use rustc_session::lint::builtin::{UNUSED_ATTRIBUTES, UNUSED_DOC_COMMENTS};
26
26
use rustc_session:: parse:: feature_err;
27
27
use rustc_session:: { Limit , Session } ;
28
28
use rustc_span:: hygiene:: SyntaxContext ;
29
- use rustc_span:: { ErrorGuaranteed , FileName , Ident , LocalExpnId , Span , sym} ;
29
+ use rustc_span:: { ErrorGuaranteed , FileName , Ident , LocalExpnId , Span , Symbol , sym} ;
30
30
use smallvec:: SmallVec ;
31
31
32
32
use crate :: base:: * ;
@@ -473,7 +473,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
473
473
let dir_path = file_path. parent ( ) . unwrap_or ( & file_path) . to_owned ( ) ;
474
474
self . cx . root_path = dir_path. clone ( ) ;
475
475
self . cx . current_expansion . module = Rc :: new ( ModuleData {
476
- mod_path : vec ! [ Ident :: from_str ( & self . cx. ecfg. crate_name) ] ,
476
+ mod_path : vec ! [ Ident :: with_dummy_span ( self . cx. ecfg. crate_name) ] ,
477
477
file_path_stack : vec ! [ file_path] ,
478
478
dir_path,
479
479
} ) ;
@@ -689,7 +689,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
689
689
span : expn_data. call_site ,
690
690
descr : expn_data. kind . descr ( ) ,
691
691
suggested_limit,
692
- crate_name : & self . cx . ecfg . crate_name ,
692
+ crate_name : self . cx . ecfg . crate_name ,
693
693
} ) ;
694
694
695
695
self . cx . trace_macros_diag ( ) ;
@@ -2458,7 +2458,7 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
2458
2458
}
2459
2459
2460
2460
pub struct ExpansionConfig < ' feat > {
2461
- pub crate_name : String ,
2461
+ pub crate_name : Symbol ,
2462
2462
pub features : & ' feat Features ,
2463
2463
pub recursion_limit : Limit ,
2464
2464
pub trace_mac : bool ,
@@ -2471,7 +2471,7 @@ pub struct ExpansionConfig<'feat> {
2471
2471
}
2472
2472
2473
2473
impl ExpansionConfig < ' _ > {
2474
- pub fn default ( crate_name : String , features : & Features ) -> ExpansionConfig < ' _ > {
2474
+ pub fn default ( crate_name : Symbol , features : & Features ) -> ExpansionConfig < ' _ > {
2475
2475
ExpansionConfig {
2476
2476
crate_name,
2477
2477
features,
0 commit comments