mirror of
https://github.com/rust-lang/rust
synced 2024-09-06 01:11:17 +00:00
20 lines
469 B
Rust
20 lines
469 B
Rust
use std::collections::HashMap;
|
|
|
|
|
|
|
|
trait Map<K, V>
|
|
{
|
|
fn get(&self, k: K) -> V { panic!() }
|
|
}
|
|
|
|
impl<K, V> Map<K, V> for HashMap<K, V> {}
|
|
|
|
// Test that trait types printed in error msgs include the type arguments.
|
|
|
|
fn main() {
|
|
let x: Box<HashMap<isize, isize>> = HashMap::new().into();
|
|
let x: Box<dyn Map<isize, isize>> = x;
|
|
let y: Box<dyn Map<usize, isize>> = Box::new(x);
|
|
//~^ ERROR `Box<dyn Map<isize, isize>>: Map<usize, isize>` is not satisfied
|
|
}
|