summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-36381.rs
blob: 7db56f1dce86cc13d9cfb9ad6b823906d9ccde65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// run-pass
// Regression test for #36381. The monomorphization collector was asserting that
// there are no projection types, but the `<&str as
// StreamOnce>::Position` projection contained a late-bound region,
// and we don't currently normalize in that case until the function is
// actually invoked.

pub trait StreamOnce {
    type Position;
}

impl<'a> StreamOnce for &'a str {
    type Position = usize;
}

pub fn parser<F>(_: F) {
}

fn follow(_: &str) -> <&str as StreamOnce>::Position {
    panic!()
}

fn main() {
    parser(follow);
}