]> git.lizzy.rs Git - rust.git/blob - tests/ui/where-clauses/where-for-self.rs
Don't resolve type var roots in point_at_expr_source_of_inferred_type
[rust.git] / tests / ui / where-clauses / where-for-self.rs
1 // Test that we can quantify lifetimes outside a constraint (i.e., including
2 // the self type) in a where clause. Specifically, test that we cannot nest
3 // quantification in constraints (to be clear, there is no reason this should not
4 // we're testing we don't crash or do something stupid).
5
6 trait Bar<'a> {
7     fn bar(&self);
8 }
9
10 impl<'a, 'b> Bar<'b> for &'a u32 {
11     fn bar(&self) {}
12 }
13
14 fn foo<T>(x: &T)
15     where for<'a> &'a T: for<'b> Bar<'b>
16     //~^ error: nested quantification of lifetimes
17 {}
18
19 fn main() {}