about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNadrieril <nadrieril+git@gmail.com>2020-10-18 17:05:19 +0100
committerNadrieril <nadrieril+git@gmail.com>2020-10-18 17:05:19 +0100
commitc4ae6c2bb95551afed4b87346cdf4ad4e4ba052c (patch)
treee3087946a7b07a257bfe9d9504b77d4f1bf7f61c
parentda0ba2f64574e0ecca65d0d1045af00abe1515fd (diff)
downloadrust-c4ae6c2bb95551afed4b87346cdf4ad4e4ba052c.tar.gz
rust-c4ae6c2bb95551afed4b87346cdf4ad4e4ba052c.zip
Add comment
-rw-r--r--compiler/rustc_mir_build/src/thir/pattern/_match.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/rustc_mir_build/src/thir/pattern/_match.rs b/compiler/rustc_mir_build/src/thir/pattern/_match.rs
index fb068f21d8a..a7ddca1b6b6 100644
--- a/compiler/rustc_mir_build/src/thir/pattern/_match.rs
+++ b/compiler/rustc_mir_build/src/thir/pattern/_match.rs
@@ -2113,6 +2113,9 @@ fn pat_constructor<'tcx>(
                 match value.ty.kind() {
                     ty::Float(_) => Some(FloatRange(value, value, RangeEnd::Included)),
                     ty::Ref(_, t, _) if t.is_str() => Some(Str(value)),
+                    // All constants that can be structurally matched have already been expanded
+                    // into the corresponding `Pat`s by `const_to_pat`. Constants that remain are
+                    // opaque.
                     _ => Some(Opaque),
                 }
             }