11use crate :: pp:: Breaks :: { Consistent , Inconsistent } ;
22use crate :: pp:: { self , Breaks } ;
33
4- use rustc_data_structures:: sync:: Once ;
54use rustc_span:: edition:: Edition ;
65use rustc_span:: source_map:: { dummy_spanned, SourceMap , Spanned } ;
7- use rustc_span:: symbol:: { kw, sym, Symbol } ;
6+ use rustc_span:: symbol:: { kw, sym} ;
87use rustc_span:: { BytePos , FileName , Span } ;
98use syntax:: ast:: { self , BlockCheckMode , PatKind , RangeEnd , RangeSyntax } ;
109use syntax:: ast:: { Attribute , GenericArg , MacArgs } ;
@@ -103,7 +102,7 @@ pub fn print_crate<'a>(
103102 ann : & ' a dyn PpAnn ,
104103 is_expanded : bool ,
105104 edition : Edition ,
106- injected_crate_name : & Once < Symbol > ,
105+ has_injected_crate : bool ,
107106) -> String {
108107 let mut s = State {
109108 s : pp:: mk_printer ( ) ,
@@ -112,7 +111,7 @@ pub fn print_crate<'a>(
112111 is_expanded,
113112 } ;
114113
115- if is_expanded && injected_crate_name . try_get ( ) . is_some ( ) {
114+ if is_expanded && has_injected_crate {
116115 // We need to print `#![no_std]` (and its feature gate) so that
117116 // compiling pretty-printed source won't inject libstd again.
118117 // However, we don't want these attributes in the AST because
0 commit comments