Skip to content

Commit 642414e

Browse files
authored
Rollup merge of #92895 - bjorn3:simplifications, r=jackh726
Remove some unused functionality * Remove the `alt_std_name` option * Remove the everybody loops pass * Make two functions private
2 parents b7c48b4 + 7ba4110 commit 642414e

File tree

5 files changed

+4
-12
lines changed

5 files changed

+4
-12
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_interface/src/util.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ fn get_stack_size() -> Option<usize> {
118118
/// Like a `thread::Builder::spawn` followed by a `join()`, but avoids the need
119119
/// for `'static` bounds.
120120
#[cfg(not(parallel_compiler))]
121-
pub fn scoped_thread<F: FnOnce() -> R + Send, R: Send>(cfg: thread::Builder, f: F) -> R {
121+
fn scoped_thread<F: FnOnce() -> R + Send, R: Send>(cfg: thread::Builder, f: F) -> R {
122122
// SAFETY: join() is called immediately, so any closure captures are still
123123
// alive.
124124
match unsafe { cfg.spawn_unchecked(f) }.unwrap().join() {
@@ -379,7 +379,7 @@ fn sysroot_candidates() -> Vec<PathBuf> {
379379
}
380380
}
381381

382-
pub fn get_codegen_sysroot(maybe_sysroot: &Option<PathBuf>, backend_name: &str) -> MakeBackendFn {
382+
fn get_codegen_sysroot(maybe_sysroot: &Option<PathBuf>, backend_name: &str) -> MakeBackendFn {
383383
// For now we only allow this function to be called once as it'll dlopen a
384384
// few things, which seems to work best if we only do that once. In
385385
// general this assertion never trips due to the once guard in `get_codegen_backend`,

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)