mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-02 21:17:39 +00:00

I was surprised to find that running with `-Zparse-only` only parses the crate root file. Other files aren't parsed because that happens later during expansion. This commit renames the option and updates the help message to make this clearer.
12 lines
466 B
Rust
12 lines
466 B
Rust
//@ compile-flags: -Z parse-crate-root-only
|
||
|
||
fn main() {
|
||
// following lines below parse and must not fail
|
||
x = if c { a } else { b }();
|
||
x = if true { 1 } else { 0 } as *mut _;
|
||
// however this does not parse and probably should fail to retain compat?
|
||
// N.B., `..` here is arbitrary, failure happens/should happen ∀ops that aren’t `=`
|
||
// see assoc-oddities-2 and assoc-oddities-3
|
||
..if c { a } else { b }[n]; //~ ERROR expected one of
|
||
}
|