1 // Copyright 2012 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 // Check that we correctly infer that b and c must be region
13 // parameterized because they reference a which requires a region.
15 type a<'a> = &'a isize;
16 type b<'a> = Box<a<'a>>;
23 fn set_f_ok(&mut self, b: Box<b<'a>>);
24 fn set_f_bad(&mut self, b: Box<b>);
27 impl<'a> set_f<'a> for c<'a> {
28 fn set_f_ok(&mut self, b: Box<b<'a>>) {
32 fn set_f_bad(&mut self, b: Box<b>) {
34 //~^ ERROR mismatched types
35 //~| expected type `std::boxed::Box<std::boxed::Box<&'a isize>>`
36 //~| found type `std::boxed::Box<std::boxed::Box<&isize>>`
37 //~| lifetime mismatch