Skip to content

Commit 55ceed8

Browse files
committed
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.
1 parent 78450d2 commit 55ceed8

File tree

4 files changed

+2
-10
lines changed

4 files changed

+2
-10
lines changed

compiler/rustc_builtin_macros/src/standard_library_imports.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ pub fn inject(
1111
mut krate: ast::Crate,
1212
resolver: &mut dyn ResolverExpand,
1313
sess: &Session,
14-
alt_std_name: Option<Symbol>,
1514
) -> ast::Crate {
1615
let edition = sess.parse_sess.edition;
1716

@@ -53,7 +52,7 @@ pub fn inject(
5352
span,
5453
ident,
5554
vec![cx.attribute(cx.meta_word(span, sym::macro_use))],
56-
ast::ItemKind::ExternCrate(alt_std_name),
55+
ast::ItemKind::ExternCrate(None),
5756
),
5857
);
5958
}

compiler/rustc_interface/src/passes.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,7 @@ pub fn configure_and_expand(
286286
rustc_builtin_macros::register_builtin_macros(resolver);
287287

288288
krate = sess.time("crate_injection", || {
289-
let alt_std_name = sess.opts.alt_std_name.as_ref().map(|s| Symbol::intern(s));
290-
rustc_builtin_macros::standard_library_imports::inject(krate, resolver, sess, alt_std_name)
289+
rustc_builtin_macros::standard_library_imports::inject(krate, resolver, sess)
291290
});
292291

293292
util::check_attr_crate_type(sess, &krate.attrs, &mut resolver.lint_buffer());

compiler/rustc_session/src/config.rs

-2
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,6 @@ impl Default for Options {
770770
externs: Externs(BTreeMap::new()),
771771
extern_dep_specs: ExternDepSpecs(BTreeMap::new()),
772772
crate_name: None,
773-
alt_std_name: None,
774773
libs: Vec::new(),
775774
unstable_features: UnstableFeatures::Disallow,
776775
debug_assertions: true,
@@ -2382,7 +2381,6 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
23822381
unstable_features: UnstableFeatures::from_environment(crate_name.as_deref()),
23832382
extern_dep_specs,
23842383
crate_name,
2385-
alt_std_name: None,
23862384
libs,
23872385
debug_assertions,
23882386
actually_rustdoc: false,

compiler/rustc_session/src/options.rs

-4
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,6 @@ top_level_options!(
184184
externs: Externs [UNTRACKED],
185185
extern_dep_specs: ExternDepSpecs [UNTRACKED],
186186
crate_name: Option<String> [TRACKED],
187-
/// An optional name to use as the crate for std during std injection,
188-
/// written `extern crate name as std`. Defaults to `std`. Used by
189-
/// out-of-tree drivers.
190-
alt_std_name: Option<String> [TRACKED],
191187
/// Indicates how the compiler should treat unstable features.
192188
unstable_features: UnstableFeatures [TRACKED],
193189

0 commit comments

Comments
 (0)