Closed
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