This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-15
lines changed Expand file tree Collapse file tree 2 files changed +9
-15
lines changed Original file line number Diff line number Diff 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 { }
Original file line number Diff line number Diff line change 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 |
44LL | 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
157note: 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
2113error: aborting due to previous error
2214
You can’t perform that action at this time.
0 commit comments