Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit b5b1356

Browse files
committed
Auto merge of rust-lang#126240 - matthiaskrgr:rollup-ks4o2n9, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - rust-lang#126063 (Remove some unused crate dependencies.) - rust-lang#126115 (Fix ICE due to `unwrap` in `probe_for_name_many`) - rust-lang#126159 (ScalarInt: size mismatches are a bug, do not delay the panic) - rust-lang#126184 (interpret: do not ICE on padded non-pow2 SIMD vectors) - rust-lang#126191 (Fix `NonZero` doctest inconsistencies) - rust-lang#126211 (migrate tests/run-make/llvm-outputs to use rmake.rs) - rust-lang#126212 (fix: build on haiku) - rust-lang#126215 (Add explanatory note to async block type mismatch error) - rust-lang#126223 (run-make: add `run_in_tmpdir` self-test) r? `@ghost` `@rustbot` modify labels: rollup
2 parents d402830 + d762ef1 commit b5b1356

File tree

74 files changed

+448
-379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+448
-379
lines changed

Cargo.lock

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3627,7 +3627,6 @@ dependencies = [
36273627
"rustc_macros",
36283628
"rustc_serialize",
36293629
"rustc_span",
3630-
"smallvec",
36313630
]
36323631

36333632
[[package]]
@@ -3708,7 +3707,6 @@ dependencies = [
37083707
"icu_locid",
37093708
"icu_locid_transform",
37103709
"icu_provider",
3711-
"icu_provider_adapters",
37123710
"zerovec",
37133711
]
37143712

