Rollup merge of #124285 - ferrocene:unstable-L-rust-builtin, r=petrochenkov
Mark `@RUSTC_BUILTIN` search path usage as unstable Follow up to https://github.com/rust-lang/rust/pull/121843 r? `@petrochenkov`
This commit is contained in:
commit
5ff1fa9921
@ -321,6 +321,7 @@ fn test_search_paths_tracking_hash_different_order() {
|
|||||||
&opts.target_triple,
|
&opts.target_triple,
|
||||||
&early_dcx,
|
&early_dcx,
|
||||||
search_path,
|
search_path,
|
||||||
|
false,
|
||||||
));
|
));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2548,7 +2548,13 @@ pub fn build_session_options(early_dcx: &mut EarlyDiagCtxt, matches: &getopts::M
|
|||||||
|
|
||||||
let mut search_paths = vec![];
|
let mut search_paths = vec![];
|
||||||
for s in &matches.opt_strs("L") {
|
for s in &matches.opt_strs("L") {
|
||||||
search_paths.push(SearchPath::from_cli_opt(&sysroot, &target_triple, early_dcx, s));
|
search_paths.push(SearchPath::from_cli_opt(
|
||||||
|
&sysroot,
|
||||||
|
&target_triple,
|
||||||
|
early_dcx,
|
||||||
|
s,
|
||||||
|
unstable_opts.unstable_options,
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
let working_dir = std::env::current_dir().unwrap_or_else(|e| {
|
let working_dir = std::env::current_dir().unwrap_or_else(|e| {
|
||||||
|
@ -52,6 +52,7 @@ impl SearchPath {
|
|||||||
triple: &TargetTriple,
|
triple: &TargetTriple,
|
||||||
early_dcx: &EarlyDiagCtxt,
|
early_dcx: &EarlyDiagCtxt,
|
||||||
path: &str,
|
path: &str,
|
||||||
|
is_unstable_enabled: bool,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let (kind, path) = if let Some(stripped) = path.strip_prefix("native=") {
|
let (kind, path) = if let Some(stripped) = path.strip_prefix("native=") {
|
||||||
(PathKind::Native, stripped)
|
(PathKind::Native, stripped)
|
||||||
@ -68,6 +69,14 @@ impl SearchPath {
|
|||||||
};
|
};
|
||||||
let dir = match path.strip_prefix("@RUSTC_BUILTIN") {
|
let dir = match path.strip_prefix("@RUSTC_BUILTIN") {
|
||||||
Some(stripped) => {
|
Some(stripped) => {
|
||||||
|
if !is_unstable_enabled {
|
||||||
|
#[allow(rustc::untranslatable_diagnostic)] // FIXME: make this translatable
|
||||||
|
early_dcx.early_fatal(
|
||||||
|
"the `-Z unstable-options` flag must also be passed to \
|
||||||
|
enable the use of `@RUSTC_BUILTIN`",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
make_target_lib_path(sysroot, triple.triple()).join("builtin").join(stripped)
|
make_target_lib_path(sysroot, triple.triple()).join("builtin").join(stripped)
|
||||||
}
|
}
|
||||||
None => PathBuf::from(path),
|
None => PathBuf::from(path),
|
||||||
|
@ -635,7 +635,16 @@ impl Options {
|
|||||||
let libs = matches
|
let libs = matches
|
||||||
.opt_strs("L")
|
.opt_strs("L")
|
||||||
.iter()
|
.iter()
|
||||||
.map(|s| SearchPath::from_cli_opt(&sysroot, &target, early_dcx, s))
|
.map(|s| {
|
||||||
|
SearchPath::from_cli_opt(
|
||||||
|
&sysroot,
|
||||||
|
&target,
|
||||||
|
early_dcx,
|
||||||
|
s,
|
||||||
|
#[allow(rustc::bad_opt_access)] // we have no `Session` here
|
||||||
|
unstable_opts.unstable_options,
|
||||||
|
)
|
||||||
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
let show_coverage = matches.opt_present("show-coverage");
|
let show_coverage = matches.opt_present("show-coverage");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user