diff options
| author | bors <bors@rust-lang.org> | 2025-01-24 01:59:34 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-01-24 01:59:34 +0000 |
| commit | 1c9837df1dde9b234229709e89b3672bd3cf04a4 (patch) | |
| tree | 4d956f28c67a405de6f8cb0515e242d00f59fdb2 /compiler/rustc_interface/src | |
| parent | 22a220a1a8280a262a277fc24661511f6c4dab51 (diff) | |
| parent | 7d2600698d2acc2b2497dab18433dd6fd5bdd2d6 (diff) | |
| download | rust-1c9837df1dde9b234229709e89b3672bd3cf04a4.tar.gz rust-1c9837df1dde9b234229709e89b3672bd3cf04a4.zip | |
Auto merge of #135947 - matthiaskrgr:rollup-k9jpfls, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - #135073 (Implement `ByteStr` and `ByteString` types) - #135492 (Add missing check for async body when suggesting await on futures.) - #135766 (handle global trait bounds defining assoc types) - #135880 (Get rid of RunCompiler) - #135908 (rustc_codegen_llvm: remove outdated asm-to-obj codegen note) - #135911 (Allow `arena_cache` queries to return `Option<&'tcx T>`) - #135920 (simplify parse_format::Parser::ws by using next_if) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/interface.rs | 14 | ||||
| -rw-r--r-- | compiler/rustc_interface/src/tests.rs | 6 |
2 files changed, 15 insertions, 5 deletions
diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs index 308d669cf35..2113345eda3 100644 --- a/compiler/rustc_interface/src/interface.rs +++ b/compiler/rustc_interface/src/interface.rs @@ -1,6 +1,5 @@ use std::path::PathBuf; use std::result; -use std::sync::Arc; use rustc_ast::{LitKind, MetaItemKind, token}; use rustc_codegen_ssa::traits::CodegenBackend; @@ -309,6 +308,11 @@ pub struct Config { pub output_dir: Option<PathBuf>, pub output_file: Option<OutFileName>, pub ice_file: Option<PathBuf>, + /// Load files from sources other than the file system. + /// + /// Has no uses within this repository, but may be used in the future by + /// bjorn3 for "hooking rust-analyzer's VFS into rustc at some point for + /// running rustc without having to save". (See #102759.) pub file_loader: Option<Box<dyn FileLoader + Send + Sync>>, /// The list of fluent resources, used for lints declared with /// [`Diagnostic`](rustc_errors::Diagnostic) and [`LintDiagnostic`](rustc_errors::LintDiagnostic). @@ -337,6 +341,11 @@ pub struct Config { pub override_queries: Option<fn(&Session, &mut Providers)>, /// This is a callback from the driver that is called to create a codegen backend. + /// + /// Has no uses within this repository, but is used by bjorn3 for "the + /// hotswapping branch of cg_clif" for "setting the codegen backend from a + /// custom driver where the custom codegen backend has arbitrary data." + /// (See #102759.) pub make_codegen_backend: Option<Box<dyn FnOnce(&config::Options) -> Box<dyn CodegenBackend> + Send>>, @@ -346,8 +355,7 @@ pub struct Config { /// The inner atomic value is set to true when a feature marked as `internal` is /// enabled. Makes it so that "please report a bug" is hidden, as ICEs with /// internal features are wontfix, and they are usually the cause of the ICEs. - /// None signifies that this is not tracked. - pub using_internal_features: Arc<std::sync::atomic::AtomicBool>, + pub using_internal_features: &'static std::sync::atomic::AtomicBool, /// All commandline args used to invoke the compiler, with @file args fully expanded. /// This will only be used within debug info, e.g. in the pdb file on windows diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs index d7370c1ff53..74d02ac2227 100644 --- a/compiler/rustc_interface/src/tests.rs +++ b/compiler/rustc_interface/src/tests.rs @@ -2,7 +2,7 @@ use std::collections::{BTreeMap, BTreeSet}; use std::num::NonZero; use std::path::{Path, PathBuf}; -use std::sync::Arc; +use std::sync::atomic::AtomicBool; use rustc_data_structures::profiling::TimePassesFormat; use rustc_errors::emitter::HumanReadableErrorType; @@ -62,6 +62,8 @@ where temps_dir, }; + static USING_INTERNAL_FEATURES: AtomicBool = AtomicBool::new(false); + let sess = build_session( early_dcx, sessopts, @@ -74,7 +76,7 @@ where sysroot, "", None, - Arc::default(), + &USING_INTERNAL_FEATURES, Default::default(), ); let cfg = parse_cfg(sess.dcx(), matches.opt_strs("cfg")); |
