]> git.proxmox.com Git - rustc.git/blob - src/test/ui/generic-associated-types/bugs/issue-87803.rs
New upstream version 1.64.0+dfsg1
[rustc.git] / src / test / 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 #![feature(generic_associated_types)]
8
9 trait Scanner {
10 type Input<'a>;
11 type Token<'a>;
12
13 fn scan<'a>(&mut self, i : Self::Input<'a>) -> Self::Token<'a>;
14 }
15
16 struct IdScanner();
17
18 impl Scanner for IdScanner {
19 type Input<'a> = &'a str;
20 type Token<'a> = &'a str;
21
22 fn scan<'a>(&mut self, s : &'a str) -> &'a str {
23 s
24 }
25 }
26
27 fn main() {}