diff options
| author | Roxane <roxane.fruytier@hotmail.com> | 2021-08-12 21:29:04 -0400 |
|---|---|---|
| committer | Roxane <roxane.fruytier@hotmail.com> | 2021-08-12 21:33:06 -0400 |
| commit | 7d0afaec5ad5b1c4e80d359bd070edba9f60f396 (patch) | |
| tree | b5820116c3a322a5227a5e2a24eb65b78a9c8ebc /compiler | |
| parent | 0fa3190394475a84360b34e074e719d519bc40f1 (diff) | |
| download | rust-7d0afaec5ad5b1c4e80d359bd070edba9f60f396.tar.gz rust-7d0afaec5ad5b1c4e80d359bd070edba9f60f396.zip | |
Add missing multi variant cases
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_typeck/src/expr_use_visitor.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_typeck/src/expr_use_visitor.rs b/compiler/rustc_typeck/src/expr_use_visitor.rs index 1d7852d964c..ac26380582a 100644 --- a/compiler/rustc_typeck/src/expr_use_visitor.rs +++ b/compiler/rustc_typeck/src/expr_use_visitor.rs @@ -265,6 +265,9 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> { if def.variants.len() > 1 { needs_to_be_read = true; } + } else { + // If it is not ty::Adt, then it is a MultiVariant + needs_to_be_read = true; } } PatKind::Lit(_) | PatKind::Range(..) => { |
