Skip to content

Commit 0bb4447

Browse files
authored
Rollup merge of #133590 - nnethercote:rename-parse-only, r=estebank
Rename `-Zparse-only` It's a misleading name. r? ```@estebank```
2 parents 8a970c9 + accdfa1 commit 0bb4447

File tree

15 files changed

+21
-18
lines changed

15 files changed

+21
-18
lines changed

compiler/rustc_driver_impl/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,9 @@ fn run_compiler(
418418
return early_exit();
419419
}
420420

421-
if sess.opts.unstable_opts.parse_only || sess.opts.unstable_opts.show_span.is_some() {
421+
if sess.opts.unstable_opts.parse_crate_root_only
422+
|| sess.opts.unstable_opts.show_span.is_some()
423+
{
422424
return early_exit();
423425
}
424426

compiler/rustc_interface/src/tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ fn test_unstable_options_tracking_hash() {
712712
untracked!(no_analysis, true);
713713
untracked!(no_leak_check, true);
714714
untracked!(no_parallel_backend, true);
715-
untracked!(parse_only, true);
715+
untracked!(parse_crate_root_only, true);
716716
// `pre_link_arg` is omitted because it just forwards to `pre_link_args`.
717717
untracked!(pre_link_args, vec![String::from("abc"), String::from("def")]);
718718
untracked!(print_codegen_stats, true);

compiler/rustc_session/src/config.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ impl Options {
12081208

12091209
/// Returns `true` if there will be an output file generated.
12101210
pub fn will_create_output_file(&self) -> bool {
1211-
!self.unstable_opts.parse_only && // The file is just being parsed
1211+
!self.unstable_opts.parse_crate_root_only && // The file is just being parsed
12121212
self.unstable_opts.ls.is_empty() // The file is just being queried
12131213
}
12141214

@@ -1864,7 +1864,7 @@ fn parse_output_types(
18641864
matches: &getopts::Matches,
18651865
) -> OutputTypes {
18661866
let mut output_types = BTreeMap::new();
1867-
if !unstable_opts.parse_only {
1867+
if !unstable_opts.parse_crate_root_only {
18681868
for list in matches.opt_strs("emit") {
18691869
for output_type in list.split(',') {
18701870
let (shorthand, path) = split_out_file_name(output_type);

compiler/rustc_session/src/options.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1937,8 +1937,9 @@ options! {
19371937
"support compiling tests with panic=abort (default: no)"),
19381938
panic_in_drop: PanicStrategy = (PanicStrategy::Unwind, parse_panic_strategy, [TRACKED],
19391939
"panic strategy for panics in drops"),
1940-
parse_only: bool = (false, parse_bool, [UNTRACKED],
1941-
"parse only; do not compile, assemble, or link (default: no)"),
1940+
parse_crate_root_only: bool = (false, parse_bool, [UNTRACKED],
1941+
"parse the crate root file only; do not parse other files, compile, assemble, or link \
1942+
(default: no)"),
19421943
patchable_function_entry: PatchableFunctionEntry = (PatchableFunctionEntry::default(), parse_patchable_function_entry, [TRACKED],
19431944
"nop padding at function entry"),
19441945
plt: Option<bool> = (None, parse_opt_bool, [TRACKED],
@@ -2036,7 +2037,7 @@ written to standard error output)"),
20362037
shell_argfiles: bool = (false, parse_bool, [UNTRACKED],
20372038
"allow argument files to be specified with POSIX \"shell-style\" argument quoting"),
20382039
show_span: Option<String> = (None, parse_opt_string, [TRACKED],
2039-
"show spans for compiler debugging (expr|pat|ty)"),
2040+
"show spans in the crate root file, for compiler debugging (expr|pat|ty)"),
20402041
simulate_remapped_rust_src_base: Option<PathBuf> = (None, parse_opt_pathbuf, [TRACKED],
20412042
"simulate the effect of remap-debuginfo = true at bootstrapping by remapping path \
20422043
to rust's source base directory. only meant for testing purposes"),

tests/ui/generic-associated-types/parse/in-trait-impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ check-pass
2-
//@ compile-flags: -Z parse-only
2+
//@ compile-flags: -Z parse-crate-root-only
33

44
impl<T> Baz for T where T: Foo {
55
type Quux<'a> = <T as Foo>::Bar<'a, 'static>;

tests/ui/generic-associated-types/parse/in-trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ check-pass
2-
//@ compile-flags: -Z parse-only
2+
//@ compile-flags: -Z parse-crate-root-only
33

44
use std::ops::Deref;
55
use std::fmt::Debug;

tests/ui/impl-trait/impl-trait-plus-priority.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags: -Z parse-only
1+
//@ compile-flags: -Z parse-crate-root-only
22

33
fn f() -> impl A + {} // OK
44
fn f() -> impl A + B {} // OK

tests/ui/parser/assoc/assoc-oddities-1.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags: -Z parse-only
1+
//@ compile-flags: -Z parse-crate-root-only
22

33
fn main() {
44
// following lines below parse and must not fail

tests/ui/parser/assoc/assoc-oddities-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags: -Z parse-only
1+
//@ compile-flags: -Z parse-crate-root-only
22

33
fn main() {
44
// see assoc-oddities-1 for explanation

tests/ui/parser/bounds-type.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags: -Z parse-only
1+
//@ compile-flags: -Z parse-crate-root-only
22
//@ edition: 2021
33

44
struct S<

tests/ui/parser/impl-qpath.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ check-pass
2-
//@ compile-flags: -Z parse-only
2+
//@ compile-flags: -Z parse-crate-root-only
33

44
impl <*const u8>::AssocTy {} // OK
55
impl <Type as Trait>::AssocTy {} // OK

tests/ui/parser/issues/issue-17904.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags: -Zparse-only
1+
//@ compile-flags: -Zparse-crate-root-only
22

33
struct Baz<U> where U: Eq(U); //This is parsed as the new Fn* style parenthesis syntax.
44
struct Baz<U> where U: Eq(U) -> R; // Notice this parses as well.

tests/ui/traits/const-traits/syntax.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags: -Z parse-only
1+
//@ compile-flags: -Z parse-crate-root-only
22
//@ check-pass
33

44
#![feature(const_trait_bound_opt_out)]

tests/ui/traits/const-traits/tilde-const-syntax.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags: -Z parse-only
1+
//@ compile-flags: -Z parse-crate-root-only
22
//@ check-pass
33

44
#![feature(const_trait_impl)]

tests/ui/traits/const-traits/tilde-twice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags: -Z parse-only
1+
//@ compile-flags: -Z parse-crate-root-only
22

33
#![feature(const_trait_impl)]
44

0 commit comments

Comments
 (0)