1
Fork 0

Rollup merge of #94626 - marmeladema:issue-47511-known-bug, r=jackh726

Add known-bug directive to issue #47511 test case
This commit is contained in:
Dylan DPC 2022-03-05 04:46:40 +01:00 committed by GitHub
commit 38e3b32dfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -1,14 +1,15 @@
// check-fail
// known-bug
// Regression test for #47511: anonymous lifetimes can appear // Regression test for #47511: anonymous lifetimes can appear
// unconstrained in a return type, but only if they appear just once // unconstrained in a return type, but only if they appear just once
// in the input, as the input to a projection. // in the input, as the input to a projection.
fn f(_: X) -> X { fn f(_: X) -> X {
//~^ ERROR return type references an anonymous lifetime
unimplemented!() unimplemented!()
} }
fn g<'a>(_: X<'a>) -> X<'a> { fn g<'a>(_: X<'a>) -> X<'a> {
//~^ ERROR return type references lifetime `'a`, which is not constrained
unimplemented!() unimplemented!()
} }

View file

@ -1,5 +1,5 @@
error[E0581]: return type references an anonymous lifetime, which is not constrained by the fn input types error[E0581]: return type references an anonymous lifetime, which is not constrained by the fn input types
--> $DIR/issue-47511.rs:5:15 --> $DIR/issue-47511.rs:8:15
| |
LL | fn f(_: X) -> X { LL | fn f(_: X) -> X {
| ^ | ^
@ -7,7 +7,7 @@ LL | fn f(_: X) -> X {
= note: lifetimes appearing in an associated type are not considered constrained = note: lifetimes appearing in an associated type are not considered constrained
error[E0581]: return type references lifetime `'a`, which is not constrained by the fn input types error[E0581]: return type references lifetime `'a`, which is not constrained by the fn input types
--> $DIR/issue-47511.rs:10:23 --> $DIR/issue-47511.rs:12:23
| |
LL | fn g<'a>(_: X<'a>) -> X<'a> { LL | fn g<'a>(_: X<'a>) -> X<'a> {
| ^^^^^ | ^^^^^