]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-unused-rps-in-assoc-type.rs
Add 'src/tools/miri/' from commit '75dd959a3a40eb5b4574f8d2e23aa6efbeb33573'
[rust.git] / src / test / 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() { }