summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_middle/src/thir.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /compiler/rustc_middle/src/thir.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_middle/src/thir.rs')
-rw-r--r--compiler/rustc_middle/src/thir.rs26
1 files changed, 15 insertions, 11 deletions
diff --git a/compiler/rustc_middle/src/thir.rs b/compiler/rustc_middle/src/thir.rs
index ebc1c1190..89934e435 100644
--- a/compiler/rustc_middle/src/thir.rs
+++ b/compiler/rustc_middle/src/thir.rs
@@ -563,11 +563,11 @@ pub enum InlineAsmOperand<'tcx> {
out_expr: Option<ExprId>,
},
Const {
- value: mir::ConstantKind<'tcx>,
+ value: mir::Const<'tcx>,
span: Span,
},
SymFn {
- value: mir::ConstantKind<'tcx>,
+ value: mir::Const<'tcx>,
span: Span,
},
SymStatic {
@@ -732,14 +732,18 @@ pub enum PatKind<'tcx> {
},
/// One of the following:
- /// * `&str`, which will be handled as a string pattern and thus exhaustiveness
- /// checking will detect if you use the same string twice in different patterns.
- /// * integer, bool, char or float, which will be handled by exhaustiveness to cover exactly
- /// its own value, similar to `&str`, but these values are much simpler.
- /// * Opaque constants, that must not be matched structurally. So anything that does not derive
- /// `PartialEq` and `Eq`.
+ /// * `&str` (represented as a valtree), which will be handled as a string pattern and thus
+ /// exhaustiveness checking will detect if you use the same string twice in different
+ /// patterns.
+ /// * integer, bool, char or float (represented as a valtree), which will be handled by
+ /// exhaustiveness to cover exactly its own value, similar to `&str`, but these values are
+ /// much simpler.
+ /// * Opaque constants (represented as `mir::ConstValue`), that must not be matched
+ /// structurally. So anything that does not derive `PartialEq` and `Eq`.
+ ///
+ /// These are always compared with the matched place using (the semantics of) `PartialEq`.
Constant {
- value: mir::ConstantKind<'tcx>,
+ value: mir::Const<'tcx>,
},
Range(Box<PatRange<'tcx>>),
@@ -769,8 +773,8 @@ pub enum PatKind<'tcx> {
#[derive(Clone, Debug, PartialEq, HashStable)]
pub struct PatRange<'tcx> {
- pub lo: mir::ConstantKind<'tcx>,
- pub hi: mir::ConstantKind<'tcx>,
+ pub lo: mir::Const<'tcx>,
+ pub hi: mir::Const<'tcx>,
pub end: RangeEnd,
}