From 4bd1751d4c6fa824002d11a5be892699cf436da9 Mon Sep 17 00:00:00 2001 From: jackh726 Date: Fri, 1 Oct 2021 17:21:39 -0400 Subject: [PATCH] Don't use Default, since the impls are different on wasm --- src/test/ui/suggestions/issue-89333.rs | 4 +++- src/test/ui/suggestions/issue-89333.stderr | 20 ++++++-------------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/test/ui/suggestions/issue-89333.rs b/src/test/ui/suggestions/issue-89333.rs index a7bb524c421..03ed28ede21 100644 --- a/src/test/ui/suggestions/issue-89333.rs +++ b/src/test/ui/suggestions/issue-89333.rs @@ -6,4 +6,6 @@ fn main() { test(&|| 0); //~ ERROR the trait bound } -fn test(arg: &impl Fn() -> T) where for<'a> &'a T: Default {} +trait Trait {} + +fn test(arg: &impl Fn() -> T) where for<'a> &'a T: Trait {} diff --git a/src/test/ui/suggestions/issue-89333.stderr b/src/test/ui/suggestions/issue-89333.stderr index 6518114dcdc..f73f1147d5d 100644 --- a/src/test/ui/suggestions/issue-89333.stderr +++ b/src/test/ui/suggestions/issue-89333.stderr @@ -1,22 +1,14 @@ -error[E0277]: the trait bound `for<'a> &'a {integer}: Default` is not satisfied - --> $DIR/issue-89333.rs:6:10 +error[E0277]: the trait bound `for<'a> &'a _: Trait` is not satisfied + --> $DIR/issue-89333.rs:6:5 | LL | test(&|| 0); - | ---- ^^^^^ the trait `for<'a> Default` is not implemented for `&'a {integer}` - | | - | required by a bound introduced by this call + | ^^^^ the trait `for<'a> Trait` is not implemented for `&'a _` | - = help: the following implementations were found: - <&CStr as Default> - <&OsStr as Default> - <&[T] as Default> - <&mut [T] as Default> - and 217 others note: required by a bound in `test` - --> $DIR/issue-89333.rs:9:55 + --> $DIR/issue-89333.rs:11:55 | -LL | fn test(arg: &impl Fn() -> T) where for<'a> &'a T: Default {} - | ^^^^^^^ required by this bound in `test` +LL | fn test(arg: &impl Fn() -> T) where for<'a> &'a T: Trait {} + | ^^^^^ required by this bound in `test` error: aborting due to previous error