2020-02-15 18:20:53 -06:00
error: casts cannot be followed by indexing
--> $DIR/issue-35813-postfix-after-cast.rs:10:5
2020-02-08 23:34:38 -06:00
|
LL | vec![1, 2, 3] as Vec<i32>[0];
2020-02-15 18:20:53 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(vec![1, 2, 3] as Vec<i32>)`
2020-02-08 23:34:38 -06:00
2020-02-15 18:20:53 -06:00
error: casts cannot be followed by indexing
--> $DIR/issue-35813-postfix-after-cast.rs:12:5
|
LL | vec![1, 2, 3]: Vec<i32>[0];
| ^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(vec![1, 2, 3]: Vec<i32>)`
error: casts cannot be followed by indexing
--> $DIR/issue-35813-postfix-after-cast.rs:17:5
2020-02-08 23:34:38 -06:00
|
LL | (&[0]) as &[i32][0];
2020-02-15 18:20:53 -06:00
| ^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `((&[0]) as &[i32])`
2020-02-08 23:34:38 -06:00
2020-02-15 18:20:53 -06:00
error: casts cannot be followed by indexing
--> $DIR/issue-35813-postfix-after-cast.rs:19:5
|
LL | (&[0i32]): &[i32; 1][0];
| ^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `((&[0i32]): &[i32; 1])`
2020-02-22 13:36:09 -06:00
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:39:13
|
LL | let _ = 0i32: i32: i32.count_ones();
| ^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(0i32: i32: i32)`
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:41:13
|
LL | let _ = 0 as i32: i32.count_ones();
| ^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(0 as i32: i32)`
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:43:13
|
LL | let _ = 0i32: i32 as i32.count_ones();
| ^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(0i32: i32 as i32)`
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:45:13
|
LL | let _ = 0 as i32 as i32.count_ones();
| ^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(0 as i32 as i32)`
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:47:13
|
LL | let _ = 0i32: i32: i32 as u32 as i32.count_ones();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(0i32: i32: i32 as u32 as i32)`
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:49:13
|
LL | let _ = 0i32: i32.count_ones(): u32;
| ^^^^^^^^^ help: try surrounding the expression in parentheses: `(0i32: i32)`
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:51:13
|
LL | let _ = 0 as i32.count_ones(): u32;
| ^^^^^^^^ help: try surrounding the expression in parentheses: `(0 as i32)`
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:53:13
|
LL | let _ = 0i32: i32.count_ones() as u32;
| ^^^^^^^^^ help: try surrounding the expression in parentheses: `(0i32: i32)`
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:55:13
|
LL | let _ = 0 as i32.count_ones() as u32;
| ^^^^^^^^ help: try surrounding the expression in parentheses: `(0 as i32)`
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:57:13
|
LL | let _ = 0i32: i32: i32.count_ones() as u32 as i32;
| ^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(0i32: i32: i32)`
2020-02-15 18:20:53 -06:00
error: casts cannot be followed by indexing
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:63:18
2020-02-08 23:34:38 -06:00
|
LL | let x: i32 = &vec![1, 2, 3] as &Vec<i32>[0];
2020-02-15 18:20:53 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(&vec![1, 2, 3] as &Vec<i32>)`
2020-02-08 23:34:38 -06:00
2020-02-15 18:20:53 -06:00
error: casts cannot be followed by a method call
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:68:5
2020-02-15 18:20:53 -06:00
|
LL | 0 as i32.max(0);
| ^^^^^^^^ help: try surrounding the expression in parentheses: `(0 as i32)`
error: casts cannot be followed by a method call
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:70:5
2020-02-15 18:20:53 -06:00
|
LL | 0: i32.max(0);
| ^^^^^^ help: try surrounding the expression in parentheses: `(0: i32)`
error: casts cannot be followed by a method call
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:85:8
2020-02-08 23:34:38 -06:00
|
LL | if 5u64 as i32.max(0) == 0 {
2020-02-15 18:20:53 -06:00
| ^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(5u64 as i32)`
2020-02-08 23:34:38 -06:00
2020-02-15 18:20:53 -06:00
error: casts cannot be followed by a method call
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:88:8
2020-02-15 18:20:53 -06:00
|
LL | if 5u64: u64.max(0) == 0 {
| ^^^^^^^^^ help: try surrounding the expression in parentheses: `(5u64: u64)`
error: casts cannot be followed by a method call
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:95:9
2020-02-08 23:34:38 -06:00
|
LL | 5u64 as u32.max(0) == 0
2020-02-15 18:20:53 -06:00
| ^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(5u64 as u32)`
error: casts cannot be followed by a method call
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:99:9
2020-02-15 18:20:53 -06:00
|
LL | 5u64: u64.max(0) == 0
| ^^^^^^^^^ help: try surrounding the expression in parentheses: `(5u64: u64)`
2020-02-08 23:34:38 -06:00
2020-02-15 18:20:53 -06:00
error: casts cannot be followed by indexing
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:104:24
2020-02-08 23:34:38 -06:00
|
LL | static bar: &[i32] = &(&[1,2,3] as &[i32][0..1]);
2020-02-15 18:20:53 -06:00
| ^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(&[1,2,3] as &[i32])`
error: casts cannot be followed by indexing
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:107:25
2020-02-15 18:20:53 -06:00
|
LL | static bar2: &[i32] = &(&[1i32,2,3]: &[i32; 3][0..1]);
| ^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(&[1i32,2,3]: &[i32; 3])`
error: casts cannot be followed by ?
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:112:5
2020-02-15 18:20:53 -06:00
|
LL | Err(0u64) as Result<u64,u64>?;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(Err(0u64) as Result<u64,u64>)`
error: casts cannot be followed by ?
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:114:5
2020-02-15 18:20:53 -06:00
|
LL | Err(0u64): Result<u64,u64>?;
| ^^^^^^^^^-^^^^^^^^^^^^^^^^
| |
| help: maybe write a path separator here: `::`
|
= note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
2020-02-16 00:08:29 -06:00
= note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information
2020-02-08 23:34:38 -06:00
2020-02-15 18:20:53 -06:00
error: casts cannot be followed by a function call
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:138:5
2020-02-15 18:20:53 -06:00
|
LL | drop as fn(u8)(0);
| ^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(drop as fn(u8))`
error: casts cannot be followed by a function call
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:140:5
2020-02-15 18:20:53 -06:00
|
LL | drop_ptr: fn(u8)(0);
| ^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(drop_ptr: fn(u8))`
error: casts cannot be followed by `.await`
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:145:5
2020-02-08 23:34:38 -06:00
|
LL | Box::pin(noop()) as Pin<Box<dyn Future<Output = ()>>>.await;
2020-02-15 18:20:53 -06:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(Box::pin(noop()) as Pin<Box<dyn Future<Output = ()>>>)`
error: casts cannot be followed by `.await`
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:148:5
2020-02-15 18:20:53 -06:00
|
LL | Box::pin(noop()): Pin<Box<_>>.await;
| ^^^^^^^^^^^^^^^^-^^^^^^^^^^^^
| |
| help: maybe write a path separator here: `::`
|
= note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
2020-02-16 00:08:29 -06:00
= note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information
2020-02-08 23:34:38 -06:00
2020-02-15 18:20:53 -06:00
error: casts cannot be followed by a field access
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:160:5
2020-02-08 23:34:38 -06:00
|
LL | Foo::default() as Foo.bar;
2020-02-15 18:20:53 -06:00
| ^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(Foo::default() as Foo)`
error: casts cannot be followed by a field access
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:162:5
2020-02-15 18:20:53 -06:00
|
LL | Foo::default(): Foo.bar;
| ^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(Foo::default(): Foo)`
error: casts cannot be followed by a method call
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:77:9
2020-02-15 18:20:53 -06:00
|
LL | if true { 33 } else { 44 } as i32.max(0),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(if true { 33 } else { 44 } as i32)`
error: casts cannot be followed by a method call
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:79:9
2020-02-15 18:20:53 -06:00
|
LL | if true { 33 } else { 44 }: i32.max(0)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try surrounding the expression in parentheses: `(if true { 33 } else { 44 }: i32)`
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:124:13
2020-02-15 18:20:53 -06:00
|
LL | drop as F();
| ^^^ only `Fn` traits may use parentheses
2020-02-08 23:34:38 -06:00
2020-02-15 18:20:53 -06:00
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
2020-02-22 13:36:09 -06:00
--> $DIR/issue-35813-postfix-after-cast.rs:126:15
2020-02-08 23:34:38 -06:00
|
2020-02-15 18:20:53 -06:00
LL | drop_ptr: F();
| ^^^ only `Fn` traits may use parentheses
2020-02-08 23:34:38 -06:00
2020-02-22 13:36:09 -06:00
error: aborting due to 35 previous errors
2020-02-08 23:34:38 -06:00
2020-02-15 18:20:53 -06:00
For more information about this error, try `rustc --explain E0214`.