2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2015-03-22 20:13:15 +00:00
|
|
|
|
2014-05-30 02:03:06 +00:00
|
|
|
use std::collections::HashMap;
|
2013-07-15 18:12:56 +00:00
|
|
|
|
|
|
|
trait Graph<Node, Edge> {
|
2017-06-25 02:29:10 +00:00
|
|
|
fn f(&self, _: Edge);
|
|
|
|
fn g(&self, _: Node);
|
2013-07-15 18:12:56 +00:00
|
|
|
}
|
|
|
|
|
2015-03-26 00:06:52 +00:00
|
|
|
impl<E> Graph<isize, E> for HashMap<isize, isize> {
|
2013-07-15 18:12:56 +00:00
|
|
|
fn f(&self, _e: E) {
|
2014-10-09 19:17:22 +00:00
|
|
|
panic!();
|
2013-07-15 18:12:56 +00:00
|
|
|
}
|
2015-03-26 00:06:52 +00:00
|
|
|
fn g(&self, _e: isize) {
|
2015-02-12 15:29:52 +00:00
|
|
|
panic!();
|
|
|
|
}
|
2013-07-15 18:12:56 +00:00
|
|
|
}
|
|
|
|
|
2013-09-25 07:43:37 +00:00
|
|
|
pub fn main() {
|
2021-08-25 00:39:40 +00:00
|
|
|
let g : Box<HashMap<isize,isize>> = Box::new(HashMap::new());
|
2019-05-28 18:47:21 +00:00
|
|
|
let _g2 : Box<dyn Graph<isize,isize>> = g as Box<dyn Graph<isize,isize>>;
|
2013-07-15 18:12:56 +00:00
|
|
|
}
|