2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2018-09-25 21:51:35 +00:00
|
|
|
#![allow(unused_imports)]
|
2015-03-22 20:13:15 +00:00
|
|
|
|
2014-06-27 09:30:51 +00:00
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
// this code used to cause an ICE
|
|
|
|
|
2015-02-12 15:29:52 +00:00
|
|
|
use std::marker;
|
|
|
|
|
|
|
|
trait X<T> {
|
|
|
|
fn dummy(&self) -> T { panic!() }
|
|
|
|
}
|
2014-06-27 09:30:51 +00:00
|
|
|
|
2019-05-28 18:47:21 +00:00
|
|
|
struct S<T> {f: Box<dyn X<T>+'static>,
|
|
|
|
g: Box<dyn X<T>+'static>}
|
2014-06-27 09:30:51 +00:00
|
|
|
|
|
|
|
struct F;
|
2015-03-26 00:06:52 +00:00
|
|
|
impl X<isize> for F {
|
2015-02-12 15:29:52 +00:00
|
|
|
}
|
2014-06-27 09:30:51 +00:00
|
|
|
|
|
|
|
fn main() {
|
2015-02-15 08:52:21 +00:00
|
|
|
S {f: Box::new(F), g: Box::new(F) };
|
2014-06-27 09:30:51 +00:00
|
|
|
}
|