diff options
| author | bors <bors@rust-lang.org> | 2024-06-10 21:21:00 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-06-10 21:21:00 +0000 |
| commit | b5b13568fb5da4ac988bde370008d6134d3dfe6c (patch) | |
| tree | 6c5c97a6ce4d3c13ece43e509e62df9f3b0200dc /compiler/rustc_pattern_analysis/src | |
| parent | d402830c8a356332de93761d6996faf5a2ca29ca (diff) | |
| parent | d762ef1d0c16ef70d6282a69b16891f8156782f1 (diff) | |
| download | rust-b5b13568fb5da4ac988bde370008d6134d3dfe6c.tar.gz rust-b5b13568fb5da4ac988bde370008d6134d3dfe6c.zip | |
Auto merge of #126240 - matthiaskrgr:rollup-ks4o2n9, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - #126063 (Remove some unused crate dependencies.) - #126115 (Fix ICE due to `unwrap` in `probe_for_name_many`) - #126159 (ScalarInt: size mismatches are a bug, do not delay the panic) - #126184 (interpret: do not ICE on padded non-pow2 SIMD vectors) - #126191 (Fix `NonZero` doctest inconsistencies) - #126211 (migrate tests/run-make/llvm-outputs to use rmake.rs) - #126212 (fix: build on haiku) - #126215 (Add explanatory note to async block type mismatch error) - #126223 (run-make: add `run_in_tmpdir` self-test) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/rustc.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_pattern_analysis/src/rustc.rs b/compiler/rustc_pattern_analysis/src/rustc.rs index 81c5f355231..8391c694c64 100644 --- a/compiler/rustc_pattern_analysis/src/rustc.rs +++ b/compiler/rustc_pattern_analysis/src/rustc.rs @@ -6,11 +6,12 @@ use rustc_hir::def_id::DefId; use rustc_hir::HirId; use rustc_index::{Idx, IndexVec}; use rustc_middle::middle::stability::EvalResult; -use rustc_middle::mir::interpret::Scalar; use rustc_middle::mir::{self, Const}; use rustc_middle::thir::{self, FieldPat, Pat, PatKind, PatRange, PatRangeBoundary}; use rustc_middle::ty::layout::IntegerExt; -use rustc_middle::ty::{self, FieldDef, OpaqueTypeKey, Ty, TyCtxt, TypeVisitableExt, VariantDef}; +use rustc_middle::ty::{ + self, FieldDef, OpaqueTypeKey, ScalarInt, Ty, TyCtxt, TypeVisitableExt, VariantDef, +}; use rustc_middle::{bug, span_bug}; use rustc_session::lint; use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP}; @@ -701,9 +702,9 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> { ty::Int(_) => miint.as_finite_int(size.bits()).unwrap(), _ => miint.as_finite_uint().unwrap(), }; - match Scalar::try_from_uint(bits, size) { + match ScalarInt::try_from_uint(bits, size) { Some(scalar) => { - let value = mir::Const::from_scalar(tcx, scalar, ty.inner()); + let value = mir::Const::from_scalar(tcx, scalar.into(), ty.inner()); PatRangeBoundary::Finite(value) } // The value doesn't fit. Since `x >= 0` and 0 always encodes the minimum value |
