Skip to content

Commit 4bd1751

Browse files
committed
Don't use Default, since the impls are different on wasm
1 parent b2b3435 commit 4bd1751

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

src/test/ui/suggestions/issue-89333.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ fn main() {
66
test(&|| 0); //~ ERROR the trait bound
77
}
88

9-
fn test<T>(arg: &impl Fn() -> T) where for<'a> &'a T: Default {}
9+
trait Trait {}
10+
11+
fn test<T>(arg: &impl Fn() -> T) where for<'a> &'a T: Trait {}

src/test/ui/suggestions/issue-89333.stderr

+6-14
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
1-
error[E0277]: the trait bound `for<'a> &'a {integer}: Default` is not satisfied
2-
--> $DIR/issue-89333.rs:6:10
1+
error[E0277]: the trait bound `for<'a> &'a _: Trait` is not satisfied
2+
--> $DIR/issue-89333.rs:6:5
33
|
44
LL | test(&|| 0);
5-
| ---- ^^^^^ the trait `for<'a> Default` is not implemented for `&'a {integer}`
6-
| |
7-
| required by a bound introduced by this call
5+
| ^^^^ the trait `for<'a> Trait` is not implemented for `&'a _`
86
|
9-
= help: the following implementations were found:
10-
<&CStr as Default>
11-
<&OsStr as Default>
12-
<&[T] as Default>
13-
<&mut [T] as Default>
14-
and 217 others
157
note: required by a bound in `test`
16-
--> $DIR/issue-89333.rs:9:55
8+
--> $DIR/issue-89333.rs:11:55
179
|
18-
LL | fn test<T>(arg: &impl Fn() -> T) where for<'a> &'a T: Default {}
19-
| ^^^^^^^ required by this bound in `test`
10+
LL | fn test<T>(arg: &impl Fn() -> T) where for<'a> &'a T: Trait {}
11+
| ^^^^^ required by this bound in `test`
2012

2113
error: aborting due to previous error
2214

0 commit comments

Comments
 (0)