1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
12 # ICE when returning struct with reference to trait
14 A function which takes a reference to a trait and returns a
15 struct with that reference results in an ICE.
17 This does not occur with concrete types, only with references
28 fn print(&self) { print!("Inner: {}\n", *self); }
36 fn new(inner: &Inner) -> Outer {
45 let outer = Outer::new(&inner as &Inner);
51 pub trait MyTrait<T> { }
53 pub struct MyContainer<'a, T> {
54 foos: Vec<&'a (MyTrait<T>+'a)> ,
57 impl<'a, T> MyContainer<'a, T> {
58 pub fn add (&mut self, foo: &'a MyTrait<T>) {