Skip to content

Commit 446a43d

Browse files
committed
Stabilize @file command line arguments
Issue rust-lang#63576
1 parent 3a1b3b3 commit 446a43d

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
@@ -1043,12 +1043,6 @@ pub fn handle_options(args: &[String]) -> Option<getopts::Matches> {
10431043
// (unstable option being used on stable)
10441044
nightly_options::check_nightly_options(&matches, &config::rustc_optgroups());
10451045

1046-
// Late check to see if @file was used without unstable options enabled
1047-
if crate::args::used_unstable_argsfile() && !nightly_options::is_unstable_enabled(&matches) {
1048-
early_error(ErrorOutputType::default(),
1049-
"@path is unstable - use -Z unstable-options to enable its use");
1050-
}
1051-
10521046
if matches.opt_present("h") || matches.opt_present("help") {
10531047
// Only show unstable options in --help if we accept unstable options.
10541048
usage(matches.opt_present("verbose"), nightly_options::is_unstable_enabled(&matches));

0 commit comments

Comments
 (0)