]> git.lizzy.rs Git - rust.git/blob - tests/ui/mismatched_types/issue-75361-mismatched-impl.rs
Rollup merge of #106717 - klensy:typo, r=lcnr
[rust.git] / tests / ui / mismatched_types / issue-75361-mismatched-impl.rs
1 // Regresison test for issue #75361
2 // Tests that we don't ICE on mismatched types with inference variables
3
4
5 trait MyTrait {
6     type Item;
7 }
8
9 pub trait Graph {
10   type EdgeType;
11
12   fn adjacent_edges(&self) -> Box<dyn MyTrait<Item = &Self::EdgeType>>;
13 }
14
15 impl<T> Graph for T {
16   type EdgeType = T;
17
18   fn adjacent_edges(&self) -> Box<dyn MyTrait<Item = &Self::EdgeType> + '_> { //~ ERROR `impl`
19       panic!()
20   }
21
22 }
23
24 fn main() {}