-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsF-non_lifetime_binders`#![feature(non_lifetime_binders)]``#![feature(non_lifetime_binders)]`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
minimal repro:
#![allow(incomplete_features)]
#![feature(non_lifetime_binders)]
trait MyTrait1 {}
trait MyTrait2
where for <T: MyTrait1> ():
{
}
output:
error: lifetime bounds cannot be used in this context
--> src/lib.rs:7:19
|
7 | where for <T: MyTrait1> ():
| ^^^^^^^^
use case:
[playground]
weird example, i know. its difficult to construct a proper example that isn't overly complex
workaround:
add the bound to all call sites that require it (e.g. add
where Human: Consume<Food>
tofoo()
in the above example)
rustc:
1.76.0-nightly (2023-12-17 6a62871)
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsF-non_lifetime_binders`#![feature(non_lifetime_binders)]``#![feature(non_lifetime_binders)]`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.