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