]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-36381.rs
Rollup merge of #86479 - exphp-forks:float-debug-exponential, r=yaahc
[rust.git] / src / test / ui / issues / 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 }