From c4ae6c2bb95551afed4b87346cdf4ad4e4ba052c Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sun, 18 Oct 2020 17:05:19 +0100 Subject: [PATCH] Add comment --- compiler/rustc_mir_build/src/thir/pattern/_match.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/rustc_mir_build/src/thir/pattern/_match.rs b/compiler/rustc_mir_build/src/thir/pattern/_match.rs index fb068f21d8a69..a7ddca1b6b632 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), } }