From 7c6960e289c627bc5533c03769ff45b03a141be9 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Tue, 27 Feb 2024 17:23:06 +0100 Subject: [PATCH] Document invariant in `thir::PatRange` --- compiler/rustc_middle/src/thir.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_middle/src/thir.rs b/compiler/rustc_middle/src/thir.rs index 7ffa88afa159..ee11a75529b8 100644 --- a/compiler/rustc_middle/src/thir.rs +++ b/compiler/rustc_middle/src/thir.rs @@ -815,7 +815,9 @@ pub enum PatKind<'tcx> { /// The boundaries must be of the same type and that type must be numeric. #[derive(Clone, Debug, PartialEq, HashStable, TypeVisitable)] pub struct PatRange<'tcx> { + /// Must not be `PosInfinity`. pub lo: PatRangeBoundary<'tcx>, + /// Must not be `NegInfinity`. pub hi: PatRangeBoundary<'tcx>, #[type_visitable(ignore)] pub end: RangeEnd,