diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-04-27 15:10:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-27 15:10:55 +0200 |
| commit | 1ca3f33ef7b2e83271f42f1b922a21e20516d7cc (patch) | |
| tree | 1e3db7f5fc82925180c581f28ee57c8f485b1129 | |
| parent | 563eb04c5d5bb23db2f3624b408e43eed6bf2e24 (diff) | |
| parent | 0fabceb2df91853c41c1a882d630db22b8251b0b (diff) | |
| download | rust-1ca3f33ef7b2e83271f42f1b922a21e20516d7cc.tar.gz rust-1ca3f33ef7b2e83271f42f1b922a21e20516d7cc.zip | |
Rollup merge of #110866 - compiler-errors:test, r=jyn514
Make `method-not-found-generic-arg-elision.rs` error message not path dependent Every time I bless `tests/ui/methods/method-not-found-generic-arg-elision.rs`, I get some nonsense "type is too long" + "written to disk" that shows up and have to manually revert because the combination of my rustc repo path + the UI test directory hits the length limit for printing types spilling to disk (since this happens before UI test path sanitization). The fact that we use a closure in this test doesn't have to do with the UI test, so just box the closure to make the type name smaller and not path dependent.
| -rw-r--r-- | tests/ui/methods/method-not-found-generic-arg-elision.rs | 4 | ||||
| -rw-r--r-- | tests/ui/methods/method-not-found-generic-arg-elision.stderr | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/ui/methods/method-not-found-generic-arg-elision.rs b/tests/ui/methods/method-not-found-generic-arg-elision.rs index 799ced5e9c4..538eeadae08 100644 --- a/tests/ui/methods/method-not-found-generic-arg-elision.rs +++ b/tests/ui/methods/method-not-found-generic-arg-elision.rs @@ -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(); diff --git a/tests/ui/methods/method-not-found-generic-arg-elision.stderr b/tests/ui/methods/method-not-found-generic-arg-elision.stderr index f3db56d1d53..b97688d3868 100644 --- a/tests/ui/methods/method-not-found-generic-arg-elision.stderr +++ b/tests/ui/methods/method-not-found-generic-arg-elision.stderr @@ -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 |
