Skip to content

Commit f41f404

Browse files
committed
Auto merge of #150231 - JonathanBrouwer:rollup-btei0hm, r=JonathanBrouwer
Rollup of 4 pull requests Successful merges: - #149512 (Fix d32 usage in Arm target specs ) - #150210 (tests/debuginfo/function-arg-initialization.rs: Stop disabling SingleUseConsts MIR pass) - #150221 (rustdoc: handle macro expansions in types) - #150223 (GVN: Adds the `insert_unique` method) r? `@ghost` `@rustbot` modify labels: rollup
2 parents a6525d5 + 4b94235 commit f41f404

18 files changed

+74
-40
lines changed

compiler/rustc_ast_pretty/src/pprust/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ pub fn where_bound_predicate_to_string(where_bound_predicate: &ast::WhereBoundPr
3333
State::new().where_bound_predicate_to_string(where_bound_predicate)
3434
}
3535

36+
/// # Panics
37+
///
38+
/// Panics if `pat.kind` is `PatKind::Missing`.
3639
pub fn pat_to_string(pat: &ast::Pat) -> String {
3740
State::new().pat_to_string(pat)
3841
}

compiler/rustc_mir_transform/src/gvn.rs

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,19 @@ impl<'body, 'a, 'tcx> VnState<'body, 'a, 'tcx> {
420420
self.ecx.typing_env()
421421
}
422422

