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:
Jonas Schievink 2020-11-15 13:39:46 +01:00 committed by GitHub
commit f32191f78f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 16 deletions

View file

@ -13,12 +13,12 @@ pub fn inject(
resolver: &mut dyn ResolverExpand,
sess: &Session,
alt_std_name: Option<Symbol>,
) -> (ast::Crate, Option<Symbol>) {
) -> ast::Crate {
let rust_2018 = sess.parse_sess.edition >= Edition::Edition2018;
// the first name in this list is the crate name of the crate with the prelude
let names: &[Symbol] = if sess.contains_name(&krate.attrs, sym::no_core) {
return (krate, None);
return krate;
} else if sess.contains_name(&krate.attrs, sym::no_std) {
if sess.contains_name(&krate.attrs, sym::compiler_builtins) {
&[sym::core]
@ -81,5 +81,5 @@ pub fn inject(
krate.module.items.insert(0, use_item);
(krate, Some(name))
krate
}