rust/tests/ui/parser/assoc/assoc-oddities-1.rs
2024-02-16 20:02:50 +00:00

12 lines
455 B
Rust
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//@ compile-flags: -Z parse-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 arent `=`
// see assoc-oddities-2 and assoc-oddities-3
..if c { a } else { b }[n]; //~ ERROR expected one of
}