rust/src/test/ui/issues/issue-75599.rs
Tyson Nottingham ff73a40995 Don't emit "is not a logical operator" error outside of associative expressions
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
2020-08-18 12:15:57 -07:00

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 => {}
_ => {}
}
}