]> git.proxmox.com Git - rustc.git/blob - tests/ui/parser/ternary_operator.stderr
New upstream version 1.75.0+dfsg1
[rustc.git] / tests / ui / parser / ternary_operator.stderr
1 error: Rust has no ternary operator
2 --> $DIR/ternary_operator.rs:2:19
3 |
4 LL | let x = 5 > 2 ? true : false;
5 | ^^^^^^^^^^^^^^^
6 |
7 = help: use an `if-else` expression instead
8
9 error: Rust has no ternary operator
10 --> $DIR/ternary_operator.rs:8:19
11 |
12 LL | let x = 5 > 2 ? { true } : { false };
13 | ^^^^^^^^^^^^^^^^^^^^^^^
14 |
15 = help: use an `if-else` expression instead
16
17 error: Rust has no ternary operator
18 --> $DIR/ternary_operator.rs:14:19
19 |
20 LL | let x = 5 > 2 ? f32::MAX : f32::MIN;
21 | ^^^^^^^^^^^^^^^^^^^^^^
22 |
23 = help: use an `if-else` expression instead
24
25 error: expected one of `.`, `;`, `?`, `}`, or an operator, found keyword `return`
26 --> $DIR/ternary_operator.rs:21:9
27 |
28 LL | v ? return;
29 | ^^^^^^ expected one of `.`, `;`, `?`, `}`, or an operator
30
31 error: expected one of `.`, `;`, `?`, `else`, or an operator, found `:`
32 --> $DIR/ternary_operator.rs:26:37
33 |
34 LL | let x = 5 > 2 ? { let x = vec![]: Vec<u16>; x } : { false };
35 | ^ expected one of `.`, `;`, `?`, `else`, or an operator
36 |
37 = note: type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
38
39 error: Rust has no ternary operator
40 --> $DIR/ternary_operator.rs:26:19
41 |
42 LL | let x = 5 > 2 ? { let x = vec![]: Vec<u16>; x } : { false };
43 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44 |
45 = help: use an `if-else` expression instead
46
47 error: aborting due to 6 previous errors
48