]> git.lizzy.rs Git - rust.git/blob - tests/ui/recursion/recursive-types-are-not-uninhabited.rs
Rollup merge of #106759 - compiler-errors:revert-105255, r=cjgillot
[rust.git] / tests / ui / recursion / recursive-types-are-not-uninhabited.rs
1 struct R<'a> {
2     r: &'a R<'a>,
3 }
4
5 fn foo(res: Result<u32, &R>) -> u32 {
6     let Ok(x) = res;
7     //~^ ERROR refutable pattern
8     x
9 }
10
11 fn main() {
12     foo(Ok(23));
13 }