Skip to content

Commit ae3703c

Browse files
committed
Auto merge of rust-lang#133788 - matthiaskrgr:rollup-1p100a8, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang#132723 (Unify `sysroot_target_{bin,lib}dir` handling) - rust-lang#133041 (Print name of env var in `--print=deployment-target`) - rust-lang#133325 (Reimplement `~const` trait specialization) - rust-lang#133395 (Add simd_relaxed_fma intrinsic) - rust-lang#133517 (Deeply normalize when computing implied outlives bounds) - rust-lang#133785 (Add const evaluation error UI test.) r? `@ghost` `@rustbot` modify labels: rollup
2 parents efdd9e8 + 8ae1114 commit ae3703c

File tree

44 files changed

+535
-168
lines changed

Some content is hidden

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

44 files changed

+535
-168
lines changed

compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,8 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>(
415415
});
416416
}
417417

418-
sym::simd_fma => {
418+
// FIXME: simd_relaxed_fma doesn't relax to non-fused multiply-add
419+
sym::simd_fma | sym::simd_relaxed_fma => {
419420
intrinsic_args!(fx, args => (a, b, c); intrinsic);
420421

421422
if !a.layout().ty.is_simd() {

compiler/rustc_codegen_gcc/src/intrinsic/simd.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,7 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>(
772772
sym::simd_flog => "log",
773773
sym::simd_floor => "floor",
774774
sym::simd_fma => "fma",
775+
sym::simd_relaxed_fma => "fma", // FIXME: this should relax to non-fused multiply-add when necessary
775776
sym::simd_fpowi => "__builtin_powi",
776777
sym::simd_fpow => "pow",
777778
sym::simd_fsin => "sin",

compiler/rustc_codegen_llvm/src/intrinsic.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,6 +1534,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
15341534
sym::simd_flog => ("log", bx.type_func(&[vec_ty], vec_ty)),
15351535
sym::simd_floor => ("floor", bx.type_func(&[vec_ty], vec_ty)),
15361536
sym::simd_fma => ("fma", bx.type_func(&[vec_ty, vec_ty, vec_ty], vec_ty)),
1537+
sym::simd_relaxed_fma => ("fmuladd", bx.type_func(&[vec_ty, vec_ty, vec_ty], vec_ty)),
15371538
sym::simd_fpowi => ("powi", bx.type_func(&[vec_ty, bx.type_i32()], vec_ty)),
15381539
sym::simd_fpow => ("pow", bx.type_func(&[vec_ty, vec_ty], vec_ty)),
15391540
sym::simd_fsin => ("sin", bx.type_func(&[vec_ty], vec_ty)),
@@ -1572,6 +1573,7 @@ fn generic_simd_intrinsic<'ll, 'tcx>(
15721573
| sym::simd_fpowi
15731574
| sym::simd_fsin
15741575
| sym::simd_fsqrt
1576+
| sym::simd_relaxed_fma
15751577
| sym::simd_round
15761578
| sym::simd_trunc
15771579
) {

compiler/rustc_codegen_ssa/src/back/apple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ fn minimum_deployment_target(target: &Target) -> OSVersion {
9797
}
9898

9999
/// Name of the environment variable used to fetch the deployment target on the given OS.
100-
fn deployment_target_env_var(os: &str) -> &'static str {
100+
pub fn deployment_target_env_var(os: &str) -> &'static str {
101101
match os {
102102
"macos" => "MACOSX_DEPLOYMENT_TARGET",
103103
"ios" => "IPHONEOS_DEPLOYMENT_TARGET",

compiler/rustc_data_structures/src/obligation_forest/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,10 @@ impl<O: ForestObligation> ObligationForest<O> {
415415
.collect()
416416
}
417417

418+
pub fn has_pending_obligations(&self) -> bool {
419+
self.nodes.iter().any(|node| node.state.get() == NodeState::Pending)
420+
}
421+
418422
fn insert_into_error_cache(&mut self, index: usize) {
419423
let node = &self.nodes[index];
420424
self.error_cache

compiler/rustc_driver_impl/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -867,8 +867,9 @@ fn print_crate_info(
867867
DeploymentTarget => {
868868
if sess.target.is_like_osx {
869869
println_info!(
870-
"deployment_target={}",
871-
apple::pretty_version(apple::deployment_target(sess))
870+
"{}={}",
871+
apple::deployment_target_env_var(&sess.target.os),
872+
apple::pretty_version(apple::deployment_target(sess)),
872873
)
873874
} else {
874875
#[allow(rustc::diagnostic_outside_of_impl)]

compiler/rustc_hir_analysis/messages.ftl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,6 @@ hir_analysis_const_param_ty_impl_on_unsized =
113113
the trait `ConstParamTy` may not be implemented for this type
114114
.label = type is not `Sized`
115115
116-
hir_analysis_const_specialize = cannot specialize on const impl with non-const impl
117-
118116
hir_analysis_copy_impl_on_non_adt =
119117
the trait `Copy` cannot be implemented for this type
120118
.label = type is not a structure or enumeration

compiler/rustc_hir_analysis/src/check/intrinsic.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,9 @@ pub fn check_intrinsic_type(
641641
| sym::simd_round
642642
| sym::simd_trunc => (1, 0, vec![param(0)], param(0)),
643643
sym::simd_fpowi => (1, 0, vec![param(0), tcx.types.i32], param(0)),
644-
sym::simd_fma => (1, 0, vec![param(0), param(0), param(0)], param(0)),
644+
sym::simd_fma | sym::simd_relaxed_fma => {
645+
(1, 0, vec![param(0), param(0), param(0)], param(0))
646+
}
645647
sym::simd_gather => (3, 0, vec![param(0), param(1), param(2)], param(0)),
646648
sym::simd_masked_load => (3, 0, vec![param(0), param(1), param(2)], param(2)),
647649
sym::simd_masked_store => (3, 0, vec![param(0), param(1), param(2)], tcx.types.unit),

compiler/rustc_hir_analysis/src/check/wfcheck.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,12 @@ where
117117
}
118118
f(&mut wfcx)?;
119119

120-
let assumed_wf_types = wfcx.ocx.assumed_wf_types_and_report_errors(param_env, body_def_id)?;
121-
122120
let errors = wfcx.select_all_or_error();
123121
if !errors.is_empty() {
124122
return Err(infcx.err_ctxt().report_fulfillment_errors(errors));
125123
}
126124

125+
let assumed_wf_types = wfcx.ocx.assumed_wf_types_and_report_errors(param_env, body_def_id)?;
127126
debug!(?assumed_wf_types);
128127

129128
let infcx_compat = infcx.fork();

compiler/rustc_hir_analysis/src/errors.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,13 +1079,6 @@ pub(crate) struct EmptySpecialization {
10791079
pub base_impl_span: Span,
10801080
}
10811081

1082-
#[derive(Diagnostic)]
1083-
#[diag(hir_analysis_const_specialize)]
1084-
pub(crate) struct ConstSpecialize {
1085-
#[primary_span]
1086-
pub span: Span,
1087-
}
1088-
10891082
#[derive(Diagnostic)]
10901083
#[diag(hir_analysis_static_specialize)]
10911084
pub(crate) struct StaticSpecialize {

0 commit comments

Comments
 (0)