rust/tests/source/dyn_trait.rs

21 lines
542 B
Rust
Raw Normal View History

2018-03-05 08:35:58 +00:00
#![feature(dyn_trait)]
2018-03-05 08:35:58 +00:00
fn main() {
// #2506
2018-03-05 08:35:58 +00:00
// checks rustfmt doesn't remove dyn
trait MyTrait {
fn method(&self) -> u64;
}
fn f1(a: Box<dyn MyTrait>) {}
// checks if line wrap works correctly
trait Very_______________________Long__________________Name_______________________________Trait {
2018-03-05 08:35:58 +00:00
fn method(&self) -> u64;
}
fn f2(a: Box<dyn Very_______________________Long__________________Name____________________Trait+ 'static,>) {}
// #2582
let _: &dyn (::std::any::Any) = &msg;
2018-03-05 08:35:58 +00:00
}