]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-28936.rs
Enable full revision in const generics ui tests
[rust.git] / src / test / ui / issues / issue-28936.rs
1 // check-pass
2 pub type Session = i32;
3 pub struct StreamParser<'a, T> {
4     _tokens: T,
5     _session: &'a mut Session,
6 }
7
8 impl<'a, T> StreamParser<'a, T> {
9     pub fn thing(&mut self) -> bool { true }
10 }
11
12 pub fn parse_stream<T: Iterator<Item=i32>, U, F>(
13         _session: &mut Session, _tokens: T, _f: F) -> U
14     where F: Fn(&mut StreamParser<T>) -> U { panic!(); }
15
16 pub fn thing(session: &mut Session) {
17     let mut stream = vec![1, 2, 3].into_iter();
18
19     let _b = parse_stream(session,
20                           stream.by_ref(),
21                           // replacing the above with the following fixes it
22                           //&mut stream,
23                           |p| p.thing());
24
25 }
26
27 fn main() {}