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
|
|
|
#![allow(non_camel_case_types)]
|
|
|
|
|
2015-03-22 13:13:15 -07:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2015-02-12 10:29:52 -05:00
|
|
|
trait hax {
|
|
|
|
fn dummy(&self) { }
|
|
|
|
}
|
2013-02-26 21:42:00 -05:00
|
|
|
impl<A> hax for A { }
|
2012-07-10 20:53:49 -07:00
|
|
|
|
2019-05-28 14:47:21 -04:00
|
|
|
fn perform_hax<T: 'static>(x: Box<T>) -> Box<dyn hax+'static> {
|
2022-07-07 04:36:10 +02:00
|
|
|
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
|
|
|
}
|