|
1 |
| -error: casts followed by index operators are not supported |
2 |
| - --> $DIR/issue-35813-postfix-after-cast.rs:9:5 |
| 1 | +error: casts cannot be followed by indexing |
| 2 | + --> $DIR/issue-35813-postfix-after-cast.rs:10:5 |
3 | 3 | |
|
4 | 4 | LL | vec![1, 2, 3] as Vec<i32>[0];
|
5 |
| - | -------------------------^^^ |
6 |
| - | | |
7 |
| - | help: try surrounding the expression with parentheses: `(vec![1, 2, 3] as Vec<i32>)` |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(vec![1, 2, 3] as Vec<i32>)` |
8 | 6 |
|
9 |
| -error: casts followed by index operators are not supported |
10 |
| - --> $DIR/issue-35813-postfix-after-cast.rs:14:5 |
| 7 | +error: casts cannot be followed by indexing |
| 8 | + --> $DIR/issue-35813-postfix-after-cast.rs:12:5 |
| 9 | + | |
| 10 | +LL | vec![1, 2, 3]: Vec<i32>[0]; |
| 11 | + | ^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(vec![1, 2, 3]: Vec<i32>)` |
| 12 | + |
| 13 | +error: casts cannot be followed by indexing |
| 14 | + --> $DIR/issue-35813-postfix-after-cast.rs:17:5 |
11 | 15 | |
|
12 | 16 | LL | (&[0]) as &[i32][0];
|
13 |
| - | ----------------^^^ |
14 |
| - | | |
15 |
| - | help: try surrounding the expression with parentheses: `((&[0]) as &[i32])` |
| 17 | + | ^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `((&[0]) as &[i32])` |
16 | 18 |
|
17 |
| -error: casts followed by index operators are not supported |
18 |
| - --> $DIR/issue-35813-postfix-after-cast.rs:20:18 |
| 19 | +error: casts cannot be followed by indexing |
| 20 | + --> $DIR/issue-35813-postfix-after-cast.rs:19:5 |
| 21 | + | |
| 22 | +LL | (&[0i32]): &[i32; 1][0]; |
| 23 | + | ^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `((&[0i32]): &[i32; 1])` |
| 24 | + |
| 25 | +error: casts cannot be followed by indexing |
| 26 | + --> $DIR/issue-35813-postfix-after-cast.rs:40:18 |
19 | 27 | |
|
20 | 28 | LL | let x: i32 = &vec![1, 2, 3] as &Vec<i32>[0];
|
21 |
| - | ---------------------------^^^ |
22 |
| - | | |
23 |
| - | help: try surrounding the expression with parentheses: `(&vec![1, 2, 3] as &Vec<i32>)` |
| 29 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(&vec![1, 2, 3] as &Vec<i32>)` |
24 | 30 |
|
25 |
| -error: casts followed by method call expressions are not supported |
26 |
| - --> $DIR/issue-35813-postfix-after-cast.rs:33:8 |
| 31 | +error: casts cannot be followed by a method call |
| 32 | + --> $DIR/issue-35813-postfix-after-cast.rs:45:5 |
| 33 | + | |
| 34 | +LL | 0 as i32.max(0); |
| 35 | + | ^^^^^^^^ help: try surrounding the expression in parentheses: `(0 as i32)` |
| 36 | + |
| 37 | +error: casts cannot be followed by a method call |
| 38 | + --> $DIR/issue-35813-postfix-after-cast.rs:47:5 |
| 39 | + | |
| 40 | +LL | 0: i32.max(0); |
| 41 | + | ^^^^^^ help: try surrounding the expression in parentheses: `(0: i32)` |
| 42 | + |
| 43 | +error: casts cannot be followed by a method call |
| 44 | + --> $DIR/issue-35813-postfix-after-cast.rs:62:8 |
27 | 45 | |
|
28 | 46 | LL | if 5u64 as i32.max(0) == 0 {
|
29 |
| - | -----------^^^^^^^ |
30 |
| - | | |
31 |
| - | help: try surrounding the expression with parentheses: `(5u64 as i32)` |
| 47 | + | ^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(5u64 as i32)` |
32 | 48 |
|
33 |
| -error: casts followed by method call expressions are not supported |
34 |
| - --> $DIR/issue-35813-postfix-after-cast.rs:40:9 |
| 49 | +error: casts cannot be followed by a method call |
| 50 | + --> $DIR/issue-35813-postfix-after-cast.rs:65:8 |
| 51 | + | |
| 52 | +LL | if 5u64: u64.max(0) == 0 { |
| 53 | + | ^^^^^^^^^ help: try surrounding the expression in parentheses: `(5u64: u64)` |
| 54 | + |
| 55 | +error: casts cannot be followed by a method call |
| 56 | + --> $DIR/issue-35813-postfix-after-cast.rs:72:9 |
35 | 57 | |
|
36 | 58 | LL | 5u64 as u32.max(0) == 0
|
37 |
| - | -----------^^^^^^^ |
38 |
| - | | |
39 |
| - | help: try surrounding the expression with parentheses: `(5u64 as u32)` |
| 59 | + | ^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(5u64 as u32)` |
| 60 | + |
| 61 | +error: casts cannot be followed by a method call |
| 62 | + --> $DIR/issue-35813-postfix-after-cast.rs:76:9 |
| 63 | + | |
| 64 | +LL | 5u64: u64.max(0) == 0 |
| 65 | + | ^^^^^^^^^ help: try surrounding the expression in parentheses: `(5u64: u64)` |
40 | 66 |
|
41 |
| -error: casts followed by index operators are not supported |
42 |
| - --> $DIR/issue-35813-postfix-after-cast.rs:45:24 |
| 67 | +error: casts cannot be followed by indexing |
| 68 | + --> $DIR/issue-35813-postfix-after-cast.rs:81:24 |
43 | 69 | |
|
44 | 70 | LL | static bar: &[i32] = &(&[1,2,3] as &[i32][0..1]);
|
45 |
| - | ------------------^^^^^^ |
46 |
| - | | |
47 |
| - | help: try surrounding the expression with parentheses: `(&[1,2,3] as &[i32])` |
| 71 | + | ^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(&[1,2,3] as &[i32])` |
| 72 | + |
| 73 | +error: casts cannot be followed by indexing |
| 74 | + --> $DIR/issue-35813-postfix-after-cast.rs:84:25 |
| 75 | + | |
| 76 | +LL | static bar2: &[i32] = &(&[1i32,2,3]: &[i32; 3][0..1]); |
| 77 | + | ^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(&[1i32,2,3]: &[i32; 3])` |
| 78 | + |
| 79 | +error: casts cannot be followed by ? |
| 80 | + --> $DIR/issue-35813-postfix-after-cast.rs:89:5 |
| 81 | + | |
| 82 | +LL | Err(0u64) as Result<u64,u64>?; |
| 83 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(Err(0u64) as Result<u64,u64>)` |
| 84 | + |
| 85 | +error: casts cannot be followed by ? |
| 86 | + --> $DIR/issue-35813-postfix-after-cast.rs:91:5 |
| 87 | + | |
| 88 | +LL | Err(0u64): Result<u64,u64>?; |
| 89 | + | ^^^^^^^^^-^^^^^^^^^^^^^^^^ |
| 90 | + | | |
| 91 | + | help: maybe write a path separator here: `::` |
| 92 | + | |
| 93 | + = note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>` |
| 94 | + = note: for more information, see https://github.com/rust-lang/rust/issues/23416 |
48 | 95 |
|
49 |
| -error: casts followed by awaits are not supported |
50 |
| - --> $DIR/issue-35813-postfix-after-cast.rs:49:5 |
| 96 | +error: casts cannot be followed by a function call |
| 97 | + --> $DIR/issue-35813-postfix-after-cast.rs:115:5 |
| 98 | + | |
| 99 | +LL | drop as fn(u8)(0); |
| 100 | + | ^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(drop as fn(u8))` |
| 101 | + |
| 102 | +error: casts cannot be followed by a function call |
| 103 | + --> $DIR/issue-35813-postfix-after-cast.rs:117:5 |
| 104 | + | |
| 105 | +LL | drop_ptr: fn(u8)(0); |
| 106 | + | ^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(drop_ptr: fn(u8))` |
| 107 | + |
| 108 | +error: casts cannot be followed by `.await` |
| 109 | + --> $DIR/issue-35813-postfix-after-cast.rs:122:5 |
51 | 110 | |
|
52 | 111 | LL | Box::pin(noop()) as Pin<Box<dyn Future<Output = ()>>>.await;
|
53 |
| - | -----------------------------------------------------^^^^^^ |
54 |
| - | | |
55 |
| - | help: try surrounding the expression with parentheses: `(Box::pin(noop()) as Pin<Box<dyn Future<Output = ()>>>)` |
| 112 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(Box::pin(noop()) as Pin<Box<dyn Future<Output = ()>>>)` |
| 113 | + |
| 114 | +error: casts cannot be followed by `.await` |
| 115 | + --> $DIR/issue-35813-postfix-after-cast.rs:125:5 |
| 116 | + | |
| 117 | +LL | Box::pin(noop()): Pin<Box<_>>.await; |
| 118 | + | ^^^^^^^^^^^^^^^^-^^^^^^^^^^^^ |
| 119 | + | | |
| 120 | + | help: maybe write a path separator here: `::` |
| 121 | + | |
| 122 | + = note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>` |
| 123 | + = note: for more information, see https://github.com/rust-lang/rust/issues/23416 |
56 | 124 |
|
57 |
| -error: casts followed by field access expressions are not supported |
58 |
| - --> $DIR/issue-35813-postfix-after-cast.rs:61:5 |
| 125 | +error: casts cannot be followed by a field access |
| 126 | + --> $DIR/issue-35813-postfix-after-cast.rs:137:5 |
59 | 127 | |
|
60 | 128 | LL | Foo::default() as Foo.bar;
|
61 |
| - | ---------------------^^^^ |
62 |
| - | | |
63 |
| - | help: try surrounding the expression with parentheses: `(Foo::default() as Foo)` |
| 129 | + | ^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(Foo::default() as Foo)` |
| 130 | + |
| 131 | +error: casts cannot be followed by a field access |
| 132 | + --> $DIR/issue-35813-postfix-after-cast.rs:139:5 |
| 133 | + | |
| 134 | +LL | Foo::default(): Foo.bar; |
| 135 | + | ^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(Foo::default(): Foo)` |
| 136 | + |
| 137 | +error: casts cannot be followed by a method call |
| 138 | + --> $DIR/issue-35813-postfix-after-cast.rs:54:9 |
| 139 | + | |
| 140 | +LL | if true { 33 } else { 44 } as i32.max(0), |
| 141 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(if true { 33 } else { 44 } as i32)` |
| 142 | + |
| 143 | +error: casts cannot be followed by a method call |
| 144 | + --> $DIR/issue-35813-postfix-after-cast.rs:56:9 |
| 145 | + | |
| 146 | +LL | if true { 33 } else { 44 }: i32.max(0) |
| 147 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(if true { 33 } else { 44 }: i32)` |
| 148 | + |
| 149 | +error[E0214]: parenthesized type parameters may only be used with a `Fn` trait |
| 150 | + --> $DIR/issue-35813-postfix-after-cast.rs:101:13 |
| 151 | + | |
| 152 | +LL | drop as F(); |
| 153 | + | ^^^ only `Fn` traits may use parentheses |
64 | 154 |
|
65 |
| -error: casts followed by method call expressions are not supported |
66 |
| - --> $DIR/issue-35813-postfix-after-cast.rs:27:9 |
| 155 | +error[E0214]: parenthesized type parameters may only be used with a `Fn` trait |
| 156 | + --> $DIR/issue-35813-postfix-after-cast.rs:103:15 |
67 | 157 | |
|
68 |
| -LL | if true { 33 } else { 44 } as i32.max(0) |
69 |
| - | ---------------------------------^^^^^^^ |
70 |
| - | | |
71 |
| - | help: try surrounding the expression with parentheses: `(if true { 33 } else { 44 } as i32)` |
| 158 | +LL | drop_ptr: F(); |
| 159 | + | ^^^ only `Fn` traits may use parentheses |
72 | 160 |
|
73 |
| -error: aborting due to 9 previous errors |
| 161 | +error: aborting due to 25 previous errors |
74 | 162 |
|
| 163 | +For more information about this error, try `rustc --explain E0214`. |
0 commit comments