Skip to content

Commit a9d4d2b

Browse files
authored
Rollup merge of #66172 - jsgf:stabilize-atfile, r=nikomatsakis
Stabilize @file command line arguments Issue #63576
2 parents 299cc07 + 446a43d commit a9d4d2b

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

src/librustc_driver/args.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,12 @@ use std::fmt;
33
use std::fs;
44
use std::io;
55
use std::str;
6-
use std::sync::atomic::{AtomicBool, Ordering};
7-
8-
static USED_ARGSFILE_FEATURE: AtomicBool = AtomicBool::new(false);
9-
10-
pub fn used_unstable_argsfile() -> bool {
11-
USED_ARGSFILE_FEATURE.load(Ordering::Relaxed)
12-
}
136

147
pub fn arg_expand(arg: String) -> Result<Vec<String>, Error> {
158
if arg.starts_with("@") {
169
let path = &arg[1..];
1710
let file = match fs::read_to_string(path) {
18-
Ok(file) => {
19-
USED_ARGSFILE_FEATURE.store(true, Ordering::Relaxed);
20-
file
21-
}
11+
Ok(file) => file,
2212
Err(ref err) if err.kind() == io::ErrorKind::InvalidData => {
2313
return Err(Error::Utf8Error(Some(path.to_string())));
2414
}

src/librustc_driver/lib.rs

-6
Original file line numberDiff line numberDiff line change
@@ -1016,12 +1016,6 @@ pub fn handle_options(args: &[String]) -> Option<getopts::Matches> {
10161016
// (unstable option being used on stable)
10171017
nightly_options::check_nightly_options(&matches, &config::rustc_optgroups());
10181018

1019-
// Late check to see if @file was used without unstable options enabled
1020-
if crate::args::used_unstable_argsfile() && !nightly_options::is_unstable_enabled(&matches) {
1021-
early_error(ErrorOutputType::default(),
1022-
"@path is unstable - use -Z unstable-options to enable its use");
1023-
}
1024-
10251019
if matches.opt_present("h") || matches.opt_present("help") {
10261020
// Only show unstable options in --help if we accept unstable options.
10271021
usage(matches.opt_present("verbose"), nightly_options::is_unstable_enabled(&matches));

0 commit comments

Comments
 (0)