}
}
+fn test_while_and() {
+ let a = true;
+ let b = false;
+ while a and b {
+ //~^ ERROR expected one of `!`, `.`, `::`, `?`, `{`, or an operator, found `and`
+ println!("both");
+ }
+}
+
+fn test_while_or() {
+ let a = true;
+ let b = false;
+ while a or b {
+ //~^ ERROR expected one of `!`, `.`, `::`, `?`, `{`, or an operator, found `or`
+ println!("both");
+ }
+}
+
fn main() {
}
| expected one of 8 possible tokens here
| help: use `||` instead of `or` for the boolean operator: `||`
-error: aborting due to 4 previous errors
+error: expected one of `!`, `.`, `::`, `?`, `{`, or an operator, found `and`
+ --> $DIR/issue-54109-and_instead_of_ampersands.rs:50:13
+ |
+LL | while a and b {
+ | ^^^
+ | |
+ | expected one of `!`, `.`, `::`, `?`, `{`, or an operator here
+ | help: use `&&` instead of `and` for the boolean operator: `&&`
+
+error: expected one of `!`, `.`, `::`, `?`, `{`, or an operator, found `or`
+ --> $DIR/issue-54109-and_instead_of_ampersands.rs:59:13
+ |
+LL | while a or b {
+ | ^^
+ | |
+ | expected one of `!`, `.`, `::`, `?`, `{`, or an operator here
+ | help: use `||` instead of `or` for the boolean operator: `||`
+
+error: aborting due to 6 previous errors
+