about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-04-05 15:20:50 +0000
committerbors <bors@rust-lang.org>2024-04-05 15:20:50 +0000
commit1921968cc5403892739b43bdefe793a130badd15 (patch)
treef53db054de5cf0612c38d204349b32d9cfcbbe32 /compiler/rustc_trait_selection/src
parent5958f5e08fa88ee95ede8c00f1b89befe0372d54 (diff)
parent9cb517aede5500e80d25a39ba9f079dcf29fb8d4 (diff)
downloadrust-1921968cc5403892739b43bdefe793a130badd15.tar.gz
rust-1921968cc5403892739b43bdefe793a130badd15.zip
Auto merge of #123497 - GuillaumeGomez:rollup-usqb4q9, r=GuillaumeGomez
Rollup of 8 pull requests

Successful merges:

 - #122334 (Vendor rustc_codegen_gcc)
 - #122894 (Move check for error in impl header outside of reporting)
 - #123149 (Port argument-non-c-like-enum to Rust)
 - #123311 (Match ergonomics: implement "`&`pat everywhere")
 - #123350 (Actually use the inferred `ClosureKind` from signature inference in coroutine-closures)
 - #123474 (Port `run-make/issue-7349` to a codegen test)
 - #123489 (handle rustc args properly in bootstrap)
 - #123496 (ping on wf changes, remove fixme)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_trait_selection/src')
-rw-r--r--compiler/rustc_trait_selection/src/traits/specialize/mod.rs9
-rw-r--r--compiler/rustc_trait_selection/src/traits/wf.rs2
2 files changed, 5 insertions, 6 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs
index ab8d7d31e43..46a0a4eb5ef 100644
--- a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs
@@ -407,10 +407,6 @@ fn report_conflicting_impls<'tcx>(
         impl_span: Span,
         err: &mut Diag<'_, G>,
     ) {
-        if (overlap.trait_ref, overlap.self_ty).references_error() {
-            err.downgrade_to_delayed_bug();
-        }
-
         match tcx.span_of_impl(overlap.with_impl) {
             Ok(span) => {
                 err.span_label(span, "first implementation here");
@@ -463,6 +459,11 @@ fn report_conflicting_impls<'tcx>(
         )
     });
 
+    // Don't report overlap errors if the header references error
+    if let Err(err) = (overlap.trait_ref, overlap.self_ty).error_reported() {
+        return Err(err);
+    }
+
     match used_to_be_allowed {
         None => {
             let reported = if overlap.with_impl.is_local()
diff --git a/compiler/rustc_trait_selection/src/traits/wf.rs b/compiler/rustc_trait_selection/src/traits/wf.rs
index 19ca147d3ad..a44a5ae0e6b 100644
--- a/compiler/rustc_trait_selection/src/traits/wf.rs
+++ b/compiler/rustc_trait_selection/src/traits/wf.rs
@@ -714,8 +714,6 @@ impl<'a, 'tcx> TypeVisitor<TyCtxt<'tcx>> for WfPredicates<'a, 'tcx> {
                 // perfect and there may be ways to abuse the fact that we
                 // ignore requirements with escaping bound vars. That's a
                 // more general issue however.
-                //
-                // FIXME(eddyb) add the type to `walker` instead of recursing.
                 let fn_sig = tcx.fn_sig(did).instantiate(tcx, args);
                 fn_sig.output().skip_binder().visit_with(self);