mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 18:23:49 +00:00
21 lines
332 B
Rust
21 lines
332 B
Rust
//@ check-pass
|
|
#![allow(dead_code)]
|
|
//@ pretty-expanded FIXME #23616
|
|
|
|
/*
|
|
|
|
#7673 Polymorphically creating traits barely works
|
|
|
|
*/
|
|
|
|
pub fn main() {}
|
|
|
|
trait A {
|
|
fn dummy(&self) { }
|
|
}
|
|
|
|
impl<T: 'static> A for T {}
|
|
|
|
fn owned2<T: 'static>(a: Box<T>) { a as Box<dyn A>; }
|
|
fn owned3<T: 'static>(a: Box<T>) { Box::new(a) as Box<dyn A>; }
|