File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1+ // check-fail
2+ // known-bug
3+
14// Regression test for #47511: anonymous lifetimes can appear
25// unconstrained in a return type, but only if they appear just once
36// in the input, as the input to a projection.
47
58fn f ( _: X ) -> X {
6- //~^ ERROR return type references an anonymous lifetime
79 unimplemented ! ( )
810}
911
1012fn g < ' a > ( _: X < ' a > ) -> X < ' a > {
11- //~^ ERROR return type references lifetime `'a`, which is not constrained
1213 unimplemented ! ( )
1314}
1415
Original file line number Diff line number Diff line change 11error[E0581]: return type references an anonymous lifetime, which is not constrained by the fn input types
2- --> $DIR/issue-47511.rs:5 :15
2+ --> $DIR/issue-47511.rs:8 :15
33 |
44LL | fn f(_: X) -> X {
55 | ^
66 |
77 = note: lifetimes appearing in an associated type are not considered constrained
88
99error[E0581]: return type references lifetime `'a`, which is not constrained by the fn input types
10- --> $DIR/issue-47511.rs:10 :23
10+ --> $DIR/issue-47511.rs:12 :23
1111 |
1212LL | fn g<'a>(_: X<'a>) -> X<'a> {
1313 | ^^^^^
You can’t perform that action at this time.
0 commit comments