summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/issue-6128.rs
blob: 07d92f8f8a0164e9674c9e1bd334ff19949c8428 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// run-pass

use std::collections::HashMap;

trait Graph<Node, Edge> {
    fn f(&self, _: Edge);
    fn g(&self, _: Node);
}

impl<E> Graph<isize, E> for HashMap<isize, isize> {
    fn f(&self, _e: E) {
        panic!();
    }
    fn g(&self, _e: isize) {
        panic!();
    }
}

pub fn main() {
    let g : Box<HashMap<isize,isize>> = Box::new(HashMap::new());
    let _g2 : Box<dyn Graph<isize,isize>> = g as Box<dyn Graph<isize,isize>>;
}