]> git.lizzy.rs Git - rust.git/blob - src/test/ui/hrtb/hrtb-debruijn-in-receiver.rs
Rollup merge of #97317 - GuillaumeGomez:gui-settings-text-click, r=jsha
[rust.git] / src / test / ui / hrtb / hrtb-debruijn-in-receiver.rs
1 // Test the case where the `Self` type has a bound lifetime that must
2 // be adjusted in the fn signature. Issue #19537.
3
4 use std::collections::HashMap;
5
6 struct Foo<'a> {
7     map: HashMap<usize, &'a str>
8 }
9
10 impl<'a> Foo<'a> {
11     fn new() -> Foo<'a> { panic!() }
12     fn insert(&'a mut self) { }
13 }
14 fn main() {
15     let mut foo = Foo::new();
16     foo.insert();
17     foo.insert(); //~ ERROR cannot borrow
18 }