about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-02-12 17:06:22 +0000
committerbors <bors@rust-lang.org>2024-02-12 17:06:22 +0000
commitb381d3ab27f788f990551100c4425bb782d26d76 (patch)
treeaea60adfd638b2a79d72d5f0a2ebb52d5d4472ab /compiler/rustc_trait_selection
parentbdc15928c8119a86d15e2946cb54851264607842 (diff)
parent8e5f722ece25a9767bde50d4ad1b7161df1ee7f9 (diff)
downloadrust-b381d3ab27f788f990551100c4425bb782d26d76.tar.gz
rust-b381d3ab27f788f990551100c4425bb782d26d76.zip
Auto merge of #120980 - matthiaskrgr:rollup-dsjsqql, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - #120765 (Reorder diagnostics API)
 - #120833 (More internal emit diagnostics cleanups)
 - #120899 (Gracefully handle non-WF alias in `assemble_alias_bound_candidates_recur`)
 - #120917 (Remove a bunch of dead parameters in functions)
 - #120928 (Add test for recently fixed issue)
 - #120933 (check_consts: fix duplicate errors, make importance consistent)
 - #120936 (improve `btree_cursors` functions documentation)
 - #120944 (Check that the ABI of the instance we are inlining is correct)
 - #120956 (Clean inlined type alias with correct param-env)
 - #120962 (Add myself to library/std review)
 - #120972 (fix ICE for deref coercions with type errors)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_trait_selection')
-rw-r--r--compiler/rustc_trait_selection/src/solve/assembly/mod.rs8
-rw-r--r--compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs6
2 files changed, 6 insertions, 8 deletions
diff --git a/compiler/rustc_trait_selection/src/solve/assembly/mod.rs b/compiler/rustc_trait_selection/src/solve/assembly/mod.rs
index 81c0cfea85a..6833d2ae330 100644
--- a/compiler/rustc_trait_selection/src/solve/assembly/mod.rs
+++ b/compiler/rustc_trait_selection/src/solve/assembly/mod.rs
@@ -15,7 +15,7 @@ use rustc_middle::ty::fast_reject::{SimplifiedType, TreatParams};
 use rustc_middle::ty::{self, Ty, TyCtxt};
 use rustc_middle::ty::{fast_reject, TypeFoldable};
 use rustc_middle::ty::{ToPredicate, TypeVisitableExt};
-use rustc_span::ErrorGuaranteed;
+use rustc_span::{ErrorGuaranteed, DUMMY_SP};
 use std::fmt::Debug;
 
 pub(super) mod structural_traits;
@@ -612,7 +612,11 @@ impl<'tcx> EvalCtxt<'_, 'tcx> {
 
             ty::Alias(kind @ (ty::Projection | ty::Opaque), alias_ty) => (kind, alias_ty),
             ty::Alias(ty::Inherent | ty::Weak, _) => {
-                unreachable!("Weak and Inherent aliases should have been normalized away already")
+                self.tcx().sess.dcx().span_delayed_bug(
+                    DUMMY_SP,
+                    format!("could not normalize {self_ty}, it is not WF"),
+                );
+                return;
             }
         };
 
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs
index 7d14395850b..05c141ab2d3 100644
--- a/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs
+++ b/compiler/rustc_trait_selection/src/traits/error_reporting/type_err_ctxt_ext.rs
@@ -615,8 +615,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
 
                         let UnsatisfiedConst(unsatisfied_const) = self
                             .maybe_add_note_for_unsatisfied_const(
-                                &obligation,
-                                trait_ref,
                                 &trait_predicate,
                                 &mut err,
                                 span,
@@ -1480,8 +1478,6 @@ pub(super) trait InferCtxtPrivExt<'tcx> {
 
     fn maybe_add_note_for_unsatisfied_const(
         &self,
-        obligation: &PredicateObligation<'tcx>,
-        trait_ref: ty::PolyTraitRef<'tcx>,
         trait_predicate: &ty::PolyTraitPredicate<'tcx>,
         err: &mut Diagnostic,
         span: Span,
@@ -3359,8 +3355,6 @@ impl<'tcx> InferCtxtPrivExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
 
     fn maybe_add_note_for_unsatisfied_const(
         &self,
-        _obligation: &PredicateObligation<'tcx>,
-        _trait_ref: ty::PolyTraitRef<'tcx>,
         _trait_predicate: &ty::PolyTraitPredicate<'tcx>,
         _err: &mut Diagnostic,
         _span: Span,