rust/tests/ui/higher-ranked/trait-bounds/due-to-where-clause.rs

14 lines
264 B
Rust
Raw Normal View History

2019-09-01 23:51:16 -05:00
fn main() {
test::<FooS>(&mut 42); //~ ERROR implementation of `Foo` is not general enough
}
trait Foo<'a> {}
struct FooS<'a> {
data: &'a mut u32,
}
impl<'a, 'b: 'a> Foo<'b> for FooS<'a> {}
fn test<'a, F>(data: &'a mut u32) where F: for<'b> Foo<'b> {}