Using let
pattern with ref
results in 'mismatched types' when combined with 'panic!()'
#118113
Labels
A-coercions
Area: implicit and explicit `expr as Type` coercions
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: The code should compile successfully by coercing the
!
frompanic!()
toFoo
.Instead, this happened: rustc produces the following error:
The code compiles successfully if the
ref
keyword is removed.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: