]> git.lizzy.rs Git - rust.git/commitdiff
Remove the alt_std_name option
authorbjorn3 <bjorn3@users.noreply.github.com>
Fri, 14 Jan 2022 13:25:52 +0000 (14:25 +0100)
committerbjorn3 <bjorn3@users.noreply.github.com>
Fri, 11 Feb 2022 19:28:38 +0000 (20:28 +0100)
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.

compiler/rustc_builtin_macros/src/standard_library_imports.rs
compiler/rustc_interface/src/passes.rs
compiler/rustc_session/src/config.rs
compiler/rustc_session/src/options.rs

index e106f6014a31d597a0a84f18db3473a43d79b9b1..3571517d2b258a8162ab6fc69bb0e5e658015e7e 100644 (file)
@@ -11,7 +11,6 @@ pub fn inject(
     mut krate: ast::Crate,
     resolver: &mut dyn ResolverExpand,
     sess: &Session,
-    alt_std_name: Option<Symbol>,
 ) -> ast::Crate {
     let edition = sess.parse_sess.edition;
 
@@ -53,7 +52,7 @@ pub fn inject(
                 span,
                 ident,
                 vec![cx.attribute(cx.meta_word(span, sym::macro_use))],
-                ast::ItemKind::ExternCrate(alt_std_name),
+                ast::ItemKind::ExternCrate(None),
             ),
         );
     }
index f5a4e11de16c07c52b79e0ac8534b137b91fb922..66e1e78b2856c8972539e349684e0e1a70a61093 100644 (file)
@@ -286,8 +286,7 @@ pub fn configure_and_expand(
     rustc_builtin_macros::register_builtin_macros(resolver);
 
     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, alt_std_name)
+        rustc_builtin_macros::standard_library_imports::inject(krate, resolver, sess)
     });
 
     util::check_attr_crate_type(sess, &krate.attrs, &mut resolver.lint_buffer());
index 8630ffec241f947199a4ae56131823180174bc2f..79962d5db891826e30cacac0389ab937d0ba8d10 100644 (file)
@@ -770,7 +770,6 @@ fn default() -> Options {
             externs: Externs(BTreeMap::new()),
             extern_dep_specs: ExternDepSpecs(BTreeMap::new()),
             crate_name: None,
-            alt_std_name: None,
             libs: Vec::new(),
             unstable_features: UnstableFeatures::Disallow,
             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()),
         extern_dep_specs,
         crate_name,
-        alt_std_name: None,
         libs,
         debug_assertions,
         actually_rustdoc: false,
index 550da9e05804fecc42e3fe6eec420bb8c3b4f60d..ae1b638c34467ec0f0542cf0895ac2cb03e88009 100644 (file)
@@ -184,10 +184,6 @@ pub struct Options {
         externs: Externs [UNTRACKED],
         extern_dep_specs: ExternDepSpecs [UNTRACKED],
         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.
         unstable_features: UnstableFeatures [TRACKED],