1
1
use crate :: pp:: Breaks :: { Consistent , Inconsistent } ;
2
2
use crate :: pp:: { self , Breaks } ;
3
3
4
- use rustc_data_structures:: sync:: Once ;
5
4
use rustc_span:: edition:: Edition ;
6
5
use rustc_span:: source_map:: { dummy_spanned, SourceMap , Spanned } ;
7
- use rustc_span:: symbol:: { kw, sym, Symbol } ;
6
+ use rustc_span:: symbol:: { kw, sym} ;
8
7
use rustc_span:: { BytePos , FileName , Span } ;
9
8
use syntax:: ast:: { self , BlockCheckMode , PatKind , RangeEnd , RangeSyntax } ;
10
9
use syntax:: ast:: { Attribute , GenericArg , MacArgs } ;
@@ -103,7 +102,7 @@ pub fn print_crate<'a>(
103
102
ann : & ' a dyn PpAnn ,
104
103
is_expanded : bool ,
105
104
edition : Edition ,
106
- injected_crate_name : & Once < Symbol > ,
105
+ has_injected_crate : bool ,
107
106
) -> String {
108
107
let mut s = State {
109
108
s : pp:: mk_printer ( ) ,
@@ -112,7 +111,7 @@ pub fn print_crate<'a>(
112
111
is_expanded,
113
112
} ;
114
113
115
- if is_expanded && injected_crate_name . try_get ( ) . is_some ( ) {
114
+ if is_expanded && has_injected_crate {
116
115
// We need to print `#![no_std]` (and its feature gate) so that
117
116
// compiling pretty-printed source won't inject libstd again.
118
117
// However, we don't want these attributes in the AST because
0 commit comments