423+
fn insert_unique(
424+
&mut self,
425+
ty: Ty<'tcx>,
426+
value: impl FnOnce(VnOpaque) -> Value<'a, 'tcx>,
427+
) -> VnIndex {
428+
let index = self.values.insert_unique(ty, value);
429+
let _index = self.evaluated.push(None);
430+
debug_assert_eq!(index, _index);
431+
let _index = self.rev_locals.push(SmallVec::new());
432+
debug_assert_eq!(index, _index);
433+
index
434+
}
435+
423436
#[instrument(level = "trace", skip(self), ret)]
424437
fn insert(&mut self, ty: Ty<'tcx>, value: Value<'a, 'tcx>) -> VnIndex {
425438
let (index, new) = self.values.insert(ty, value);
@@ -437,11 +450,8 @@ impl<'body, 'a, 'tcx> VnState<'body, 'a, 'tcx> {
437450
/// from all the others.
438451
#[instrument(level = "trace", skip(self), ret)]
439452
fn new_opaque(&mut self, ty: Ty<'tcx>) -> VnIndex {
440-
let index = self.values.insert_unique(ty, Value::Opaque);
441-
let _index = self.evaluated.push(Some(None));
442-
debug_assert_eq!(index, _index);
443-
let _index = self.rev_locals.push(SmallVec::new());
444-
debug_assert_eq!(index, _index);
453+
let index = self.insert_unique(ty, Value::Opaque);
454+
self.evaluated[index] = Some(None);
445455
index
446456
}
447457

@@ -470,42 +480,29 @@ impl<'body, 'a, 'tcx> VnState<'body, 'a, 'tcx> {
470480
projection.map(|proj| proj.try_map(|index| self.locals[index], |ty| ty).ok_or(()));
471481
let projection = self.arena.try_alloc_from_iter(projection).ok()?;
472482

473-
let index = self.values.insert_unique(ty, |provenance| Value::Address {
483+
let index = self.insert_unique(ty, |provenance| Value::Address {
474484
base,
475485
projection,
476486
kind,
477487
provenance,
478488
});
479-
let _index = self.evaluated.push(None);
480-
debug_assert_eq!(index, _index);
481-
let _index = self.rev_locals.push(SmallVec::new());
482-
debug_assert_eq!(index, _index);
483-
484489
Some(index)
485490
}
486491

487492
#[instrument(level = "trace", skip(self), ret)]
488493
fn insert_constant(&mut self, value: Const<'tcx>) -> VnIndex {
489-
let (index, new) = if value.is_deterministic() {
494+
if value.is_deterministic() {
490495
// The constant is deterministic, no need to disambiguate.
491496
let constant = Value::Constant { value, disambiguator: None };
492-
self.values.insert(value.ty(), constant)
497+
self.insert(value.ty(), constant)
493498
} else {
494499
// Multiple mentions of this constant will yield different values,
495500
// so assign a different `disambiguator` to ensure they do not get the same `VnIndex`.
496-
let index = self.values.insert_unique(value.ty(), |disambiguator| Value::Constant {
501+
self.insert_unique(value.ty(), |disambiguator| Value::Constant {
497502
value,
498503
disambiguator: Some(disambiguator),
499-
});
500-
(index, true)
501-
};
502-
if new {
503-
let _index = self.evaluated.push(None);
504-
debug_assert_eq!(index, _index);
505-
let _index = self.rev_locals.push(SmallVec::new());
506-
debug_assert_eq!(index, _index);
504+
})
507505
}
508-
index
509506
}
510507

511508
#[inline]

compiler/rustc_target/src/spec/targets/arm_unknown_linux_gnueabihf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
1515
options: TargetOptions {
1616
abi: Abi::EabiHf,
1717
llvm_floatabi: Some(FloatAbi::Hard),
18-
features: "+strict-align,+v6,+vfp2,-d32".into(),
18+
features: "+strict-align,+v6,+vfp2".into(),
1919
max_atomic_width: Some(64),
2020
mcount: "\u{1}__gnu_mcount_nc".into(),
2121
llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),

compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabihf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
1717
llvm_floatabi: Some(FloatAbi::Hard),
1818
// Most of these settings are copied from the arm_unknown_linux_gnueabihf
1919
// target.
20-
features: "+strict-align,+v6,+vfp2,-d32".into(),
20+
features: "+strict-align,+v6,+vfp2".into(),
2121
max_atomic_width: Some(64),
2222
mcount: "\u{1}mcount".into(),
2323
// FIXME(compiler-team#422): musl targets should be dynamically linked by default.

compiler/rustc_target/src/spec/targets/armv6_unknown_freebsd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
1515
options: TargetOptions {
1616
abi: Abi::EabiHf,
1717
llvm_floatabi: Some(FloatAbi::Hard),
18-
features: "+v6,+vfp2,-d32".into(),
18+
features: "+v6,+vfp2".into(),
1919
max_atomic_width: Some(64),
2020
mcount: "\u{1}__gnu_mcount_nc".into(),
2121
llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),

compiler/rustc_target/src/spec/targets/armv6_unknown_netbsd_eabihf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
1515
options: TargetOptions {
1616
abi: Abi::EabiHf,
1717
llvm_floatabi: Some(FloatAbi::Hard),
18-
features: "+v6,+vfp2,-d32".into(),
18+
features: "+v6,+vfp2".into(),
1919
max_atomic_width: Some(64),
2020
mcount: "__mcount".into(),
2121
..base::netbsd::opts()

compiler/rustc_target/src/spec/targets/armv7_linux_androideabi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub(crate) fn target() -> Target {
2828
options: TargetOptions {
2929
abi: Abi::Eabi,
3030
llvm_floatabi: Some(FloatAbi::Soft),
31-
features: "+v7,+thumb-mode,+thumb2,+vfp3,-d32,-neon".into(),
31+
features: "+v7,+thumb-mode,+thumb2,+vfp3d16,-neon".into(),
3232
supported_sanitizers: SanitizerSet::ADDRESS,
3333
max_atomic_width: Some(64),
3434
..base

compiler/rustc_target/src/spec/targets/armv7_unknown_freebsd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
1515
options: TargetOptions {
1616
abi: Abi::EabiHf,
1717
llvm_floatabi: Some(FloatAbi::Hard),
18-
features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
18+
features: "+v7,+vfp3d16,+thumb2,-neon".into(),
1919
max_atomic_width: Some(64),
2020
mcount: "\u{1}__gnu_mcount_nc".into(),
2121
..base::freebsd::opts()

compiler/rustc_target/src/spec/targets/armv7_unknown_linux_gnueabihf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
1919
abi: Abi::EabiHf,
2020
llvm_floatabi: Some(FloatAbi::Hard),
2121
// Info about features at https://wiki.debian.org/ArmHardFloatPort
22-
features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
22+
features: "+v7,+vfp3d16,+thumb2,-neon".into(),
2323
max_atomic_width: Some(64),
2424
mcount: "\u{1}__gnu_mcount_nc".into(),
2525
llvm_mcount_intrinsic: Some("llvm.arm.gnu.eabi.mcount".into()),

compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabihf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub(crate) fn target() -> Target {
2020
options: TargetOptions {
2121
abi: Abi::EabiHf,
2222
llvm_floatabi: Some(FloatAbi::Hard),
23-
features: "+v7,+vfp3,-d32,+thumb2,-neon".into(),
23+
features: "+v7,+vfp3d16,+thumb2,-neon".into(),
2424
max_atomic_width: Some(64),
2525
mcount: "\u{1}mcount".into(),
2626
// FIXME(compiler-team#422): musl targets should be dynamically linked by default.

0 commit comments

Comments
 (0)