Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/tests/regression.rs')
| -rw-r--r-- | crates/hir-ty/src/tests/regression.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/hir-ty/src/tests/regression.rs b/crates/hir-ty/src/tests/regression.rs index dc88231187..0d08c75aad 100644 --- a/crates/hir-ty/src/tests/regression.rs +++ b/crates/hir-ty/src/tests/regression.rs @@ -7,6 +7,16 @@ use crate::tests::check; use super::{check_infer, check_no_mismatches, check_types}; #[test] +fn closure_in_enum_discriminant_does_not_panic() { + check( + r#" + enum Enum { X = || {} } + // ^^^^^ expected isize, got impl Fn() + "#, + ); +} + +#[test] fn bug_484() { check_infer( r#" |