Skip to content

Commit 1e105ea

Browse files
committed
Tweak wording to be more accurate
1 parent 28228bb commit 1e105ea

File tree

5 files changed

+9
-6
lines changed

5 files changed

+9
-6
lines changed

src/librustc_resolve/late.rs

+3
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@ impl<'a> PathSource<'a> {
236236
}
237237
msg
238238
}
239+
// This is a guess that `self` corresponds to the lhs.
240+
// This triggers on the lhs of `std::mem:size_of::<u32>();`.
241+
ExprKind::Type(..) => "value",
239242
_ => "function",
240243
},
241244
_ => "value",

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ use std::collections::BTreeMap;
33
fn main() {
44
println!("{}", std::mem:size_of::<BTreeMap<u32, u32>>());
55
//~^ ERROR casts cannot be followed by a function call
6-
//~| ERROR expected function, found module `std::mem` [E0423]
6+
//~| ERROR expected value, found module `std::mem` [E0423]
77
//~| ERROR cannot find type `size_of` in this scope [E0412]
88
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ LL | println!("{}", std::mem:size_of::<BTreeMap<u32, u32>>());
88
|
99
= note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
1010

11-
error[E0423]: expected function, found module `std::mem`
11+
error[E0423]: expected value, found module `std::mem`
1212
--> $DIR/issue-54516.rs:4:20
1313
|
1414
LL | println!("{}", std::mem:size_of::<BTreeMap<u32, u32>>());
1515
| ^^^^^^^^- help: maybe you meant to write a path separator here: `::`
1616
| |
17-
| not a function
17+
| not a value
1818

1919
error[E0412]: cannot find type `size_of` in this scope
2020
--> $DIR/issue-54516.rs:4:29
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
fn main() {
22
let u: usize = std::mem:size_of::<u32>();
33
//~^ ERROR casts cannot be followed by a function call
4-
//~| ERROR expected function, found module `std::mem` [E0423]
4+
//~| ERROR expected value, found module `std::mem` [E0423]
55
//~| ERROR cannot find type `size_of` in this scope [E0412]
66
}

src/test/ui/type/ascription/issue-60933.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ LL | let u: usize = std::mem:size_of::<u32>();
88
|
99
= note: `#![feature(type_ascription)]` lets you annotate an expression with a type: `<expr>: <type>`
1010

11-
error[E0423]: expected function, found module `std::mem`
11+
error[E0423]: expected value, found module `std::mem`
1212
--> $DIR/issue-60933.rs:2:20
1313
|
1414
LL | let u: usize = std::mem:size_of::<u32>();
1515
| ^^^^^^^^- help: maybe you meant to write a path separator here: `::`
1616
| |
17-
| not a function
17+
| not a value
1818

1919
error[E0412]: cannot find type `size_of` in this scope
2020
--> $DIR/issue-60933.rs:2:29

0 commit comments

Comments
 (0)