Files
rust/tests/ui/drop/issue-2735.rs

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

20 lines
324 B
Rust
Raw Normal View History

//@ run-pass
#![allow(dead_code)]
trait Hax {
fn dummy(&self) {}
}
impl<A> Hax for A {}
fn perform_hax<T: 'static>(x: Box<T>) -> Box<dyn Hax + 'static> {
Box::new(x) as Box<dyn Hax + 'static>
}
fn deadcode() {
perform_hax(Box::new("deadcode".to_string()));
}
pub fn main() {
perform_hax(Box::new(42));
}