]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-21520.rs
Add 'src/tools/clippy/' from commit 'd2708873ef711ec8ab45df1e984ecf24a96cd369'
[rust.git] / src / test / ui / issues / issue-21520.rs
1 // check-pass
2 #![allow(dead_code)]
3 // Test that the requirement (in `Bar`) that `T::Bar : 'static` does
4 // not wind up propagating to `T`.
5
6 // pretty-expanded FIXME #23616
7
8 pub trait Foo {
9     type Bar;
10
11     fn foo(&self) -> Self;
12 }
13
14 pub struct Static<T:'static>(T);
15
16 struct Bar<T:Foo>
17     where T::Bar : 'static
18 {
19     x: Static<Option<T::Bar>>
20 }
21
22 fn main() { }