fork/rust
git clone https://git.julia.blue/fork/rust
b8cedc00407
1.42.0
1warning: denote infinite loops with `loop { ... }` 2 --> $DIR/loop-break-value.rs:26:5 3 | 4LL | 'while_loop: while true { 5 | ^^^^^^^^^^^^^^^^^^^^^^^ help: use `loop` 6 | 7 = note: `#[warn(while_true)]` on by default 8 9error[E0571]: `break` with value from a `while` loop 10 --> $DIR/loop-break-value.rs:28:9 11 | 12LL | break (); 13 | ^^^^^^^^ can only break with a value inside `loop` or breakable block 14 | 15help: instead, use `break` on its own without a value inside this `while` loop 16 | 17LL | break; 18 | ^^^^^ 19 20error[E0571]: `break` with value from a `while` loop 21 --> $DIR/loop-break-value.rs:30:13 22 | 23LL | break 'while_loop 123; 24 | ^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block 25 | 26help: instead, use `break` on its own without a value inside this `while` loop 27 | 28LL | break; 29 | ^^^^^ 30 31error[E0571]: `break` with value from a `while` loop 32 --> $DIR/loop-break-value.rs:38:12 33 | 34LL | if break () { 35 | ^^^^^^^^ can only break with a value inside `loop` or breakable block 36 | 37help: instead, use `break` on its own without a value inside this `while` loop 38 | 39LL | if break { 40 | ^^^^^ 41 42error[E0571]: `break` with value from a `while` loop 43 --> $DIR/loop-break-value.rs:43:9 44 | 45LL | break None; 46 | ^^^^^^^^^^ can only break with a value inside `loop` or breakable block 47 | 48help: instead, use `break` on its own without a value inside this `while` loop 49 | 50LL | break; 51 | ^^^^^ 52 53error[E0571]: `break` with value from a `while` loop 54 --> $DIR/loop-break-value.rs:49:13 55 | 56LL | break 'while_let_loop "nope"; 57 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block 58 | 59help: instead, use `break` on its own without a value inside this `while` loop 60 | 61LL | break; 62 | ^^^^^ 63 64error[E0571]: `break` with value from a `for` loop 65 --> $DIR/loop-break-value.rs:56:9 66 | 67LL | break (); 68 | ^^^^^^^^ can only break with a value inside `loop` or breakable block 69 | 70help: instead, use `break` on its own without a value inside this `for` loop 71 | 72LL | break; 73 | ^^^^^ 74 75error[E0571]: `break` with value from a `for` loop 76 --> $DIR/loop-break-value.rs:57:9 77 | 78LL | break [()]; 79 | ^^^^^^^^^^ can only break with a value inside `loop` or breakable block 80 | 81help: instead, use `break` on its own without a value inside this `for` loop 82 | 83LL | break; 84 | ^^^^^ 85 86error[E0571]: `break` with value from a `for` loop 87 --> $DIR/loop-break-value.rs:64:13 88 | 89LL | break 'for_loop Some(17); 90 | ^^^^^^^^^^^^^^^^^^^^^^^^ can only break with a value inside `loop` or breakable block 91 | 92help: instead, use `break` on its own without a value inside this `for` loop 93 | 94LL | break; 95 | ^^^^^ 96 97error[E0308]: mismatched types 98 --> $DIR/loop-break-value.rs:4:31 99 | 100LL | let val: ! = loop { break break; }; 101 | ^^^^^ expected `!`, found `()` 102 | 103 = note: expected type `!` 104 found unit type `()` 105 106error[E0308]: mismatched types 107 --> $DIR/loop-break-value.rs:11:19 108 | 109LL | break 123; 110 | ^^^ expected `&str`, found integer 111 112error[E0308]: mismatched types 113 --> $DIR/loop-break-value.rs:16:15 114 | 115LL | break "asdf"; 116 | ^^^^^^ expected `i32`, found `&str` 117 118error[E0308]: mismatched types 119 --> $DIR/loop-break-value.rs:21:31 120 | 121LL | break 'outer_loop "nope"; 122 | ^^^^^^ expected `i32`, found `&str` 123 124error[E0308]: mismatched types 125 --> $DIR/loop-break-value.rs:73:26 126 | 127LL | break 'c 123; 128 | ^^^ expected `()`, found integer 129 130error[E0308]: mismatched types 131 --> $DIR/loop-break-value.rs:80:15 132 | 133LL | break (break, break); 134 | ^^^^^^^^^^^^^^ expected `()`, found tuple 135 | 136 = note: expected unit type `()` 137 found tuple `(!, !)` 138 139error[E0308]: mismatched types 140 --> $DIR/loop-break-value.rs:85:15 141 | 142LL | break 2; 143 | ^ expected `()`, found integer 144 145error[E0308]: mismatched types 146 --> $DIR/loop-break-value.rs:90:9 147 | 148LL | break; 149 | ^^^^^ 150 | | 151 | expected integer, found `()` 152 | help: give it a value of the expected type: `break value` 153 154error: aborting due to 16 previous errors 155 156Some errors have detailed explanations: E0308, E0571. 157For more information about an error, try `rustc --explain E0308`.