about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc_mir/hair/pattern/_match.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc_mir/hair/pattern/_match.rs b/src/librustc_mir/hair/pattern/_match.rs
index 84a3923c7b2..c7607ae9581 100644
--- a/src/librustc_mir/hair/pattern/_match.rs
+++ b/src/librustc_mir/hair/pattern/_match.rs
@@ -786,6 +786,8 @@ impl<'tcx> Constructor<'tcx> {
     }
 
     /// This returns one wildcard pattern for each argument to this constructor.
+    ///
+    /// This must be consistent with `apply`, `specialize_one_pattern` and `arity`.
     fn wildcard_subpatterns<'a>(
         &self,
         cx: &MatchCheckCtxt<'a, 'tcx>,
@@ -862,6 +864,8 @@ impl<'tcx> Constructor<'tcx> {
     ///
     /// For instance, a tuple pattern `(_, 42, Some([]))` has the arity of 3.
     /// A struct pattern's arity is the number of fields it contains, etc.
+    ///
+    /// This must be consistent with `wildcard_subpatterns`, `specialize_one_pattern` and `apply`.
     fn arity<'a>(&self, cx: &MatchCheckCtxt<'a, 'tcx>, ty: Ty<'tcx>) -> u64 {
         debug!("Constructor::arity({:#?}, {:?})", self, ty);
         match self {
@@ -883,6 +887,8 @@ impl<'tcx> Constructor<'tcx> {
     /// Apply a constructor to a list of patterns, yielding a new pattern. `pats`
     /// must have as many elements as this constructor's arity.
     ///
+    /// This must be consistent with `wildcard_subpatterns`, `specialize_one_pattern` and `arity`.
+    ///
     /// Examples:
     /// `self`: `Constructor::Single`
     /// `ty`: `(u32, u32, u32)`