Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make method-not-found-generic-arg-elision.rs error message not path dependent #110866

Merged
merged 1 commit into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/ui/methods/method-not-found-generic-arg-elision.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ fn main() {
//~^ ERROR no method named `distance` found for struct `Point<i32>
let d = point_i32.other();
//~^ ERROR no method named `other` found for struct `Point
let v = vec![1_i32, 2, 3];
v.iter().map(|x| x * x).extend(std::iter::once(100));
let v = vec![1, 2, 3];
v.iter().map(Box::new(|x| x * x) as Box<dyn Fn(&i32) -> i32>).extend(std::iter::once(100));
//~^ ERROR no method named `extend` found for struct `Map
let wrapper = Wrapper(true);
wrapper.method();
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/methods/method-not-found-generic-arg-elision.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ LL | let d = point_i32.other();
| ^^^^^ method not found in `Point<i32>`

error[E0599]: no method named `extend` found for struct `Map` in the current scope
--> $DIR/method-not-found-generic-arg-elision.rs:87:29
--> $DIR/method-not-found-generic-arg-elision.rs:87:67
|
LL | v.iter().map(|x| x * x).extend(std::iter::once(100));
| ^^^^^^ method not found in `Map<Iter<'_, i32>, [closure@method-not-found-generic-arg-elision.rs:87:18]>`
LL | v.iter().map(Box::new(|x| x * x) as Box<dyn Fn(&i32) -> i32>).extend(std::iter::once(100));
| ^^^^^^ method not found in `Map<Iter<'_, i32>, Box<dyn Fn(&i32) -> i32>>`

error[E0599]: no method named `method` found for struct `Wrapper<bool>` in the current scope
--> $DIR/method-not-found-generic-arg-elision.rs:90:13
Expand Down