about summary refs log tree commit diff
diff options
context:
space:
mode:
authorjackh726 <jack.huey@umassmed.edu>2021-10-01 17:21:39 -0400
committerjackh726 <jack.huey@umassmed.edu>2021-10-01 17:21:39 -0400
commit4bd1751d4c6fa824002d11a5be892699cf436da9 (patch)
treef0623fc764598613afa39ff08c11bcc953829fd4
parentb2b34351de8a7b18888ff549c7d6dbe7698f734c (diff)
downloadrust-4bd1751d4c6fa824002d11a5be892699cf436da9.tar.gz
rust-4bd1751d4c6fa824002d11a5be892699cf436da9.zip
Don't use Default, since the impls are different on wasm
-rw-r--r--src/test/ui/suggestions/issue-89333.rs4
-rw-r--r--src/test/ui/suggestions/issue-89333.stderr20
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<T>(arg: &impl Fn() -> T) where for<'a> &'a T: Default {}
+trait Trait {}
+
+fn test<T>(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<T>(arg: &impl Fn() -> T) where for<'a> &'a T: Default {}
-   |                                                       ^^^^^^^ required by this bound in `test`
+LL | fn test<T>(arg: &impl Fn() -> T) where for<'a> &'a T: Trait {}
+   |                                                       ^^^^^ required by this bound in `test`
 
 error: aborting due to previous error