-
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.P-mediumMedium priorityMedium priorityT-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
The syntax where for<'b: 'a> ...
is permitted without warning, however the : 'a
bound is not used to prove the identity; I would expect the following to compile:
trait Trait {}
impl Trait for &'static () {}
fn f<'a>(_: &'a ()) where for<'b: 'a> &'b () : Trait {}
fn main() {
static X: &'static () = &();
f::<'static>(X)
}
but it fails with
rustc 1.17.0 (56124baa9 2017-04-24)
error[E0277]: the trait bound `for<'b> &'b (): Trait` is not satisfied
--> <anon>:9:5
|
9 | f::<'static>(X)
| ^^^^^^^^^^^^ the trait `for<'b> Trait` is not implemented for `&'b ()`
|
= help: the following implementations were found:
<&'static () as Trait>
= note: required by `f`
error: aborting due to previous error
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.P-mediumMedium priorityMedium priorityT-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.