mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-01 00:36:54 +00:00
20 lines
324 B
Rust
20 lines
324 B
Rust
//@ 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));
|
|
}
|