Remove the alt_std_name option
This option introduced in #15820 allows a custom crate to be imported in the place of std, but with the name std. I don't think there is any value to this. At most it is confusing users of a driver that uses this option. There are no users of this option on github. If anyone still needs it, they can emulate it injecting #![no_core] in addition to their own prelude.
This commit is contained in:
parent
78450d2d60
commit
55ceed81fe
4 changed files with 2 additions and 10 deletions
|
@ -11,7 +11,6 @@ pub fn inject(
|
||||||
mut krate: ast::Crate,
|
mut krate: ast::Crate,
|
||||||
resolver: &mut dyn ResolverExpand,
|
resolver: &mut dyn ResolverExpand,
|
||||||
sess: &Session,
|
sess: &Session,
|
||||||
alt_std_name: Option<Symbol>,
|
|
||||||
) -> ast::Crate {
|
) -> ast::Crate {
|
||||||
let edition = sess.parse_sess.edition;
|
let edition = sess.parse_sess.edition;
|
||||||
|
|
||||||
|
@ -53,7 +52,7 @@ pub fn inject(
|
||||||
span,
|
span,
|
||||||
ident,
|
ident,
|
||||||
vec![cx.attribute(cx.meta_word(span, sym::macro_use))],
|
vec![cx.attribute(cx.meta_word(span, sym::macro_use))],
|
||||||
ast::ItemKind::ExternCrate(alt_std_name),
|
ast::ItemKind::ExternCrate(None),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -286,8 +286,7 @@ pub fn configure_and_expand(
|
||||||
rustc_builtin_macros::register_builtin_macros(resolver);
|
rustc_builtin_macros::register_builtin_macros(resolver);
|
||||||
|
|
||||||
krate = sess.time("crate_injection", || {
|
krate = sess.time("crate_injection", || {
|
||||||
let alt_std_name = sess.opts.alt_std_name.as_ref().map(|s| Symbol::intern(s));
|
rustc_builtin_macros::standard_library_imports::inject(krate, resolver, sess)
|
||||||
rustc_builtin_macros::standard_library_imports::inject(krate, resolver, sess, alt_std_name)
|
|
||||||
});
|
});
|
||||||
|
|
||||||
util::check_attr_crate_type(sess, &krate.attrs, &mut resolver.lint_buffer());
|
util::check_attr_crate_type(sess, &krate.attrs, &mut resolver.lint_buffer());
|
||||||
|
|
|
@ -770,7 +770,6 @@ impl Default for Options {
|
||||||
externs: Externs(BTreeMap::new()),
|
externs: Externs(BTreeMap::new()),
|
||||||
extern_dep_specs: ExternDepSpecs(BTreeMap::new()),
|
extern_dep_specs: ExternDepSpecs(BTreeMap::new()),
|
||||||
crate_name: None,
|
crate_name: None,
|
||||||
alt_std_name: None,
|
|
||||||
libs: Vec::new(),
|
libs: Vec::new(),
|
||||||
unstable_features: UnstableFeatures::Disallow,
|
unstable_features: UnstableFeatures::Disallow,
|
||||||
debug_assertions: true,
|
debug_assertions: true,
|
||||||
|
@ -2382,7 +2381,6 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
|
||||||
unstable_features: UnstableFeatures::from_environment(crate_name.as_deref()),
|
unstable_features: UnstableFeatures::from_environment(crate_name.as_deref()),
|
||||||
extern_dep_specs,
|
extern_dep_specs,
|
||||||
crate_name,
|
crate_name,
|
||||||
alt_std_name: None,
|
|
||||||
libs,
|
libs,
|
||||||
debug_assertions,
|
debug_assertions,
|
||||||
actually_rustdoc: false,
|
actually_rustdoc: false,
|
||||||
|
|
|
@ -184,10 +184,6 @@ top_level_options!(
|
||||||
externs: Externs [UNTRACKED],
|
externs: Externs [UNTRACKED],
|
||||||
extern_dep_specs: ExternDepSpecs [UNTRACKED],
|
extern_dep_specs: ExternDepSpecs [UNTRACKED],
|
||||||
crate_name: Option<String> [TRACKED],
|
crate_name: Option<String> [TRACKED],
|
||||||
/// An optional name to use as the crate for std during std injection,
|
|
||||||
/// written `extern crate name as std`. Defaults to `std`. Used by
|
|
||||||
/// out-of-tree drivers.
|
|
||||||
alt_std_name: Option<String> [TRACKED],
|
|
||||||
/// Indicates how the compiler should treat unstable features.
|
/// Indicates how the compiler should treat unstable features.
|
||||||
unstable_features: UnstableFeatures [TRACKED],
|
unstable_features: UnstableFeatures [TRACKED],
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue