diff options
Diffstat (limited to 'src/test/ui/recursion/recursive-types-are-not-uninhabited.rs')
-rw-r--r-- | src/test/ui/recursion/recursive-types-are-not-uninhabited.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/recursion/recursive-types-are-not-uninhabited.rs b/src/test/ui/recursion/recursive-types-are-not-uninhabited.rs new file mode 100644 index 000000000..448930363 --- /dev/null +++ b/src/test/ui/recursion/recursive-types-are-not-uninhabited.rs @@ -0,0 +1,13 @@ +struct R<'a> { + r: &'a R<'a>, +} + +fn foo(res: Result<u32, &R>) -> u32 { + let Ok(x) = res; + //~^ ERROR refutable pattern + x +} + +fn main() { + foo(Ok(23)); +} |