Skip to content

Commit 0fabceb

Browse files
Make method-not-found-generic-arg-elision.rs error message not path dependent
1 parent 8763965 commit 0fabceb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/ui/methods/method-not-found-generic-arg-elision.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ fn main() {
8383
//~^ ERROR no method named `distance` found for struct `Point<i32>
8484
let d = point_i32.other();
8585
//~^ ERROR no method named `other` found for struct `Point
86-
let v = vec![1_i32, 2, 3];
87-
v.iter().map(|x| x * x).extend(std::iter::once(100));
86+
let v = vec![1, 2, 3];
87+
v.iter().map(Box::new(|x| x * x) as Box<dyn Fn(&i32) -> i32>).extend(std::iter::once(100));
8888
//~^ ERROR no method named `extend` found for struct `Map
8989
let wrapper = Wrapper(true);
9090
wrapper.method();

tests/ui/methods/method-not-found-generic-arg-elision.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ LL | let d = point_i32.other();
2020
| ^^^^^ method not found in `Point<i32>`
2121

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

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

0 commit comments

Comments
 (0)