1
Fork 0
rust/src/test/ui/issues/issue-2734.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

25 lines
401 B
Rust
Raw Normal View History

// run-pass
#![allow(dead_code)]
#![allow(non_camel_case_types)]
// pretty-expanded FIXME #23616
#![feature(box_syntax)]
trait hax {
fn dummy(&self) { }
}
impl<A> hax for A { }
2019-05-28 14:47:21 -04:00
fn perform_hax<T: 'static>(x: Box<T>) -> Box<dyn hax+'static> {
box x as Box<dyn hax+'static>
}
fn deadcode() {
2014-05-25 03:10:11 -07:00
perform_hax(box "deadcode".to_string());
}
pub fn main() {
2015-01-25 22:05:03 +01:00
let _ = perform_hax(box 42);
}