]> git.proxmox.com Git - rustc.git/blob - tests/ui/late-bound-lifetimes/issue-36381.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / late-bound-lifetimes / issue-36381.rs
1 // run-pass
2 // Regression test for #36381. The monomorphization collector was asserting that
3 // there are no projection types, but the `<&str as
4 // StreamOnce>::Position` projection contained a late-bound region,
5 // and we don't currently normalize in that case until the function is
6 // actually invoked.
7
8 pub trait StreamOnce {
9 type Position;
10 }
11
12 impl<'a> StreamOnce for &'a str {
13 type Position = usize;
14 }
15
16 pub fn parser<F>(_: F) {
17 }
18
19 fn follow(_: &str) -> <&str as StreamOnce>::Position {
20 panic!()
21 }
22
23 fn main() {
24 parser(follow);
25 }