Skip to content

Commit c10c5dd

Browse files
authored
Unrolled build for rust-lang#124285
Rollup merge of rust-lang#124285 - ferrocene:unstable-L-rust-builtin, r=petrochenkov Mark `@RUSTC_BUILTIN` search path usage as unstable Follow up to rust-lang#121843 r? `@petrochenkov`
2 parents cd90d5c + 4815155 commit c10c5dd

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

compiler/rustc_interface/src/tests.rs

+1
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,7 @@ fn test_search_paths_tracking_hash_different_order() {
321321
&opts.target_triple,
322322
&early_dcx,
323323
search_path,
324+
false,
324325
));
325326
};
326327

compiler/rustc_session/src/config.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -2548,7 +2548,13 @@ pub fn build_session_options(early_dcx: &mut EarlyDiagCtxt, matches: &getopts::M
25482548

25492549
let mut search_paths = vec![];
25502550
for s in &matches.opt_strs("L") {
2551-
search_paths.push(SearchPath::from_cli_opt(&sysroot, &target_triple, early_dcx, s));
2551+
search_paths.push(SearchPath::from_cli_opt(
2552+
&sysroot,
2553+
&target_triple,
2554+
early_dcx,
2555+
s,
2556+
unstable_opts.unstable_options,
2557+
));
25522558
}
25532559

25542560
let working_dir = std::env::current_dir().unwrap_or_else(|e| {

compiler/rustc_session/src/search_paths.rs

+9
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ impl SearchPath {
5252
triple: &TargetTriple,
5353
early_dcx: &EarlyDiagCtxt,
5454
path: &str,
55+
is_unstable_enabled: bool,
5556
) -> Self {
5657
let (kind, path) = if let Some(stripped) = path.strip_prefix("native=") {
5758
(PathKind::Native, stripped)
@@ -68,6 +69,14 @@ impl SearchPath {
6869
};
6970
let dir = match path.strip_prefix("@RUSTC_BUILTIN") {
7071
Some(stripped) => {
72+
if !is_unstable_enabled {
73+
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
74+
early_dcx.early_fatal(
75+
"the `-Z unstable-options` flag must also be passed to \
76+
enable the use of `@RUSTC_BUILTIN`",
77+
);
78+
}
79+
7180
make_target_lib_path(sysroot, triple.triple()).join("builtin").join(stripped)
7281
}
7382
None => PathBuf::from(path),

src/librustdoc/config.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,16 @@ impl Options {
635635
let libs = matches
636636
.opt_strs("L")
637637
.iter()
638-
.map(|s| SearchPath::from_cli_opt(&sysroot, &target, early_dcx, s))
638+
.map(|s| {
639+
SearchPath::from_cli_opt(
640+
&sysroot,
641+
&target,
642+
early_dcx,
643+
s,
644+
#[allow(rustc::bad_opt_access)] // we have no `Session` here
645+
unstable_opts.unstable_options,
646+
)
647+
})
639648
.collect();
640649

641650
let show_coverage = matches.opt_present("show-coverage");

0 commit comments

Comments
 (0)