2014-12-04 19:06:41 -06:00
|
|
|
// Test the case where the `Self` type has a bound lifetime that must
|
|
|
|
// be adjusted in the fn signature. Issue #19537.
|
|
|
|
|
|
|
|
use std::collections::HashMap;
|
|
|
|
|
|
|
|
struct Foo<'a> {
|
2015-01-08 05:02:42 -06:00
|
|
|
map: HashMap<usize, &'a str>
|
2014-12-04 19:06:41 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> Foo<'a> {
|
|
|
|
fn new() -> Foo<'a> { panic!() }
|
|
|
|
fn insert(&'a mut self) { }
|
|
|
|
}
|
|
|
|
fn main() {
|
|
|
|
let mut foo = Foo::new();
|
|
|
|
foo.insert();
|
|
|
|
foo.insert(); //~ ERROR cannot borrow
|
|
|
|
}
|