Skip to content

Commit cf7da0b

Browse files
committed
Auto merge of #154573 - jhpratt:rollup-ABgmddY, r=jhpratt
Rollup of 4 pull requests Successful merges: - #154548 (Add regression test for TransmuteFrom ICE with min_generic_const_args) - #154563 (Point at binop lhs and rhs when expression is multiline) - #154564 (Tweak wording of E0275 WF errors) - #154566 (loongarch: use "_mcount" as the default mcount symbol)
2 parents 4cf5f95 + 89eb329 commit cf7da0b

27 files changed

Lines changed: 95 additions & 30 deletions

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub(crate) fn target() -> Target {
2222
linker: Some("rust-lld".into()),
2323
llvm_abiname: LlvmAbi::Ilp32d,
2424
max_atomic_width: Some(32),
25+
mcount: "_mcount".into(),
2526
relocation_model: RelocModel::Static,
2627
panic_strategy: PanicStrategy::Abort,
2728
..Default::default()

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub(crate) fn target() -> Target {
2323
linker: Some("rust-lld".into()),
2424
llvm_abiname: LlvmAbi::Ilp32s,
2525
max_atomic_width: Some(32),
26+
mcount: "_mcount".into(),
2627
relocation_model: RelocModel::Static,
2728
panic_strategy: PanicStrategy::Abort,
2829
..Default::default()

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub(crate) fn target() -> Target {
2020
features: "+f,+d,+lsx,+relax".into(),
2121
llvm_abiname: LlvmAbi::Lp64d,
2222
max_atomic_width: Some(64),
23+
mcount: "_mcount".into(),
2324
supported_sanitizers: SanitizerSet::ADDRESS
2425
| SanitizerSet::CFI
2526
| SanitizerSet::LEAK

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub(crate) fn target() -> Target {
2020
features: "+f,+d,+lsx,+relax".into(),
2121
llvm_abiname: LlvmAbi::Lp64d,
2222
max_atomic_width: Some(64),
23+
mcount: "_mcount".into(),
2324
crt_static_default: false,
2425
supported_sanitizers: SanitizerSet::ADDRESS
2526
| SanitizerSet::CFI

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pub(crate) fn target() -> Target {
2020
features: "+f,+d,+lsx,+relax".into(),
2121
llvm_abiname: LlvmAbi::Lp64d,
2222
max_atomic_width: Some(64),
23+
mcount: "_mcount".into(),
2324
supported_sanitizers: SanitizerSet::ADDRESS
2425
| SanitizerSet::CFI
2526
| SanitizerSet::LEAK

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ pub(crate) fn target() -> Target {
2222
linker: Some("rust-lld".into()),
2323
llvm_abiname: LlvmAbi::Lp64d,
2424
max_atomic_width: Some(64),
25+
mcount: "_mcount".into(),
2526
relocation_model: RelocModel::Static,
2627
panic_strategy: PanicStrategy::Abort,
2728
code_model: Some(CodeModel::Medium),

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub(crate) fn target() -> Target {
2323
linker: Some("rust-lld".into()),
2424
llvm_abiname: LlvmAbi::Lp64s,
2525
max_atomic_width: Some(64),
26+
mcount: "_mcount".into(),
2627
relocation_model: RelocModel::Static,
2728
panic_strategy: PanicStrategy::Abort,
2829
code_model: Some(CodeModel::Medium),

compiler/rustc_trait_selection/src/error_reporting/traits/overflow.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
9999
"overflow assigning `{a}` to `{b}`",
100100
)
101101
}
102+
ty::PredicateKind::Clause(ty::ClauseKind::WellFormed(term)) => {
103+
let term = with_short_path(self.tcx, term);
104+
struct_span_code_err!(
105+
self.dcx(),
106+
span,
107+
E0275,
108+
"overflow evaluating whether `{term}` is well-formed",
109+
)
110+
}
102111
_ => {
103112
let pred_str = with_short_path(self.tcx, predicate);
104113
struct_span_code_err!(

compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2915,12 +2915,21 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
29152915
| ObligationCauseCode::CheckAssociatedTypeBounds { .. }
29162916
| ObligationCauseCode::LetElse
29172917
| ObligationCauseCode::UnOp { .. }
2918-
| ObligationCauseCode::BinOp { .. }
29192918
| ObligationCauseCode::AscribeUserTypeProvePredicate(..)
29202919
| ObligationCauseCode::AlwaysApplicableImpl
29212920
| ObligationCauseCode::ConstParam(_)
29222921
| ObligationCauseCode::ReferenceOutlivesReferent(..)
29232922
| ObligationCauseCode::ObjectTypeBound(..) => {}
2923+
ObligationCauseCode::BinOp { lhs_hir_id, rhs_hir_id, .. } => {
2924+
if let hir::Node::Expr(lhs) = tcx.hir_node(lhs_hir_id)
2925+
&& let hir::Node::Expr(rhs) = tcx.hir_node(rhs_hir_id)
2926+
&& tcx.sess.source_map().lookup_char_pos(lhs.span.lo()).line
2927+
!= tcx.sess.source_map().lookup_char_pos(rhs.span.hi()).line
2928+
{
2929+
err.span_label(lhs.span, "");
2930+
err.span_label(rhs.span, "");
2931+
}
2932+
}
29242933
ObligationCauseCode::RustCall => {
29252934
if let Some(pred) = predicate.as_trait_clause()
29262935
&& tcx.is_lang_item(pred.def_id(), LangItem::Sized)

tests/ui/associated-types/issue-64855-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
// also inadvertently a test for the (non-)co-inductiveness of WF predicates.
44

55
pub struct Bar<'a>(&'a Self) where Self: ;
6-
//~^ ERROR overflow evaluating the requirement `Bar<'a> well-formed`
6+
//~^ ERROR overflow evaluating whether `Bar<'a>` is well-formed
77

88
fn main() {}

0 commit comments

Comments
 (0)