rust/tests/ui/drop/issue-2735.rs
Jake Goulding 8fc1bed0c8 Reduce confusion of some drop order tests
In addition to adhering to normal Rust casing idioms, I ran `rustfmt`.
2025-06-06 08:30:47 -04:00

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));
}