]> git.lizzy.rs Git - rust.git/blob - tests/ui/resolve/point-at-type-parameter-shadowing-another-type.rs
Rollup merge of #106692 - eggyal:mv-binary_heap.rs-binary_heap/mod.rs, r=Mark-Simulacrum
[rust.git] / tests / ui / resolve / point-at-type-parameter-shadowing-another-type.rs
1 trait Foo<T> {
2     fn foo(&self, name: T) -> usize;
3 }
4
5 struct Bar {
6     baz: Baz,
7 }
8
9 struct Baz {
10     num: usize,
11 }
12
13 impl<Baz> Foo<Baz> for Bar {
14     fn foo(&self, _name: Baz) -> usize {
15         match self.baz {
16             Baz { num } => num, //~ ERROR expected struct, variant or union type, found type parameter `Baz`
17         }
18     }
19 }
20
21 fn main() {}