]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/map-types.rs
Add regression test for #82830
[rust.git] / src / test / ui / traits / map-types.rs
1 use std::collections::HashMap;
2
3
4
5 trait Map<K, V>
6 {
7     fn get(&self, k: K) -> V { panic!() }
8 }
9
10 impl<K, V> Map<K, V> for HashMap<K, V> {}
11
12 // Test that trait types printed in error msgs include the type arguments.
13
14 fn main() {
15     let x: Box<HashMap<isize, isize>> = HashMap::new().into();
16     let x: Box<dyn Map<isize, isize>> = x;
17     let y: Box<dyn Map<usize, isize>> = Box::new(x);
18     //~^ ERROR `Box<dyn Map<isize, isize>>: Map<usize, isize>` is not satisfied
19 }