Skip to content

Commit 1c80aad

Browse files
test
1 parent 18fdf59 commit 1c80aad

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

tests/ui/ufcs/bad-builder.rs

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fn hello<Q>() -> Vec<Q> {
2+
Vec::<Q>::mew()
3+
//~^ ERROR no function or associated item named `mew` found for struct `Vec<Q>` in the current scope
4+
}
5+
6+
fn main() {}

tests/ui/ufcs/bad-builder.stderr

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
error[E0599]: no function or associated item named `mew` found for struct `Vec<Q>` in the current scope
2+
--> $DIR/bad-builder.rs:2:15
3+
|
4+
LL | Vec::<Q>::mew()
5+
| ^^^
6+
| |
7+
| function or associated item not found in `Vec<Q>`
8+
| help: there is an associated function with a similar name: `new`
9+
|
10+
note: if you're trying to build a new `Vec<Q>` consider using one of the following associated functions:
11+
Vec::<T>::new
12+
Vec::<T>::with_capacity
13+
Vec::<T>::from_raw_parts
14+
Vec::<T, A>::new_in
15+
and 2 others
16+
--> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
17+
18+
error: aborting due to 1 previous error
19+
20+
For more information about this error, try `rustc --explain E0599`.

0 commit comments

Comments
 (0)