Skip to content

Commit

Permalink
Fix related type ascription tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
daboross committed Feb 16, 2020
1 parent f82ca8b commit 5dd6464
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/test/ui/type/ascription/issue-54516.rs
Expand Up @@ -2,5 +2,7 @@ use std::collections::BTreeMap;

fn main() {
println!("{}", std::mem:size_of::<BTreeMap<u32, u32>>());
//~^ ERROR expected one of
//~^ ERROR casts cannot be followed by a function call
//~| ERROR expected value, found module `std::mem` [E0423]
//~| ERROR cannot find type `size_of` in this scope [E0412]
}
26 changes: 22 additions & 4 deletions src/test/ui/type/ascription/issue-54516.stderr
@@ -1,13 +1,31 @@
error: expected one of `!`, `,`, or `::`, found `(`
--> $DIR/issue-54516.rs:4:58
error: casts cannot be followed by a function call
--> $DIR/issue-54516.rs:4:20
|
LL | println!("{}", std::mem:size_of::<BTreeMap<u32, u32>>());
| - ^ expected one of `!`, `,`, or `::`
| ^^^^^^^^-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: maybe write a path separator here: `::`
|
= note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
= note: see issue #23416 <https://github.com/rust-lang/rust/issues/23416> for more information

error: aborting due to previous error
error[E0423]: expected value, found module `std::mem`
--> $DIR/issue-54516.rs:4:20
|
LL | println!("{}", std::mem:size_of::<BTreeMap<u32, u32>>());
| ^^^^^^^^- help: maybe you meant to write a path separator here: `::`
| |
| not a value

error[E0412]: cannot find type `size_of` in this scope
--> $DIR/issue-54516.rs:4:29
|
LL | println!("{}", std::mem:size_of::<BTreeMap<u32, u32>>());
| -^^^^^^^ not found in this scope
| |
| help: maybe you meant to write a path separator here: `::`

error: aborting due to 3 previous errors

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

error: aborting due to previous error
error[E0423]: expected value, found module `std::mem`
--> $DIR/issue-60933.rs:2:20
|
LL | let u: usize = std::mem:size_of::<u32>();
| ^^^^^^^^- help: maybe you meant to write a path separator here: `::`
| |
| not a value

error[E0412]: cannot find type `size_of` in this scope
--> $DIR/issue-60933.rs:2:29
|
LL | let u: usize = std::mem:size_of::<u32>();
| -^^^^^^^ not found in this scope
| |
| help: maybe you meant to write a path separator here: `::`

error: aborting due to 3 previous errors

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

0 comments on commit 5dd6464

Please sign in to comment.