]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-unused-rps-in-assoc-type.rs
Rollup merge of #106625 - Swatinem:ref/cov6, r=nagisa
[rust.git] / tests / ui / impl-unused-rps-in-assoc-type.rs
1 // Test that lifetime parameters must be constrained if they appear in
2 // an associated type def'n. Issue #22077.
3
4 trait Fun {
5     type Output;
6     fn call<'x>(&'x self) -> Self::Output;
7 }
8
9 struct Holder { x: String }
10
11 impl<'a> Fun for Holder { //~ ERROR E0207
12     type Output = &'a str;
13     fn call<'b>(&'b self) -> &'b str {
14         &self.x[..]
15     }
16 }
17
18 fn main() { }