@@ -3889,7 +3887,6 @@ dependencies = [
38893887
"portable-atomic",
38903888
"rustc-hash",
38913889
"rustc-rayon",
3892-
"rustc-rayon-core",
38933890
"rustc_arena",
38943891
"rustc_graphviz",
38953892
"rustc_index",
@@ -3930,7 +3927,6 @@ dependencies = [
39303927
"rustc_expand",
39313928
"rustc_feature",
39323929
"rustc_fluent_macro",
3933-
"rustc_hir",
39343930
"rustc_hir_analysis",
39353931
"rustc_hir_pretty",
39363932
"rustc_hir_typeck",
@@ -4193,7 +4189,6 @@ dependencies = [
41934189
"proc-macro2",
41944190
"quote",
41954191
"syn 2.0.66",
4196-
"synstructure",
41974192
]
41984193

41994194
[[package]]
@@ -4385,7 +4380,6 @@ dependencies = [
43854380
"field-offset",
43864381
"gsgdt",
43874382
"polonius-engine",
4388-
"rustc-rayon",
43894383
"rustc-rayon-core",
43904384
"rustc_apfloat",
43914385
"rustc_arena",
@@ -4417,7 +4411,6 @@ dependencies = [
44174411
name = "rustc_mir_build"
44184412
version = "0.0.0"
44194413
dependencies = [
4420-
"either",
44214414
"itertools 0.12.1",
44224415
"rustc_apfloat",
44234416
"rustc_arena",
@@ -4436,7 +4429,6 @@ dependencies = [
44364429
"rustc_span",
44374430
"rustc_target",
44384431
"rustc_trait_selection",
4439-
"smallvec",
44404432
"tracing",
44414433
]
44424434

@@ -4511,14 +4503,7 @@ dependencies = [
45114503
name = "rustc_next_trait_solver"
45124504
version = "0.0.0"
45134505
dependencies = [
4514-
"derivative",
4515-
"rustc_ast_ir",
4516-
"rustc_data_structures",
4517-
"rustc_macros",
4518-
"rustc_serialize",
45194506
"rustc_type_ir",
4520-
"rustc_type_ir_macros",
4521-
"tracing",
45224507
]
45234508

45244509
[[package]]
@@ -4623,7 +4608,6 @@ version = "0.0.0"
46234608
dependencies = [
46244609
"field-offset",
46254610
"measureme",
4626-
"rustc-rayon-core",
46274611
"rustc_data_structures",
46284612
"rustc_errors",
46294613
"rustc_hir",
@@ -5329,7 +5313,6 @@ name = "stable_mir"
53295313
version = "0.1.0-preview"
53305314
dependencies = [
53315315
"scoped-tls",
5332-
"tracing",
53335316
]
53345317

53355318
[[package]]
@@ -5625,8 +5608,6 @@ dependencies = [
56255608
"core",
56265609
"getopts",
56275610
"libc",
5628-
"panic_abort",
5629-
"panic_unwind",
56305611
"std",
56315612
]
56325613

compiler/rustc_ast_ir/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ rustc_data_structures = { path = "../rustc_data_structures", optional = true }
99
rustc_macros = { path = "../rustc_macros", optional = true }
1010
rustc_serialize = { path = "../rustc_serialize", optional = true }
1111
rustc_span = { path = "../rustc_span", optional = true }
12-
smallvec = { version = "1.8.1" }
1312
# tidy-alphabetical-end
1413

1514
[features]

compiler/rustc_baked_icu_data/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ icu_list = "1.2"
99
icu_locid = "1.2"
1010
icu_locid_transform = "1.3.2"
1111
icu_provider = "1.2"
12-
icu_provider_adapters = "1.2"
1312
zerovec = "0.10.0"
1413
# tidy-alphabetical-end
1514

compiler/rustc_codegen_cranelift/src/constant.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub(crate) fn codegen_const_value<'tcx>(
110110
if fx.clif_type(layout.ty).is_some() {
111111
return CValue::const_val(fx, layout, int);
112112
} else {
113-
let raw_val = int.size().truncate(int.assert_bits(int.size()));
113+
let raw_val = int.size().truncate(int.to_bits(int.size()));
114114
let val = match int.size().bytes() {
115115
1 => fx.bcx.ins().iconst(types::I8, raw_val as i64),
116116
2 => fx.bcx.ins().iconst(types::I16, raw_val as i64),
@@ -501,12 +501,12 @@ pub(crate) fn mir_operand_get_const_val<'tcx>(
501501
Ordering::Equal => scalar_int,
502502
Ordering::Less => match ty.kind() {
503503
ty::Uint(_) => ScalarInt::try_from_uint(
504-
scalar_int.assert_uint(scalar_int.size()),
504+
scalar_int.to_uint(scalar_int.size()),
505505
fx.layout_of(*ty).size,
506506
)
507507
.unwrap(),
508508
ty::Int(_) => ScalarInt::try_from_int(
509-
scalar_int.assert_int(scalar_int.size()),
509+
scalar_int.to_int(scalar_int.size()),
510510
fx.layout_of(*ty).size,
511511
)
512512
.unwrap(),

compiler/rustc_codegen_cranelift/src/intrinsics/llvm_x86.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
902902
.span_fatal(span, "Index argument for `_mm_cmpestri` is not a constant");
903903
};
904904

905-
let imm8 = imm8.try_to_u8().unwrap_or_else(|_| panic!("kind not scalar: {:?}", imm8));
905+
let imm8 = imm8.to_u8();
906906

907907
codegen_inline_asm_inner(
908908
fx,
@@ -955,7 +955,7 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
955955
.span_fatal(span, "Index argument for `_mm_cmpestrm` is not a constant");
956956
};
957957

958-
let imm8 = imm8.try_to_u8().unwrap_or_else(|_| panic!("kind not scalar: {:?}", imm8));
958+
let imm8 = imm8.to_u8();
959959

960960
codegen_inline_asm_inner(
961961
fx,
@@ -1003,7 +1003,7 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
10031003
);
10041004
};
10051005

1006-
let imm8 = imm8.try_to_u8().unwrap_or_else(|_| panic!("kind not scalar: {:?}", imm8));
1006+
let imm8 = imm8.to_u8();
10071007

10081008
codegen_inline_asm_inner(
10091009
fx,
@@ -1040,7 +1040,7 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
10401040
);
10411041
};
10421042

1043-
let imm8 = imm8.try_to_u8().unwrap_or_else(|_| panic!("kind not scalar: {:?}", imm8));
1043+
let imm8 = imm8.to_u8();
10441044

10451045
codegen_inline_asm_inner(
10461046
fx,
@@ -1195,7 +1195,7 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
11951195
.span_fatal(span, "Func argument for `_mm_sha1rnds4_epu32` is not a constant");
11961196
};
11971197

1198-
let func = func.try_to_u8().unwrap_or_else(|_| panic!("kind not scalar: {:?}", func));
1198+
let func = func.to_u8();
11991199

12001200
codegen_inline_asm_inner(
12011201
fx,

compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
147147

148148
let total_len = lane_count * 2;
149149

150-
let indexes =
151-
idx.iter().map(|idx| idx.unwrap_leaf().try_to_u32().unwrap()).collect::<Vec<u32>>();
150+
let indexes = idx.iter().map(|idx| idx.unwrap_leaf().to_u32()).collect::<Vec<u32>>();
152151

153152
for &idx in &indexes {
154153
assert!(u64::from(idx) < total_len, "idx {} out of range 0..{}", idx, total_len);
@@ -282,9 +281,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
282281
fx.tcx.dcx().span_fatal(span, "Index argument for `simd_insert` is not a constant");
283282
};
284283

285-
let idx: u32 = idx_const
286-
.try_to_u32()
287-
.unwrap_or_else(|_| panic!("kind not scalar: {:?}", idx_const));
284+
let idx: u32 = idx_const.to_u32();
288285
let (lane_count, _lane_ty) = base.layout().ty.simd_size_and_type(fx.tcx);
289286
if u64::from(idx) >= lane_count {
290287
fx.tcx.dcx().span_fatal(
@@ -330,9 +327,7 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
330327
return;
331328
};
332329

333-
let idx = idx_const
334-
.try_to_u32()
335-
.unwrap_or_else(|_| panic!("kind not scalar: {:?}", idx_const));
330+
let idx = idx_const.to_u32();
336331
let (lane_count, _lane_ty) = v.layout().ty.simd_size_and_type(fx.tcx);
337332
if u64::from(idx) >= lane_count {
338333
fx.tcx.dcx().span_fatal(

compiler/rustc_codegen_cranelift/src/value_and_place.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ impl<'tcx> CValue<'tcx> {
327327

328328
let val = match layout.ty.kind() {
329329
ty::Uint(UintTy::U128) | ty::Int(IntTy::I128) => {
330-
let const_val = const_val.assert_bits(layout.size);
330+
let const_val = const_val.to_bits(layout.size);
331331
let lsb = fx.bcx.ins().iconst(types::I64, const_val as u64 as i64);
332332
let msb = fx.bcx.ins().iconst(types::I64, (const_val >> 64) as u64 as i64);
333333
fx.bcx.ins().iconcat(lsb, msb)
@@ -339,7 +339,7 @@ impl<'tcx> CValue<'tcx> {
339339
| ty::Ref(..)
340340
| ty::RawPtr(..)
341341
| ty::FnPtr(..) => {
342-
let raw_val = const_val.size().truncate(const_val.assert_bits(layout.size));
342+
let raw_val = const_val.size().truncate(const_val.to_bits(layout.size));
343343
fx.bcx.ins().iconst(clif_ty, raw_val as i64)
344344
}
345345
ty::Float(FloatTy::F32) => {

compiler/rustc_codegen_gcc/src/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ impl<'gcc, 'tcx> ConstMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
166166
let bitsize = if layout.is_bool() { 1 } else { layout.size(self).bits() };
167167
match cv {
168168
Scalar::Int(int) => {
169-
let data = int.assert_bits(layout.size(self));
169+
let data = int.to_bits(layout.size(self));
170170

171171
// FIXME(antoyo): there's some issues with using the u128 code that follows, so hard-code
172172
// the paths for floating-point values.

compiler/rustc_codegen_llvm/src/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ impl<'ll, 'tcx> ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
244244
let bitsize = if layout.is_bool() { 1 } else { layout.size(self).bits() };
245245
match cv {
246246
Scalar::Int(int) => {
247-
let data = int.assert_bits(layout.size(self));
247+
let data = int.to_bits(layout.size(self));
248248
let llval = self.const_uint_big(self.type_ix(bitsize), data);
249249
if matches!(layout.primitive(), Pointer(_)) {
250250
unsafe { llvm::LLVMConstIntToPtr(llval, llty) }

compiler/rustc_codegen_llvm/src/intrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
12231223
.iter()
12241224
.enumerate()
12251225
.map(|(arg_idx, val)| {
1226-
let idx = val.unwrap_leaf().try_to_i32().unwrap();
1226+
let idx = val.unwrap_leaf().to_i32();
12271227
if idx >= i32::try_from(total_len).unwrap() {
12281228
bx.sess().dcx().emit_err(InvalidMonomorphization::SimdIndexOutOfBounds {
12291229
span,

0 commit comments

Comments
 (0)