diff options
Diffstat (limited to 'tests/ui/nll/user-annotations/downcast-infer.rs')
-rw-r--r-- | tests/ui/nll/user-annotations/downcast-infer.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/nll/user-annotations/downcast-infer.rs b/tests/ui/nll/user-annotations/downcast-infer.rs new file mode 100644 index 000000000..b27429f4d --- /dev/null +++ b/tests/ui/nll/user-annotations/downcast-infer.rs @@ -0,0 +1,11 @@ +// check-pass + +// Check that we don't try to downcast `_` when type-checking the annotation. +fn main() { + let x = Some(Some(Some(1))); + + match x { + Some::<Option<_>>(Some(Some(v))) => (), + _ => (), + } +} |