]> git.proxmox.com Git - rustc.git/blame - src/test/ui/implied-bounds/impl-header-unnormalized-types.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / implied-bounds / impl-header-unnormalized-types.rs
CommitLineData
f2b60f7d
FG
1struct Foo<T>(T);
2
3trait GoodBye {
4 type Forget;
5}
6impl<T> GoodBye for T {
7 type Forget = ();
8}
9
10trait NeedsWf<'a, 'b> {
11 type Assoc;
12}
13
14impl<'a, 'b> NeedsWf<'a, 'b> for Foo<<&'a &'b () as GoodBye>::Forget> {
15 type Assoc = &'a &'b ();
16 //~^ ERROR in type `&'a &'b ()`, reference has a longer lifetime than the data it references
17}
18
19fn needs_wf<'a, 'b, T: NeedsWf<'a, 'b>>() {}
20
21fn foo<'a: 'a, 'b: 'b>(_: &'b String) {
22 needs_wf::<'a, 'b, Foo<()>>();
23}
24
25fn main() {
26 let x = String::from("hello");
27 foo::<'static, '_>(&x);
28}