mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
17 lines
236 B
Rust
17 lines
236 B
Rust
// 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)
|
|
}
|