]> git.lizzy.rs Git - rust.git/blob - tests/ui/generic-associated-types/bugs/issue-87803.rs
Rollup merge of #104965 - zacklukem:p-option-as_ref-docs, r=scottmcm
[rust.git] / tests / ui / generic-associated-types / bugs / issue-87803.rs
1 // check-fail
2 // known-bug: #87803
3
4 // This should pass, but using a type alias vs a reference directly
5 // changes late-bound -> early-bound.
6
7 trait Scanner {
8     type Input<'a>;
9     type Token<'a>;
10
11     fn scan<'a>(&mut self, i : Self::Input<'a>) -> Self::Token<'a>;
12 }
13
14 struct IdScanner();
15
16 impl Scanner for IdScanner {
17     type Input<'a> = &'a str;
18     type Token<'a> = &'a str;
19
20     fn scan<'a>(&mut self, s : &'a str) -> &'a str {
21         s
22     }
23 }
24
25 fn main() {}