]>
git.proxmox.com Git - rustc.git/blob - src/test/run-pass/issues/issue-5708.rs
2 #![allow(unused_variables)]
4 # ICE when returning struct with reference to trait
6 A function which takes a reference to a trait and returns a
7 struct with that reference results in an ICE.
9 This does not occur with concrete types, only with references
19 impl Inner
for isize {
20 fn print(&self) { print!("Inner: {}
\n", *self); }
28 fn new(inner: &Inner) -> Outer {
37 let outer = Outer::new(&inner as &Inner);
43 pub trait MyTrait<T> {
44 fn dummy(&self, t: T) -> T { panic!() }
47 pub struct MyContainer<'a, T:'a> {
48 foos: Vec<&'a (MyTrait<T>+'a)> ,
51 impl<'a, T> MyContainer<'a, T> {
52 pub fn add (&mut self, foo: &'a MyTrait<T>) {