-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
fn lifetime<'a>()
where &'a (): 'a
{
/* do nothing */
}
fn doesnt_work()
where for<'a> &'a (): 'a
{
/* do nothing */
}
fn main() {
lifetime();
doesnt_work();
}
Was trying to demonstrate lifetimes of references fulfilling the 'a
lifetime bound - but then came across this. The bound can be proven easily for a specific 'a
- but for some reason not for the higher-ranked version. The error for doesnt_work
looks like this:
rustc 1.19.0-nightly (5dfcd85fd 2017-05-19)
error[E0280]: the requirement `for<'a> &'a () : 'a` is not satisfied
--> <anon>:15:5
|
15 | doesnt_work();
| ^^^^^^^^^^^
|
= note: required by `doesnt_work`
error: aborting due to previous error
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.