Rollup merge of #79005 - petrochenkov:noinjected, r=davidtwco
cleanup: Remove `ParseSess::injected_crate_name` Its only remaining use is in pretty-printing where the necessary information can be easily re-computed.
This commit is contained in:
commit
f32191f78f
5 changed files with 7 additions and 16 deletions
|
@ -109,7 +109,6 @@ pub fn print_crate<'a>(
|
|||
ann: &'a dyn PpAnn,
|
||||
is_expanded: bool,
|
||||
edition: Edition,
|
||||
has_injected_crate: bool,
|
||||
) -> String {
|
||||
let mut s = State {
|
||||
s: pp::mk_printer(),
|
||||
|
@ -119,7 +118,7 @@ pub fn print_crate<'a>(
|
|||
insert_extra_parens: true,
|
||||
};
|
||||
|
||||
if is_expanded && has_injected_crate {
|
||||
if is_expanded && !krate.attrs.iter().any(|attr| attr.has_name(sym::no_core)) {
|
||||
// We need to print `#![no_std]` (and its feature gate) so that
|
||||
// compiling pretty-printed source won't inject libstd again.
|
||||
// However, we don't want these attributes in the AST because
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue