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