ff73a40995
Avoid showing this error where it doesn't make sense by not assuming "and" and "or" were intended to mean "&&" and "||" until after we decide to continue parsing input as an associative expression. Note that the decision of whether or not to continue parsing input as an associative expression doesn't actually depend on this assumption. Fixes #75599
25 lines
316 B
Rust
25 lines
316 B
Rust
// check-pass
|
|
#![allow(non_upper_case_globals)]
|
|
|
|
const or: usize = 1;
|
|
const and: usize = 2;
|
|
|
|
mod or {
|
|
pub const X: usize = 3;
|
|
}
|
|
|
|
mod and {
|
|
pub const X: usize = 4;
|
|
}
|
|
|
|
fn main() {
|
|
match 0 {
|
|
0 => {}
|
|
or => {}
|
|
and => {}
|
|
or::X => {}
|
|
and::X => {}
|
|
_ => {}
|
|
}
|
|
}
|