Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add known-bug directive to issue #47511 test case #94626

Merged
merged 1 commit into from
Mar 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/test/ui/issues/issue-47511.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
// check-fail
// known-bug

// Regression test for #47511: anonymous lifetimes can appear
// unconstrained in a return type, but only if they appear just once
// in the input, as the input to a projection.

fn f(_: X) -> X {
//~^ ERROR return type references an anonymous lifetime
unimplemented!()
}

fn g<'a>(_: X<'a>) -> X<'a> {
//~^ ERROR return type references lifetime `'a`, which is not constrained
unimplemented!()
}

Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/issues/issue-47511.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
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 {
| ^
|
= 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
--> $DIR/issue-47511.rs:10:23
--> $DIR/issue-47511.rs:12:23
|
LL | fn g<'a>(_: X<'a>) -> X<'a> {
| ^^^^^
Expand Down