]> git.lizzy.rs Git - rust.git/blob - tests/ui/did_you_mean/issue-46836-identifier-not-instead-of-negation.rs
Rollup merge of #104965 - zacklukem:p-option-as_ref-docs, r=scottmcm
[rust.git] / tests / ui / did_you_mean / issue-46836-identifier-not-instead-of-negation.rs
1 fn gratitude() {
2     let for_you = false;
3     if not for_you {
4         //~^ ERROR unexpected `for_you` after identifier
5         println!("I couldn't");
6     }
7 }
8
9 fn qualification() {
10     let the_worst = true;
11     while not the_worst {
12         //~^ ERROR unexpected `the_worst` after identifier
13         println!("still pretty bad");
14     }
15 }
16
17 fn should_we() {
18     let not = true;
19     if not  // lack of braces is [sic]
20         println!("Then when?");
21     //~^ ERROR expected `{`, found `;
22     //~| ERROR unexpected `println` after identifier
23 }
24
25 fn sleepy() {
26     let resource = not 2;
27     //~^ ERROR unexpected `2` after identifier
28 }
29
30 fn main() {
31     let be_smothered_out_before = true;
32     let young_souls = not be_smothered_out_before;
33     //~^ ERROR unexpected `be_smothered_out_before` after identifier
34 }