]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/issue-96223.rs
Rollup merge of #106605 - notriddle:notriddle/outdated-rustbook, r=GuillaumeGomez
[rust.git] / tests / ui / suggestions / issue-96223.rs
1 // Previously ICEd because we didn't properly track binders in suggestions
2 // check-fail
3
4 pub trait Foo<'de>: Sized {}
5
6 pub trait Bar<'a>: 'static {
7     type Inner: 'a;
8 }
9
10 pub trait Fubar {
11     type Bar: for<'a> Bar<'a>;
12 }
13
14 pub struct Baz<T>(pub T);
15
16 impl<'de, T> Foo<'de> for Baz<T> where T: Foo<'de> {}
17
18 struct Empty;
19
20 impl<M> Dummy<M> for Empty
21 where
22     M: Fubar,
23     for<'de> Baz<<M::Bar as Bar<'de>>::Inner>: Foo<'de>,
24 {
25 }
26
27 pub trait Dummy<M>
28 where
29     M: Fubar,
30 {
31 }
32
33 pub struct EmptyBis<'a>(&'a [u8]);
34
35 impl<'a> Bar<'a> for EmptyBis<'static> {
36     type Inner = EmptyBis<'a>;
37 }
38
39 pub struct EmptyMarker;
40
41 impl Fubar for EmptyMarker {
42     type Bar = EmptyBis<'static>;
43 }
44
45 fn icey_bounds<D: Dummy<EmptyMarker>>(p: &D) {}
46
47 fn trigger_ice() {
48     let p = Empty;
49     icey_bounds(&p); //~ERROR the trait bound
50 }
51
52 fn main() {}