mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
23 lines
335 B
Rust
23 lines
335 B
Rust
// run-pass
|
|
#![allow(unused_imports)]
|
|
|
|
#![allow(dead_code)]
|
|
|
|
// this code used to cause an ICE
|
|
|
|
use std::marker;
|
|
|
|
trait X<T> {
|
|
fn dummy(&self) -> T { panic!() }
|
|
}
|
|
|
|
struct S<T> {f: Box<dyn X<T>+'static>,
|
|
g: Box<dyn X<T>+'static>}
|
|
|
|
struct F;
|
|
impl X<isize> for F {
|
|
}
|
|
|
|
fn main() {
|
|
S {f: Box::new(F), g: Box::new(F) };
|
|
}
|