diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-02-02 13:57:36 +0000 | 
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-04-08 12:02:19 +0000 | 
| commit | 84acfe86dec370028987c205e7ba32cc5796d9b0 (patch) | |
| tree | ff88b90d1afc4d94167449b71731a3a61b31bb1f /compiler/rustc_hir_analysis/src/variance/constraints.rs | |
| parent | 6b24a9cf70032429b6a3730c89db2c8cc6de9314 (diff) | |
| download | rust-84acfe86dec370028987c205e7ba32cc5796d9b0.tar.gz rust-84acfe86dec370028987c205e7ba32cc5796d9b0.zip | |
Actually create ranged int types in the type system.
Diffstat (limited to 'compiler/rustc_hir_analysis/src/variance/constraints.rs')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/variance/constraints.rs | 14 | 
1 files changed, 14 insertions, 0 deletions
| diff --git a/compiler/rustc_hir_analysis/src/variance/constraints.rs b/compiler/rustc_hir_analysis/src/variance/constraints.rs index 28c86d8019e..20e4110e137 100644 --- a/compiler/rustc_hir_analysis/src/variance/constraints.rs +++ b/compiler/rustc_hir_analysis/src/variance/constraints.rs @@ -249,6 +249,20 @@ impl<'a, 'tcx> ConstraintContext<'a, 'tcx> { self.add_constraints_from_ty(current, typ, variance); } + ty::Pat(typ, pat) => { + match *pat { + ty::PatternKind::Range { start, end, include_end: _ } => { + if let Some(start) = start { + self.add_constraints_from_const(current, start, variance); + } + if let Some(end) = end { + self.add_constraints_from_const(current, end, variance); + } + } + } + self.add_constraints_from_ty(current, typ, variance); + } + ty::Slice(typ) => { self.add_constraints_from_ty(current, typ, variance); } | 
