2016-04-26 12:51:14 -05:00
|
|
|
// for this issue, this code must be built in a library
|
|
|
|
|
|
|
|
use std::mem;
|
|
|
|
|
|
|
|
trait A {
|
|
|
|
fn dummy(&self) { }
|
|
|
|
}
|
|
|
|
struct B;
|
|
|
|
impl A for B {}
|
|
|
|
|
|
|
|
fn bar<T>(_: &mut A, _: &T) {}
|
|
|
|
|
|
|
|
fn foo<T>(t: &T) {
|
|
|
|
let mut b = B;
|
|
|
|
bar(&mut b as &mut A, t)
|
2015-03-18 16:05:24 -05:00
|
|
|
}
|