]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-25700-2.rs
Merge commit '0eff589afc83e21a03a168497bbab6b4dfbb4ef6' into clippyup
[rust.git] / src / test / ui / issues / issue-25700-2.rs
1 // run-pass
2 pub trait Parser {
3     type Input;
4 }
5
6 pub struct Iter<P: Parser>(P, P::Input);
7
8 pub struct Map<P, F>(P, F);
9 impl<P, F> Parser for Map<P, F> where F: FnMut(P) {
10     type Input = u8;
11 }
12
13 trait AstId { type Untyped; }
14 impl AstId for u32 { type Untyped = u32; }
15
16 fn record_type<Id: AstId>(i: Id::Untyped) -> u8 {
17     Iter(Map(i, |_: Id::Untyped| {}), 42).1
18 }
19
20 pub fn main() {
21     assert_eq!(record_type::<u32>(3), 42);
22 }