]> git.lizzy.rs Git - rust.git/blob - src/test/run-fail/issue-28934.rs
Auto merge of #63994 - Centril:refactor-qualify-consts, r=spastorino,oli-obk
[rust.git] / src / test / run-fail / issue-28934.rs
1 // Regression test: issue had to do with "givens" in region inference,
2 // which were not being considered during the contraction phase.
3
4 // error-pattern:explicit panic
5
6 struct Parser<'i: 't, 't>(&'i u8, &'t u8);
7
8 impl<'i, 't> Parser<'i, 't> {
9     fn parse_nested_block<F, T>(&mut self, parse: F) -> Result<T, ()>
10         where for<'tt> F: FnOnce(&mut Parser<'i, 'tt>) -> T
11     {
12         panic!()
13     }
14
15     fn expect_exhausted(&mut self) -> Result<(), ()> {
16         Ok(())
17     }
18 }
19
20 fn main() {
21     let x = 0u8;
22     Parser(&x, &x).parse_nested_block(|input| input.expect_exhausted()).unwrap();
23 }