Skip to content

Commit 5dd6464

Browse files
committed
Fix related type ascription tests.
1 parent f82ca8b commit 5dd6464

File tree

4 files changed

+50
-10
lines changed

4 files changed

+50
-10
lines changed

src/test/ui/type/ascription/issue-54516.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@ use std::collections::BTreeMap;
22

33
fn main() {
44
println!("{}", std::mem:size_of::<BTreeMap<u32, u32>>());
5-
//~^ ERROR expected one of
5+
//~^ ERROR casts cannot be followed by a function call
6+
//~| ERROR expected value, found module `std::mem` [E0423]
7+
//~| ERROR cannot find type `size_of` in this scope [E0412]
68
}
Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
1-
error: expected one of `!`, `,`, or `::`, found `(`
2-
--> $DIR/issue-54516.rs:4:58
1+
error: casts cannot be followed by a function call
2+
--> $DIR/issue-54516.rs:4:20
33
|
44
LL | println!("{}", std::mem:size_of::<BTreeMap<u32, u32>>());
5-
| - ^ expected one of `!`, `,`, or `::`
5+
| ^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
| |
77
| help: maybe write a path separator here: `::`
88
|
99
= note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
1010
= note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information
1111

12-
error: aborting due to previous error
12+
error[E0423]: expected value, found module `std::mem`
13+
--> $DIR/issue-54516.rs:4:20
14+
|
15+
LL | println!("{}", std::mem:size_of::<BTreeMap<u32, u32>>());
16+
| ^^^^^^^^- help: maybe you meant to write a path separator here: `::`
17+
| |
18+
| not a value
19+
20+
error[E0412]: cannot find type `size_of` in this scope
21+
--> $DIR/issue-54516.rs:4:29
22+
|
23+
LL | println!("{}", std::mem:size_of::<BTreeMap<u32, u32>>());
24+
| -^^^^^^^ not found in this scope
25+
| |
26+
| help: maybe you meant to write a path separator here: `::`
27+
28+
error: aborting due to 3 previous errors
1329

30+
Some errors have detailed explanations: E0412, E0423.
31+
For more information about an error, try `rustc --explain E0412`.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
fn main() {
22
let u: usize = std::mem:size_of::<u32>();
3-
//~^ ERROR expected one of
3+
//~^ ERROR casts cannot be followed by a function call
4+
//~| ERROR expected value, found module `std::mem` [E0423]
5+
//~| ERROR cannot find type `size_of` in this scope [E0412]
46
}
Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
1-
error: expected one of `!`, `::`, or `;`, found `(`
2-
--> $DIR/issue-60933.rs:2:43
1+
error: casts cannot be followed by a function call
2+
--> $DIR/issue-60933.rs:2:20
33
|
44
LL | let u: usize = std::mem:size_of::<u32>();
5-
| - ^ expected one of `!`, `::`, or `;`
5+
| ^^^^^^^^-^^^^^^^^^^^^^^
66
| |
77
| help: maybe write a path separator here: `::`
88
|
99
= note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
1010
= note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information
1111

12-
error: aborting due to previous error
12+
error[E0423]: expected value, found module `std::mem`
13+
--> $DIR/issue-60933.rs:2:20
14+
|
15+
LL | let u: usize = std::mem:size_of::<u32>();
16+
| ^^^^^^^^- help: maybe you meant to write a path separator here: `::`
17+
| |
18+
| not a value
19+
20+
error[E0412]: cannot find type `size_of` in this scope
21+
--> $DIR/issue-60933.rs:2:29
22+
|
23+
LL | let u: usize = std::mem:size_of::<u32>();
24+
| -^^^^^^^ not found in this scope
25+
| |
26+
| help: maybe you meant to write a path separator here: `::`
27+
28+
error: aborting due to 3 previous errors
1329

30+
Some errors have detailed explanations: E0412, E0423.
31+
For more information about an error, try `rustc --explain E0412`.

0 commit comments

Comments
 (0)