]> git.proxmox.com Git - rustc.git/blame - src/test/ui/map-types.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / src / test / ui / map-types.rs
CommitLineData
1a4d82fc
JJ
1#![feature(box_syntax)]
2
1a4d82fc
JJ
3use std::collections::HashMap;
4
85aaf69f
SL
5trait Map<K, V>
6{
7 fn get(&self, k: K) -> V { panic!() }
8}
1a4d82fc
JJ
9
10impl<K, V> Map<K, V> for HashMap<K, V> {}
223e47cc
LB
11
12// Test that trait types printed in error msgs include the type arguments.
13
14fn main() {
1a4d82fc 15 let x: Box<HashMap<isize, isize>> = box HashMap::new();
dc9dc135
XL
16 let x: Box<dyn Map<isize, isize>> = x;
17 let y: Box<dyn Map<usize, isize>> = Box::new(x);
1b1a35ee 18 //~^ ERROR `Box<dyn Map<isize, isize>>: Map<usize, isize>` is not satisfied
223e47cc 19}