2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2018-09-25 16:51:35 -05:00
|
|
|
#![allow(dead_code)]
|
2018-08-31 08:02:01 -05:00
|
|
|
#![allow(non_camel_case_types)]
|
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2015-02-12 09:29:52 -06:00
|
|
|
trait hax {
|
|
|
|
fn dummy(&self) { }
|
|
|
|
}
|
2013-02-26 20:42:00 -06:00
|
|
|
impl<A> hax for A { }
|
2012-07-10 22:53:49 -05:00
|
|
|
|
2019-05-28 13:47:21 -05:00
|
|
|
fn perform_hax<T: 'static>(x: Box<T>) -> Box<dyn hax+'static> {
|
2022-07-06 21:36:10 -05:00
|
|
|
Box::new(x) as Box<dyn hax+'static>
|
2012-07-10 22:53:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn deadcode() {
|
2022-07-06 21:36:10 -05:00
|
|
|
perform_hax(Box::new("deadcode".to_string()));
|
2012-07-10 22:53:49 -05:00
|
|
|
}
|
|
|
|
|
2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() {
|
2022-07-06 21:36:10 -05:00
|
|
|
perform_hax(Box::new(42));
|
2012-07-10 22:53:49 -05:00
|
|
|
}
|