2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(dead_code)]
|
2018-08-31 15:02:01 +02:00
|
|
|
|
2025-05-29 09:38:44 -04:00
|
|
|
trait Hax {
|
|
|
|
|
fn dummy(&self) {}
|
2015-02-12 10:29:52 -05:00
|
|
|
}
|
2025-05-29 09:38:44 -04:00
|
|
|
impl<A> Hax for A {}
|
2012-07-10 20:53:49 -07:00
|
|
|
|
2025-05-29 09:38:44 -04:00
|
|
|
fn perform_hax<T: 'static>(x: Box<T>) -> Box<dyn Hax + 'static> {
|
|
|
|
|
Box::new(x) as Box<dyn Hax + 'static>
|
2012-07-10 20:53:49 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn deadcode() {
|
2022-07-07 04:36:10 +02:00
|
|
|
perform_hax(Box::new("deadcode".to_string()));
|
2012-07-10 20:53:49 -07:00
|
|
|
}
|
|
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2022-07-07 04:36:10 +02:00
|
|
|
perform_hax(Box::new(42));
|
2012-07-10 20:53:49 -07:00
|
|
|
}
|