about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-10-25 19:29:58 +0000
committerbors <bors@rust-lang.org>2023-10-25 19:29:58 +0000
commitab5c841a1f3c09edc5ea07722519627c960aed17 (patch)
tree0d4c4f6e16659ad8bba579c4b446c9b9a3b3566d
parentcf226e93dcb0e21e2daa7c26aca0c5b46ff1b646 (diff)
parentb0521fe88e05dfc2776ebb5b98931b2373910629 (diff)
downloadrust-ab5c841a1f3c09edc5ea07722519627c960aed17.tar.gz
rust-ab5c841a1f3c09edc5ea07722519627c960aed17.zip
Auto merge of #117180 - matthiaskrgr:rollup-rxhl6ep, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #117111 (Remove support for alias `-Z instrument-coverage`)
 - #117141 (Require target features to match exactly during inlining)
 - #117152 (Fix unwrap suggestion for async fn)
 - #117154 (implement C ABI lowering for CSKY)
 - #117159 (Work around the fact that `check_mod_type_wf` may spuriously return `ErrorGuaranteed`)
 - #117163 (compiletest: Display compilation errors in mir-opt tests)
 - #117173 (Make `Iterator` a lang item)

r? `@ghost`
`@rustbot` modify labels: rollup
-rw-r--r--compiler/rustc_hir/src/lang_items.rs1
-rw-r--r--compiler/rustc_hir_analysis/src/check/check.rs6
-rw-r--r--compiler/rustc_hir_analysis/src/lib.rs8
-rw-r--r--compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs22
-rw-r--r--compiler/rustc_interface/src/passes.rs5
-rw-r--r--compiler/rustc_interface/src/tests.rs1
-rw-r--r--compiler/rustc_mir_transform/src/inline.rs6
-rw-r--r--compiler/rustc_session/src/config.rs39
-rw-r--r--compiler/rustc_session/src/options.rs10
-rw-r--r--compiler/rustc_span/src/symbol.rs1
-rw-r--r--compiler/rustc_target/src/abi/call/csky.rs38
-rw-r--r--library/core/src/iter/traits/iterator.rs1
-rw-r--r--src/doc/rustc/src/platform-support/csky-unknown-linux-gnuabiv2.md10
-rw-r--r--src/tools/clippy/tests/ui/crashes/ice-6252.stderr14
-rw-r--r--src/tools/compiletest/src/runtest.rs2
-rw-r--r--tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.panic-abort.diff21
-rw-r--r--tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.panic-unwind.diff21
-rw-r--r--tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.panic-abort.diff21
-rw-r--r--tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.panic-unwind.diff21
-rw-r--r--tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.panic-abort.diff22
-rw-r--r--tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.panic-unwind.diff22
-rw-r--r--tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.panic-abort.diff19
-rw-r--r--tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.panic-unwind.diff19
-rw-r--r--tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.panic-abort.diff19
-rw-r--r--tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.panic-unwind.diff19
-rw-r--r--tests/mir-opt/inline/inline_compatibility.rs64
-rw-r--r--tests/ui/associated-consts/issue-105330.rs1
-rw-r--r--tests/ui/associated-consts/issue-105330.stderr12
-rw-r--r--tests/ui/associated-inherent-types/generic-associated-types-bad.item.stderr14
-rw-r--r--tests/ui/associated-inherent-types/generic-associated-types-bad.local.stderr2
-rw-r--r--tests/ui/associated-inherent-types/generic-associated-types-bad.region.stderr2
-rw-r--r--tests/ui/associated-inherent-types/generic-associated-types-bad.rs1
-rw-r--r--tests/ui/associated-types/associated-types-no-suitable-supertrait.rs1
-rw-r--r--tests/ui/associated-types/associated-types-no-suitable-supertrait.stderr14
-rw-r--r--tests/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs1
-rw-r--r--tests/ui/coherence/coherence-impl-trait-for-trait-object-safe.stderr13
-rw-r--r--tests/ui/const-generics/generic_const_exprs/type_mismatch.rs13
-rw-r--r--tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr12
-rw-r--r--tests/ui/consts/const-unsized.rs4
-rw-r--r--tests/ui/consts/const-unsized.stderr44
-rw-r--r--tests/ui/generic-associated-types/issue-84931.rs3
-rw-r--r--tests/ui/generic-associated-types/issue-84931.stderr24
-rw-r--r--tests/ui/generic-associated-types/unsatisfied-item-lifetime-bound.rs1
-rw-r--r--tests/ui/generic-associated-types/unsatisfied-item-lifetime-bound.stderr34
-rw-r--r--tests/ui/instrument-coverage/except-unused-functions.rs3
-rw-r--r--tests/ui/instrument-coverage/except-unused-generics.rs3
-rw-r--r--tests/ui/instrument-coverage/unstable.branch.stderr (renamed from tests/ui/instrument-coverage/except-unused-functions.stderr)0
-rw-r--r--tests/ui/instrument-coverage/unstable.except-unused-functions.stderr (renamed from tests/ui/instrument-coverage/except-unused-generics.stderr)0
-rw-r--r--tests/ui/instrument-coverage/unstable.except-unused-generics.stderr2
-rw-r--r--tests/ui/instrument-coverage/unstable.rs6
-rw-r--r--tests/ui/issues/issue-19380.rs1
-rw-r--r--tests/ui/issues/issue-19380.stderr25
-rw-r--r--tests/ui/issues/issue-24446.rs2
-rw-r--r--tests/ui/issues/issue-24446.stderr37
-rw-r--r--tests/ui/issues/issue-77919.rs1
-rw-r--r--tests/ui/issues/issue-77919.stderr14
-rw-r--r--tests/ui/layout/issue-84108.rs2
-rw-r--r--tests/ui/layout/issue-84108.stderr24
-rw-r--r--tests/ui/mismatched_types/async-unwrap-suggestion.rs22
-rw-r--r--tests/ui/mismatched_types/async-unwrap-suggestion.stderr25
-rw-r--r--tests/ui/proc-macro/bad-projection.rs2
-rw-r--r--tests/ui/proc-macro/bad-projection.stderr30
-rw-r--r--tests/ui/simd/array-trait.rs1
-rw-r--r--tests/ui/simd/array-trait.stderr9
-rw-r--r--tests/ui/specialization/min_specialization/issue-79224.rs1
-rw-r--r--tests/ui/specialization/min_specialization/issue-79224.stderr14
-rw-r--r--tests/ui/traits/bound/on-structs-and-enums-static.rs2
-rw-r--r--tests/ui/traits/bound/on-structs-and-enums-static.stderr19
-rw-r--r--tests/ui/traits/new-solver/specialization-transmute.rs2
-rw-r--r--tests/ui/traits/new-solver/specialization-transmute.stderr11
-rw-r--r--tests/ui/type-alias-impl-trait/generic_underconstrained.rs1
-rw-r--r--tests/ui/type-alias-impl-trait/generic_underconstrained.stderr23
-rw-r--r--tests/ui/type-alias-impl-trait/generic_underconstrained2.rs2
-rw-r--r--tests/ui/type-alias-impl-trait/generic_underconstrained2.stderr48
-rw-r--r--tests/ui/ufcs/ufcs-explicit-self-bad.rs1
-rw-r--r--tests/ui/ufcs/ufcs-explicit-self-bad.stderr31
-rw-r--r--tests/ui/union/issue-81199.rs1
-rw-r--r--tests/ui/union/issue-81199.stderr19
-rw-r--r--tests/ui/union/union-unsized.mirunsafeck.stderr31
-rw-r--r--tests/ui/union/union-unsized.rs2
-rw-r--r--tests/ui/union/union-unsized.thirunsafeck.stderr31
-rw-r--r--tests/ui/unsized/unsized-trait-impl-self-type.rs1
-rw-r--r--tests/ui/unsized/unsized-trait-impl-self-type.stderr14
-rw-r--r--tests/ui/unsized/unsized-trait-impl-trait-arg.rs1
-rw-r--r--tests/ui/unsized/unsized-trait-impl-trait-arg.stderr14
-rw-r--r--tests/ui/unsized/unsized7.rs1
-rw-r--r--tests/ui/unsized/unsized7.stderr14
-rw-r--r--tests/ui/wf/hir-wf-check-erase-regions.rs1
-rw-r--r--tests/ui/wf/hir-wf-check-erase-regions.stderr16
-rw-r--r--tests/ui/wf/issue-110157.rs1
-rw-r--r--tests/ui/wf/issue-110157.stderr25
-rw-r--r--tests/ui/wf/wf-const-type.rs1
-rw-r--r--tests/ui/wf/wf-const-type.stderr20
-rw-r--r--tests/ui/wf/wf-static-type.rs1
-rw-r--r--tests/ui/wf/wf-static-type.stderr20
95 files changed, 834 insertions, 372 deletions
diff --git a/compiler/rustc_hir/src/lang_items.rs b/compiler/rustc_hir/src/lang_items.rs
index cdfc67d5740..c8ac95e2994 100644
--- a/compiler/rustc_hir/src/lang_items.rs
+++ b/compiler/rustc_hir/src/lang_items.rs
@@ -210,6 +210,7 @@ language_item_table! {
 
     FnOnceOutput,            sym::fn_once_output,      fn_once_output,             Target::AssocTy,        GenericRequirement::None;
 
+    Iterator,                sym::iterator,            iterator_trait,             Target::Trait,          GenericRequirement::Exact(0);
     Future,                  sym::future_trait,        future_trait,               Target::Trait,          GenericRequirement::Exact(0);
     CoroutineState,          sym::coroutine_state,     gen_state,                  Target::Enum,           GenericRequirement::None;
     Coroutine,               sym::coroutine,           gen_trait,                  Target::Trait,          GenericRequirement::Minimum(1);
diff --git a/compiler/rustc_hir_analysis/src/check/check.rs b/compiler/rustc_hir_analysis/src/check/check.rs
index 360d31b863c..e61ca232de6 100644
--- a/compiler/rustc_hir_analysis/src/check/check.rs
+++ b/compiler/rustc_hir_analysis/src/check/check.rs
@@ -128,7 +128,11 @@ fn check_union_fields(tcx: TyCtxt<'_>, span: Span, item_def_id: LocalDefId) -> b
 
         let param_env = tcx.param_env(item_def_id);
         for field in &def.non_enum_variant().fields {
-            let field_ty = tcx.normalize_erasing_regions(param_env, field.ty(tcx, args));
+            let Ok(field_ty) = tcx.try_normalize_erasing_regions(param_env, field.ty(tcx, args))
+            else {
+                tcx.sess.delay_span_bug(span, "could not normalize field type");
+                continue;
+            };
 
             if !allowed_union_field(field_ty, tcx, param_env) {
                 let (field_span, ty_span) = match tcx.hir().get_if_local(field.did) {
diff --git a/compiler/rustc_hir_analysis/src/lib.rs b/compiler/rustc_hir_analysis/src/lib.rs
index f27ce7fa0e0..2b8219c01c7 100644
--- a/compiler/rustc_hir_analysis/src/lib.rs
+++ b/compiler/rustc_hir_analysis/src/lib.rs
@@ -202,15 +202,19 @@ pub fn check_crate(tcx: TyCtxt<'_>) -> Result<(), ErrorGuaranteed> {
         })?;
     }
 
-    tcx.sess.time("wf_checking", || {
+    let errs = tcx.sess.time("wf_checking", || {
         tcx.hir().try_par_for_each_module(|module| tcx.ensure().check_mod_type_wf(module))
-    })?;
+    });
 
     // NOTE: This is copy/pasted in librustdoc/core.rs and should be kept in sync.
     tcx.sess.time("item_types_checking", || {
         tcx.hir().for_each_module(|module| tcx.ensure().check_mod_item_types(module))
     });
 
+    // HACK: `check_mod_type_wf` may spuriously emit errors due to `delay_span_bug`, even if those errors
+    // only actually get emitted in `check_mod_item_types`.
+    errs?;
+
     if tcx.features().rustc_attrs {
         tcx.sess.track_errors(|| collect::test_opaque_hidden_types(tcx))?;
     }
diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs
index 13aa6454bc3..e1dbf37743f 100644
--- a/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs
+++ b/compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs
@@ -1747,19 +1747,17 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
         expected: Ty<'tcx>,
         found: Ty<'tcx>,
     ) -> bool {
-        let ty::Adt(adt, args) = found.kind() else { return false };
+        let ty::Adt(adt, args) = found.kind() else {
+            return false;
+        };
         let ret_ty_matches = |diagnostic_item| {
-            if let Some(ret_ty) = self
-                    .ret_coercion
-                    .as_ref()
-                    .map(|c| self.resolve_vars_if_possible(c.borrow().expected_ty()))
-                    && let ty::Adt(kind, _) = ret_ty.kind()
-                    && self.tcx.get_diagnostic_item(diagnostic_item) == Some(kind.did())
-                {
-                    true
-                } else {
-                    false
-                }
+            let Some(sig) = self.body_fn_sig() else {
+                return false;
+            };
+            let ty::Adt(kind, _) = sig.output().kind() else {
+                return false;
+            };
+            self.tcx.is_diagnostic_item(diagnostic_item, kind.did())
         };
 
         // don't suggest anything like `Ok(ok_val).unwrap()` , `Some(some_val).unwrap()`,
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index 998e2686005..884afae23d8 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -856,6 +856,11 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
         // This check has to be run after all lints are done processing. We don't
         // define a lint filter, as all lint checks should have finished at this point.
         sess.time("check_lint_expectations", || tcx.ensure().check_expectations(None));
+
+        // This query is only invoked normally if a diagnostic is emitted that needs any
+        // diagnostic item. If the crate compiles without checking any diagnostic items,
+        // we will fail to emit overlap diagnostics. Thus we invoke it here unconditionally.
+        let _ = tcx.all_diagnostic_items(());
     });
 
     if sess.opts.unstable_opts.print_vtable_sizes {
diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs
index ec4fd78994e..657bce7384b 100644
--- a/compiler/rustc_interface/src/tests.rs
+++ b/compiler/rustc_interface/src/tests.rs
@@ -789,7 +789,6 @@ fn test_unstable_options_tracking_hash() {
     tracked!(inline_mir, Some(true));
     tracked!(inline_mir_hint_threshold, Some(123));
     tracked!(inline_mir_threshold, Some(123));
-    tracked!(instrument_coverage, Some(InstrumentCoverage::All));
     tracked!(instrument_mcount, true);
     tracked!(instrument_xray, Some(InstrumentXRay::default()));
     tracked!(link_directives, false);
diff --git a/compiler/rustc_mir_transform/src/inline.rs b/compiler/rustc_mir_transform/src/inline.rs
index 8b33e00c63c..277060573bc 100644
--- a/compiler/rustc_mir_transform/src/inline.rs
+++ b/compiler/rustc_mir_transform/src/inline.rs
@@ -438,10 +438,8 @@ impl<'tcx> Inliner<'tcx> {
             return Err("incompatible instruction set");
         }
 
-        for feature in &callee_attrs.target_features {
-            if !self.codegen_fn_attrs.target_features.contains(feature) {
-                return Err("incompatible target feature");
-            }
+        if callee_attrs.target_features != self.codegen_fn_attrs.target_features {
+            return Err("incompatible target features");
         }
 
         Ok(())
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs
index 84933588f17..78e410488c3 100644
--- a/compiler/rustc_session/src/config.rs
+++ b/compiler/rustc_session/src/config.rs
@@ -2739,29 +2739,24 @@ pub fn build_session_options(
         _ => {}
     }
 
-    // Handle both `-Z instrument-coverage` and `-C instrument-coverage`; the latter takes
-    // precedence.
-    match (cg.instrument_coverage, unstable_opts.instrument_coverage) {
-        (Some(ic_c), Some(ic_z)) if ic_c != ic_z => {
-            handler.early_error(
-                "incompatible values passed for `-C instrument-coverage` \
-                and `-Z instrument-coverage`",
-            );
-        }
-        (Some(InstrumentCoverage::Off | InstrumentCoverage::All), _) => {}
-        (Some(_), _) if !unstable_opts.unstable_options => {
-            handler.early_error(
-                "`-C instrument-coverage=branch` and `-C instrument-coverage=except-*` \
-                require `-Z unstable-options`",
-            );
-        }
-        (None, None) => {}
-        (None, ic) => {
-            handler
-                .early_warn("`-Z instrument-coverage` is deprecated; use `-C instrument-coverage`");
-            cg.instrument_coverage = ic;
+    // Check for unstable values of `-C instrument-coverage`.
+    // This is what prevents them from being used on stable compilers.
+    match cg.instrument_coverage {
+        // Stable values:
+        Some(InstrumentCoverage::All | InstrumentCoverage::Off) | None => {}
+        // Unstable values:
+        Some(
+            InstrumentCoverage::Branch
+            | InstrumentCoverage::ExceptUnusedFunctions
+            | InstrumentCoverage::ExceptUnusedGenerics,
+        ) => {
+            if !unstable_opts.unstable_options {
+                handler.early_error(
+                    "`-C instrument-coverage=branch` and `-C instrument-coverage=except-*` \
+                    require `-Z unstable-options`",
+                );
+            }
         }
-        _ => {}
     }
 
     if cg.instrument_coverage.is_some() && cg.instrument_coverage != Some(InstrumentCoverage::Off) {
diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs
index 77aaf951f0d..35c167837e5 100644
--- a/compiler/rustc_session/src/options.rs
+++ b/compiler/rustc_session/src/options.rs
@@ -1593,16 +1593,6 @@ options! {
         "a default MIR inlining threshold (default: 50)"),
     input_stats: bool = (false, parse_bool, [UNTRACKED],
         "gather statistics about the input (default: no)"),
-    #[rustc_lint_opt_deny_field_access("use `Session::instrument_coverage` instead of this field")]
-    instrument_coverage: Option<InstrumentCoverage> = (None, parse_instrument_coverage, [TRACKED],
-        "instrument the generated code to support LLVM source-based code coverage \
-        reports (note, the compiler build config must include `profiler = true`); \
-        implies `-C symbol-mangling-version=v0`. Optional values are:
-        `=all` (implicit value)
-        `=branch`
-        `=except-unused-generics`
-        `=except-unused-functions`
-        `=off` (default)"),
     instrument_mcount: bool = (false, parse_bool, [TRACKED],
         "insert function instrument code for mcount-based tracing (default: no)"),
     instrument_xray: Option<InstrumentXRay> = (None, parse_instrument_xray, [TRACKED],
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index d3205f8eca1..ff61143a12b 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -910,6 +910,7 @@ symbols! {
         iter,
         iter_mut,
         iter_repeat,
+        iterator,
         iterator_collect_fn,
         kcfi,
         keyword,
diff --git a/compiler/rustc_target/src/abi/call/csky.rs b/compiler/rustc_target/src/abi/call/csky.rs
index bbe95fa20ac..706493b0a6a 100644
--- a/compiler/rustc_target/src/abi/call/csky.rs
+++ b/compiler/rustc_target/src/abi/call/csky.rs
@@ -1,17 +1,39 @@
-// See https://github.com/llvm/llvm-project/blob/d85b94bf0080dcd780656c0f5e6342800720eba9/llvm/lib/Target/CSKY/CSKYCallingConv.td
-use crate::abi::call::{ArgAbi, FnAbi};
+// Reference: CSKY ABI Manual
+// https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1695027452256/T-HEAD_800_Series_ABI_Standards_Manual.pdf
+//
+// Reference: Clang CSKY lowering code
+// https://github.com/llvm/llvm-project/blob/4a074f32a6914f2a8d7215d78758c24942dddc3d/clang/lib/CodeGen/Targets/CSKY.cpp#L76-L162
 
-fn classify_ret<Ty>(ret: &mut ArgAbi<'_, Ty>) {
-    if ret.layout.is_aggregate() || ret.layout.size.bits() > 64 {
-        ret.make_indirect();
+use crate::abi::call::{ArgAbi, FnAbi, Reg, Uniform};
+
+fn classify_ret<Ty>(arg: &mut ArgAbi<'_, Ty>) {
+    // For return type, aggregate which <= 2*XLen will be returned in registers.
+    // Otherwise, aggregate will be returned indirectly.
+    if arg.layout.is_aggregate() {
+        let total = arg.layout.size;
+        if total.bits() > 64 {
+            arg.make_indirect();
+        } else if total.bits() > 32 {
+            arg.cast_to(Uniform { unit: Reg::i32(), total });
+        } else {
+            arg.cast_to(Reg::i32());
+        }
     } else {
-        ret.extend_integer_width_to(32);
+        arg.extend_integer_width_to(32);
     }
 }
 
 fn classify_arg<Ty>(arg: &mut ArgAbi<'_, Ty>) {
-    if arg.layout.is_aggregate() || arg.layout.size.bits() > 64 {
-        arg.make_indirect();
+    // For argument type, the first 4*XLen parts of aggregate will be passed
+    // in registers, and the rest will be passed in stack.
+    // So we can coerce to integers directly and let backend handle it correctly.
+    if arg.layout.is_aggregate() {
+        let total = arg.layout.size;
+        if total.bits() > 32 {
+            arg.cast_to(Uniform { unit: Reg::i32(), total });
+        } else {
+            arg.cast_to(Reg::i32());
+        }
     } else {
         arg.extend_integer_width_to(32);
     }
diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs
index c7ace58afa8..166d04e078d 100644
--- a/library/core/src/iter/traits/iterator.rs
+++ b/library/core/src/iter/traits/iterator.rs
@@ -69,6 +69,7 @@ fn _assert_is_object_safe(_: &dyn Iterator<Item = ()>) {}
     message = "`{Self}` is not an iterator"
 )]
 #[doc(notable_trait)]
+#[cfg_attr(not(bootstrap), lang = "iterator")]
 #[rustc_diagnostic_item = "Iterator"]
 #[must_use = "iterators are lazy and do nothing unless consumed"]
 pub trait Iterator {
diff --git a/src/doc/rustc/src/platform-support/csky-unknown-linux-gnuabiv2.md b/src/doc/rustc/src/platform-support/csky-unknown-linux-gnuabiv2.md
index 57c717c182d..a54abcb606e 100644
--- a/src/doc/rustc/src/platform-support/csky-unknown-linux-gnuabiv2.md
+++ b/src/doc/rustc/src/platform-support/csky-unknown-linux-gnuabiv2.md
@@ -10,9 +10,15 @@ target | std | host | notes
 `csky-unknown-linux-gnuabiv2hf` | ✓ |  | C-SKY abiv2 Linux, hardfloat (little endian)
 
 Reference:
-https://c-sky.github.io/
 
-https://gitlab.com/c-sky/
+- [CSKY ABI Manual](https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1695027452256/T-HEAD_800_Series_ABI_Standards_Manual.pdf)
+- [csky-linux-gnuabiv2-toolchain](https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource/1356021/1619528643136/csky-linux-gnuabiv2-tools-x86_64-glibc-linux-4.9.56-20210423.tar.gz)
+- [csky-linux-gnuabiv2-qemu](https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1689324918932/xuantie-qemu-x86_64-Ubuntu-18.04-20230714-0202.tar.gz)
+
+other links:
+
+- https://c-sky.github.io/
+- https://gitlab.com/c-sky/
 
 ## Target maintainers
 
diff --git a/src/tools/clippy/tests/ui/crashes/ice-6252.stderr b/src/tools/clippy/tests/ui/crashes/ice-6252.stderr
index 30be9dde73c..f929bec9583 100644
--- a/src/tools/clippy/tests/ui/crashes/ice-6252.stderr
+++ b/src/tools/clippy/tests/ui/crashes/ice-6252.stderr
@@ -24,6 +24,16 @@ help: you might be missing a type parameter
 LL | impl<N, M, VAL> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
    |          +++++
 
-error: aborting due to 2 previous errors
+error[E0046]: not all trait items implemented, missing: `VAL`
+  --> $DIR/ice-6252.rs:11:1
+   |
+LL |     const VAL: T;
+   |     ------------ `VAL` from trait
+...
+LL | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `VAL` in implementation
+
+error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0412`.
+Some errors have detailed explanations: E0046, E0412.
+For more information about an error, try `rustc --explain E0046`.
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index ac270a1f0ba..87d0404e7d8 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -3999,10 +3999,10 @@ impl<'test> TestCx<'test> {
         let passes = std::mem::take(&mut test_info.passes);
 
         let proc_res = self.compile_test_with_passes(should_run, Emit::Mir, passes);
-        self.check_mir_dump(test_info);
         if !proc_res.status.success() {
             self.fatal_proc_rec("compilation failed!", &proc_res);
         }
+        self.check_mir_dump(test_info);
 
         if let WillExecute::Yes = should_run {
             let proc_res = self.exec_compiled_test();
diff --git a/tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.panic-abort.diff
deleted file mode 100644
index eac51000cac..00000000000
--- a/tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.panic-abort.diff
+++ /dev/null
@@ -1,21 +0,0 @@
-- // MIR for `inlined_no_sanitize` before Inline
-+ // MIR for `inlined_no_sanitize` after Inline
-  
-  fn inlined_no_sanitize() -> () {
-      let mut _0: ();
-      let _1: ();
-+     scope 1 (inlined no_sanitize) {
-+     }
-  
-      bb0: {
-          StorageLive(_1);
--         _1 = no_sanitize() -> [return: bb1, unwind unreachable];
--     }
-- 
--     bb1: {
-          StorageDead(_1);
-          _0 = const ();
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.panic-unwind.diff
deleted file mode 100644
index eba5ad9cf26..00000000000
--- a/tests/mir-opt/inline/inline_compatibility.inlined_no_sanitize.Inline.panic-unwind.diff
+++ /dev/null
@@ -1,21 +0,0 @@
-- // MIR for `inlined_no_sanitize` before Inline
-+ // MIR for `inlined_no_sanitize` after Inline
-  
-  fn inlined_no_sanitize() -> () {
-      let mut _0: ();
-      let _1: ();
-+     scope 1 (inlined no_sanitize) {
-+     }
-  
-      bb0: {
-          StorageLive(_1);
--         _1 = no_sanitize() -> [return: bb1, unwind continue];
--     }
-- 
--     bb1: {
-          StorageDead(_1);
-          _0 = const ();
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.panic-abort.diff
deleted file mode 100644
index c2a81b9804e..00000000000
--- a/tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.panic-abort.diff
+++ /dev/null
@@ -1,21 +0,0 @@
-- // MIR for `inlined_target_feature` before Inline
-+ // MIR for `inlined_target_feature` after Inline
-  
-  fn inlined_target_feature() -> () {
-      let mut _0: ();
-      let _1: ();
-+     scope 1 (inlined target_feature) {
-+     }
-  
-      bb0: {
-          StorageLive(_1);
--         _1 = target_feature() -> [return: bb1, unwind unreachable];
--     }
-- 
--     bb1: {
-          StorageDead(_1);
-          _0 = const ();
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.panic-unwind.diff
deleted file mode 100644
index 24457819b2c..00000000000
--- a/tests/mir-opt/inline/inline_compatibility.inlined_target_feature.Inline.panic-unwind.diff
+++ /dev/null
@@ -1,21 +0,0 @@
-- // MIR for `inlined_target_feature` before Inline
-+ // MIR for `inlined_target_feature` after Inline
-  
-  fn inlined_target_feature() -> () {
-      let mut _0: ();
-      let _1: ();
-+     scope 1 (inlined target_feature) {
-+     }
-  
-      bb0: {
-          StorageLive(_1);
--         _1 = target_feature() -> [return: bb1, unwind continue];
--     }
-- 
--     bb1: {
-          StorageDead(_1);
-          _0 = const ();
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.panic-abort.diff
deleted file mode 100644
index 791c5a0f29f..00000000000
--- a/tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.panic-abort.diff
+++ /dev/null
@@ -1,22 +0,0 @@
-- // MIR for `not_inlined_c_variadic` before Inline
-+ // MIR for `not_inlined_c_variadic` after Inline
-  
-  fn not_inlined_c_variadic() -> () {
-      let mut _0: ();
-      let _1: u32;
-      scope 1 {
-          debug s => _1;
-      }
-  
-      bb0: {
-          StorageLive(_1);
-          _1 = sum(const 4_u32, const 4_u32, const 30_u32, const 200_u32, const 1000_u32) -> [return: bb1, unwind unreachable];
-      }
-  
-      bb1: {
-          _0 = const ();
-          StorageDead(_1);
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.panic-unwind.diff
deleted file mode 100644
index 364acab6d93..00000000000
--- a/tests/mir-opt/inline/inline_compatibility.not_inlined_c_variadic.Inline.panic-unwind.diff
+++ /dev/null
@@ -1,22 +0,0 @@
-- // MIR for `not_inlined_c_variadic` before Inline
-+ // MIR for `not_inlined_c_variadic` after Inline
-  
-  fn not_inlined_c_variadic() -> () {
-      let mut _0: ();
-      let _1: u32;
-      scope 1 {
-          debug s => _1;
-      }
-  
-      bb0: {
-          StorageLive(_1);
-          _1 = sum(const 4_u32, const 4_u32, const 30_u32, const 200_u32, const 1000_u32) -> [return: bb1, unwind continue];
-      }
-  
-      bb1: {
-          _0 = const ();
-          StorageDead(_1);
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.panic-abort.diff
deleted file mode 100644
index b9d0946b7c3..00000000000
--- a/tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.panic-abort.diff
+++ /dev/null
@@ -1,19 +0,0 @@
-- // MIR for `not_inlined_no_sanitize` before Inline
-+ // MIR for `not_inlined_no_sanitize` after Inline
-  
-  fn not_inlined_no_sanitize() -> () {
-      let mut _0: ();
-      let _1: ();
-  
-      bb0: {
-          StorageLive(_1);
-          _1 = no_sanitize() -> [return: bb1, unwind unreachable];
-      }
-  
-      bb1: {
-          StorageDead(_1);
-          _0 = const ();
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.panic-unwind.diff
deleted file mode 100644
index 965b7ddca32..00000000000
--- a/tests/mir-opt/inline/inline_compatibility.not_inlined_no_sanitize.Inline.panic-unwind.diff
+++ /dev/null
@@ -1,19 +0,0 @@
-- // MIR for `not_inlined_no_sanitize` before Inline
-+ // MIR for `not_inlined_no_sanitize` after Inline
-  
-  fn not_inlined_no_sanitize() -> () {
-      let mut _0: ();
-      let _1: ();
-  
-      bb0: {
-          StorageLive(_1);
-          _1 = no_sanitize() -> [return: bb1, unwind continue];
-      }
-  
-      bb1: {
-          StorageDead(_1);
-          _0 = const ();
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.panic-abort.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.panic-abort.diff
deleted file mode 100644
index 7c689a73482..00000000000
--- a/tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.panic-abort.diff
+++ /dev/null
@@ -1,19 +0,0 @@
-- // MIR for `not_inlined_target_feature` before Inline
-+ // MIR for `not_inlined_target_feature` after Inline
-  
-  fn not_inlined_target_feature() -> () {
-      let mut _0: ();
-      let _1: ();
-  
-      bb0: {
-          StorageLive(_1);
-          _1 = target_feature() -> [return: bb1, unwind unreachable];
-      }
-  
-      bb1: {
-          StorageDead(_1);
-          _0 = const ();
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.panic-unwind.diff b/tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.panic-unwind.diff
deleted file mode 100644
index bcdbd6e3314..00000000000
--- a/tests/mir-opt/inline/inline_compatibility.not_inlined_target_feature.Inline.panic-unwind.diff
+++ /dev/null
@@ -1,19 +0,0 @@
-- // MIR for `not_inlined_target_feature` before Inline
-+ // MIR for `not_inlined_target_feature` after Inline
-  
-  fn not_inlined_target_feature() -> () {
-      let mut _0: ();
-      let _1: ();
-  
-      bb0: {
-          StorageLive(_1);
-          _1 = target_feature() -> [return: bb1, unwind continue];
-      }
-  
-      bb1: {
-          StorageDead(_1);
-          _0 = const ();
-          return;
-      }
-  }
-  
diff --git a/tests/mir-opt/inline/inline_compatibility.rs b/tests/mir-opt/inline/inline_compatibility.rs
index 52f4debf5db..3ad880715fe 100644
--- a/tests/mir-opt/inline/inline_compatibility.rs
+++ b/tests/mir-opt/inline/inline_compatibility.rs
@@ -1,51 +1,71 @@
-// skip-filecheck
 // Checks that only functions with compatible attributes are inlined.
-//
 // only-x86_64
-// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
+// compile-flags: -Cpanic=abort
 
 #![crate_type = "lib"]
 #![feature(no_sanitize)]
 #![feature(target_feature_11)]
 #![feature(c_variadic)]
 
-// EMIT_MIR inline_compatibility.inlined_target_feature.Inline.diff
+#[inline]
+#[target_feature(enable = "sse2")]
+unsafe fn sse2() {}
+
+#[inline]
+fn nop() {}
+
+// CHECK-LABEL: fn f0()
+// CHECK:       bb0: {
+// CHECK-NEXT:  return;
 #[target_feature(enable = "sse2")]
-pub unsafe fn inlined_target_feature() {
-    target_feature();
+pub unsafe fn f0() {
+    sse2();
 }
 
-// EMIT_MIR inline_compatibility.not_inlined_target_feature.Inline.diff
-pub unsafe fn not_inlined_target_feature() {
-    target_feature();
+// CHECK-LABEL: fn f1()
+// CHECK:       bb0: {
+// CHECK-NEXT:  sse2()
+pub unsafe fn f1() {
+    sse2();
 }
 
-// EMIT_MIR inline_compatibility.inlined_no_sanitize.Inline.diff
+// CHECK-LABEL: fn f2()
+// CHECK:       bb0: {
+// CHECK-NEXT:  nop()
+#[target_feature(enable = "avx")]
+pub unsafe fn f2() {
+    nop();
+}
+
+#[inline]
+#[no_sanitize(address)]
+pub unsafe fn no_sanitize() {}
+
+// CHECK-LABEL: fn inlined_no_sanitize()
+// CHECK:       bb0: {
+// CHECK-NEXT:  return;
 #[no_sanitize(address)]
 pub unsafe fn inlined_no_sanitize() {
     no_sanitize();
 }
 
-// EMIT_MIR inline_compatibility.not_inlined_no_sanitize.Inline.diff
+// CHECK-LABEL: fn not_inlined_no_sanitize()
+// CHECK:       bb0: {
+// CHECK-NEXT:  no_sanitize()
 pub unsafe fn not_inlined_no_sanitize() {
     no_sanitize();
 }
 
-#[inline]
-#[target_feature(enable = "sse2")]
-pub unsafe fn target_feature() {}
-
-#[inline]
-#[no_sanitize(address)]
-pub unsafe fn no_sanitize() {}
-
-// EMIT_MIR inline_compatibility.not_inlined_c_variadic.Inline.diff
+// CHECK-LABEL: fn not_inlined_c_variadic()
+// CHECK:       bb0: {
+// CHECK-NEXT:  StorageLive(_1)
+// CHECK-NEXT:  _1 = sum
 pub unsafe fn not_inlined_c_variadic() {
-    let s = sum(4u32, 4u32, 30u32, 200u32, 1000u32);
+    let _ = sum(4u32, 4u32, 30u32, 200u32, 1000u32);
 }
 
-#[no_mangle]
 #[inline(always)]
+#[no_mangle]
 unsafe extern "C" fn sum(n: u32, mut vs: ...) -> u32 {
     let mut s = 0;
     let mut i = 0;
diff --git a/tests/ui/associated-consts/issue-105330.rs b/tests/ui/associated-consts/issue-105330.rs
index 285e89cce49..6c6dae864f3 100644
--- a/tests/ui/associated-consts/issue-105330.rs
+++ b/tests/ui/associated-consts/issue-105330.rs
@@ -14,5 +14,6 @@ fn foo<A: TraitWAssocConst<A=32>>() { //~ ERROR E0658
 
 fn main<A: TraitWAssocConst<A=32>>() {
     //~^ ERROR E0658
+    //~| ERROR E0131
     foo::<Demo>();
 }
diff --git a/tests/ui/associated-consts/issue-105330.stderr b/tests/ui/associated-consts/issue-105330.stderr
index 55207909f7a..aeedf6b1949 100644
--- a/tests/ui/associated-consts/issue-105330.stderr
+++ b/tests/ui/associated-consts/issue-105330.stderr
@@ -39,7 +39,13 @@ error[E0562]: `impl Trait` only allowed in function and inherent method argument
 LL | impl TraitWAssocConst for impl Demo {
    |                           ^^^^^^^^^
 
-error: aborting due to 5 previous errors
+error[E0131]: `main` function is not allowed to have generic parameters
+  --> $DIR/issue-105330.rs:15:8
+   |
+LL | fn main<A: TraitWAssocConst<A=32>>() {
+   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `main` cannot have generic parameters
+
+error: aborting due to 6 previous errors
 
-Some errors have detailed explanations: E0404, E0562, E0658.
-For more information about an error, try `rustc --explain E0404`.
+Some errors have detailed explanations: E0131, E0404, E0562, E0658.
+For more information about an error, try `rustc --explain E0131`.
diff --git a/tests/ui/associated-inherent-types/generic-associated-types-bad.item.stderr b/tests/ui/associated-inherent-types/generic-associated-types-bad.item.stderr
index 464b59c249f..0620725ca33 100644
--- a/tests/ui/associated-inherent-types/generic-associated-types-bad.item.stderr
+++ b/tests/ui/associated-inherent-types/generic-associated-types-bad.item.stderr
@@ -10,6 +10,18 @@ note: required by a bound in `Ty::Pr`
 LL |     type Pr<T: Copy> = T;
    |                ^^^^ required by this bound in `Ty::Pr`
 
-error: aborting due to previous error
+error[E0277]: the trait bound `String: Copy` is not satisfied
+  --> $DIR/generic-associated-types-bad.rs:16:27
+   |
+LL | const _: Ty::Pr<String> = String::new();
+   |                           ^^^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
+   |
+note: required by a bound in `Ty::Pr`
+  --> $DIR/generic-associated-types-bad.rs:10:16
+   |
+LL |     type Pr<T: Copy> = T;
+   |                ^^^^ required by this bound in `Ty::Pr`
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/associated-inherent-types/generic-associated-types-bad.local.stderr b/tests/ui/associated-inherent-types/generic-associated-types-bad.local.stderr
index 4f371b24e80..fcf828c21c7 100644
--- a/tests/ui/associated-inherent-types/generic-associated-types-bad.local.stderr
+++ b/tests/ui/associated-inherent-types/generic-associated-types-bad.local.stderr
@@ -1,5 +1,5 @@
 error[E0277]: the trait bound `Vec<()>: Copy` is not satisfied
-  --> $DIR/generic-associated-types-bad.rs:20:12
+  --> $DIR/generic-associated-types-bad.rs:21:12
    |
 LL |     let _: Ty::Pr<Vec<()>>;
    |            ^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Vec<()>`
diff --git a/tests/ui/associated-inherent-types/generic-associated-types-bad.region.stderr b/tests/ui/associated-inherent-types/generic-associated-types-bad.region.stderr
index 74ec39424ed..94c20521857 100644
--- a/tests/ui/associated-inherent-types/generic-associated-types-bad.region.stderr
+++ b/tests/ui/associated-inherent-types/generic-associated-types-bad.region.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/generic-associated-types-bad.rs:25:12
+  --> $DIR/generic-associated-types-bad.rs:26:12
    |
 LL | fn user<'a>() {
    |         -- lifetime `'a` defined here
diff --git a/tests/ui/associated-inherent-types/generic-associated-types-bad.rs b/tests/ui/associated-inherent-types/generic-associated-types-bad.rs
index e66392a0a94..f5deec422f5 100644
--- a/tests/ui/associated-inherent-types/generic-associated-types-bad.rs
+++ b/tests/ui/associated-inherent-types/generic-associated-types-bad.rs
@@ -14,6 +14,7 @@ impl Ty {
 
 #[cfg(item)]
 const _: Ty::Pr<String> = String::new(); //[item]~ the trait bound `String: Copy` is not satisfied
+//[item]~^ the trait bound `String: Copy` is not satisfied
 
 fn main() {
     #[cfg(local)]
diff --git a/tests/ui/associated-types/associated-types-no-suitable-supertrait.rs b/tests/ui/associated-types/associated-types-no-suitable-supertrait.rs
index c373c5855cd..cc0101d63cf 100644
--- a/tests/ui/associated-types/associated-types-no-suitable-supertrait.rs
+++ b/tests/ui/associated-types/associated-types-no-suitable-supertrait.rs
@@ -21,6 +21,7 @@ trait Other {
 impl<T:Get> Other for T {
     fn uhoh<U:Get>(&self, foo: U, bar: <(T, U) as Get>::Value) {}
     //~^ ERROR the trait bound `(T, U): Get` is not satisfied
+    //~| ERROR the trait bound `(T, U): Get` is not satisfied
 }
 
 fn main() { }
diff --git a/tests/ui/associated-types/associated-types-no-suitable-supertrait.stderr b/tests/ui/associated-types/associated-types-no-suitable-supertrait.stderr
index b3f2e16ba0d..9ebc45387e8 100644
--- a/tests/ui/associated-types/associated-types-no-suitable-supertrait.stderr
+++ b/tests/ui/associated-types/associated-types-no-suitable-supertrait.stderr
@@ -21,6 +21,18 @@ help: consider further restricting `Self`
 LL |     fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
    |                                                              +++++++++++++++
 
-error: aborting due to 2 previous errors
+error[E0277]: the trait bound `(T, U): Get` is not satisfied
+  --> $DIR/associated-types-no-suitable-supertrait.rs:22:5
+   |
+LL |     fn uhoh<U:Get>(&self, foo: U, bar: <(T, U) as Get>::Value) {}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Get` is not implemented for `(T, U)`
+   |
+help: this trait has no implementations, consider adding one
+  --> $DIR/associated-types-no-suitable-supertrait.rs:12:1
+   |
+LL | trait Get {
+   | ^^^^^^^^^
+
+error: aborting due to 3 previous errors
 
 For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs b/tests/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs
index 20ff875491f..bce3b0fd729 100644
--- a/tests/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs
+++ b/tests/ui/coherence/coherence-impl-trait-for-trait-object-safe.rs
@@ -6,5 +6,6 @@
 trait NotObjectSafe { fn eq(&self, other: Self); }
 impl NotObjectSafe for dyn NotObjectSafe { }
 //~^ ERROR E0038
+//~| ERROR E0046
 
 fn main() { }
diff --git a/tests/ui/coherence/coherence-impl-trait-for-trait-object-safe.stderr b/tests/ui/coherence/coherence-impl-trait-for-trait-object-safe.stderr
index e9090c1b6bc..1dcc30ee652 100644
--- a/tests/ui/coherence/coherence-impl-trait-for-trait-object-safe.stderr
+++ b/tests/ui/coherence/coherence-impl-trait-for-trait-object-safe.stderr
@@ -13,6 +13,15 @@ LL | trait NotObjectSafe { fn eq(&self, other: Self); }
    |       this trait cannot be made into an object...
    = help: consider moving `eq` to another trait
 
-error: aborting due to previous error
+error[E0046]: not all trait items implemented, missing: `eq`
+  --> $DIR/coherence-impl-trait-for-trait-object-safe.rs:7:1
+   |
+LL | trait NotObjectSafe { fn eq(&self, other: Self); }
+   |                       -------------------------- `eq` from trait
+LL | impl NotObjectSafe for dyn NotObjectSafe { }
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `eq` in implementation
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0038`.
+Some errors have detailed explanations: E0038, E0046.
+For more information about an error, try `rustc --explain E0038`.
diff --git a/tests/ui/const-generics/generic_const_exprs/type_mismatch.rs b/tests/ui/const-generics/generic_const_exprs/type_mismatch.rs
new file mode 100644
index 00000000000..5813f098184
--- /dev/null
+++ b/tests/ui/const-generics/generic_const_exprs/type_mismatch.rs
@@ -0,0 +1,13 @@
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+trait Q {
+    const ASSOC: usize;
+}
+
+impl<const N: u64> Q for [u8; N] {}
+//~^ ERROR not all trait items implemented
+
+pub fn q_user() -> [u8; <[u8; 13] as Q>::ASSOC] {}
+
+pub fn main() {}
diff --git a/tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr b/tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr
new file mode 100644
index 00000000000..0314d7ed23d
--- /dev/null
+++ b/tests/ui/const-generics/generic_const_exprs/type_mismatch.stderr
@@ -0,0 +1,12 @@
+error[E0046]: not all trait items implemented, missing: `ASSOC`
+  --> $DIR/type_mismatch.rs:8:1
+   |
+LL |     const ASSOC: usize;
+   |     ------------------ `ASSOC` from trait
+...
+LL | impl<const N: u64> Q for [u8; N] {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `ASSOC` in implementation
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0046`.
diff --git a/tests/ui/consts/const-unsized.rs b/tests/ui/consts/const-unsized.rs
index 319b8ef97de..e0b06a27109 100644
--- a/tests/ui/consts/const-unsized.rs
+++ b/tests/ui/consts/const-unsized.rs
@@ -2,15 +2,19 @@ use std::fmt::Debug;
 
 const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync));
 //~^ ERROR the size for values of type
+//~| ERROR the size for values of type
 
 const CONST_FOO: str = *"foo";
 //~^ ERROR the size for values of type
+//~| ERROR the size for values of type
 
 static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync));
 //~^ ERROR the size for values of type
+//~| ERROR the size for values of type
 
 static STATIC_BAR: str = *"bar";
 //~^ ERROR the size for values of type
+//~| ERROR the size for values of type
 
 fn main() {
     println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR);
diff --git a/tests/ui/consts/const-unsized.stderr b/tests/ui/consts/const-unsized.stderr
index 27b200648eb..674f0cb99e7 100644
--- a/tests/ui/consts/const-unsized.stderr
+++ b/tests/ui/consts/const-unsized.stderr
@@ -7,7 +7,7 @@ LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync));
    = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)`
 
 error[E0277]: the size for values of type `str` cannot be known at compilation time
-  --> $DIR/const-unsized.rs:6:18
+  --> $DIR/const-unsized.rs:7:18
    |
 LL | const CONST_FOO: str = *"foo";
    |                  ^^^ doesn't have a size known at compile-time
@@ -15,7 +15,7 @@ LL | const CONST_FOO: str = *"foo";
    = help: the trait `Sized` is not implemented for `str`
 
 error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time
-  --> $DIR/const-unsized.rs:9:18
+  --> $DIR/const-unsized.rs:11:18
    |
 LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync));
    |                  ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -23,13 +23,49 @@ LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync));
    = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)`
 
 error[E0277]: the size for values of type `str` cannot be known at compilation time
-  --> $DIR/const-unsized.rs:12:20
+  --> $DIR/const-unsized.rs:15:20
    |
 LL | static STATIC_BAR: str = *"bar";
    |                    ^^^ doesn't have a size known at compile-time
    |
    = help: the trait `Sized` is not implemented for `str`
 
-error: aborting due to 4 previous errors
+error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time
+  --> $DIR/const-unsized.rs:3:35
+   |
+LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync));
+   |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+   |
+   = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)`
+   = note: constant expressions must have a statically known size
+
+error[E0277]: the size for values of type `str` cannot be known at compilation time
+  --> $DIR/const-unsized.rs:7:24
+   |
+LL | const CONST_FOO: str = *"foo";
+   |                        ^^^^^^ doesn't have a size known at compile-time
+   |
+   = help: the trait `Sized` is not implemented for `str`
+   = note: constant expressions must have a statically known size
+
+error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time
+  --> $DIR/const-unsized.rs:11:37
+   |
+LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync));
+   |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+   |
+   = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)`
+   = note: constant expressions must have a statically known size
+
+error[E0277]: the size for values of type `str` cannot be known at compilation time
+  --> $DIR/const-unsized.rs:15:26
+   |
+LL | static STATIC_BAR: str = *"bar";
+   |                          ^^^^^^ doesn't have a size known at compile-time
+   |
+   = help: the trait `Sized` is not implemented for `str`
+   = note: constant expressions must have a statically known size
+
+error: aborting due to 8 previous errors
 
 For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/generic-associated-types/issue-84931.rs b/tests/ui/generic-associated-types/issue-84931.rs
index 4123ce9d4d9..2ef990a7a90 100644
--- a/tests/ui/generic-associated-types/issue-84931.rs
+++ b/tests/ui/generic-associated-types/issue-84931.rs
@@ -12,7 +12,8 @@ struct StreamingSliceIter<'a, T> {
 
 impl<'b, T: 'b> StreamingIter for StreamingSliceIter<'b, T> {
     type Item<'a> = &'a mut T;
-    //~^ the parameter type
+    //~^ ERROR: the parameter type
+    //~| ERROR: does not fulfill the required lifetime
     fn next(&mut self) -> Option<&mut T> {
         loop {}
     }
diff --git a/tests/ui/generic-associated-types/issue-84931.stderr b/tests/ui/generic-associated-types/issue-84931.stderr
index fe9932c205a..04e14b9c746 100644
--- a/tests/ui/generic-associated-types/issue-84931.stderr
+++ b/tests/ui/generic-associated-types/issue-84931.stderr
@@ -11,6 +11,26 @@ help: consider adding an explicit lifetime bound
 LL |     type Item<'a> = &'a mut T where T: 'a;
    |                               +++++++++++
 
-error: aborting due to previous error
+error[E0477]: the type `StreamingSliceIter<'b, T>` does not fulfill the required lifetime
+  --> $DIR/issue-84931.rs:14:21
+   |
+LL |     type Item<'a> where Self: 'a;
+   |     ------------- definition of `Item` from trait
+...
+LL |     type Item<'a> = &'a mut T;
+   |                     ^^^^^^^^^
+   |
+note: type must outlive the lifetime `'a` as defined here
+  --> $DIR/issue-84931.rs:14:15
+   |
+LL |     type Item<'a> = &'a mut T;
+   |               ^^
+help: copy the `where` clause predicates from the trait
+   |
+LL |     type Item<'a> = &'a mut T where Self: 'a;
+   |                               ++++++++++++++
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0309`.
+Some errors have detailed explanations: E0309, E0477.
+For more information about an error, try `rustc --explain E0309`.
diff --git a/tests/ui/generic-associated-types/unsatisfied-item-lifetime-bound.rs b/tests/ui/generic-associated-types/unsatisfied-item-lifetime-bound.rs
index 060ee8821d8..a3f3b1a6d4d 100644
--- a/tests/ui/generic-associated-types/unsatisfied-item-lifetime-bound.rs
+++ b/tests/ui/generic-associated-types/unsatisfied-item-lifetime-bound.rs
@@ -7,6 +7,7 @@ pub trait X {
 
 impl X for () {
     type Y<'a> = &'a ();
+    //~^ ERROR lifetime bound not satisfied
 }
 
 struct B<'a, T: for<'r> X<Y<'r> = &'r ()>> {
diff --git a/tests/ui/generic-associated-types/unsatisfied-item-lifetime-bound.stderr b/tests/ui/generic-associated-types/unsatisfied-item-lifetime-bound.stderr
index a69cd0028c1..f73ed5956da 100644
--- a/tests/ui/generic-associated-types/unsatisfied-item-lifetime-bound.stderr
+++ b/tests/ui/generic-associated-types/unsatisfied-item-lifetime-bound.stderr
@@ -12,44 +12,64 @@ LL | #![warn(unused_lifetimes)]
    |         ^^^^^^^^^^^^^^^^
 
 error[E0478]: lifetime bound not satisfied
-  --> $DIR/unsatisfied-item-lifetime-bound.rs:13:8
+  --> $DIR/unsatisfied-item-lifetime-bound.rs:14:8
    |
 LL |     f: <T as X>::Y<'a>,
    |        ^^^^^^^^^^^^^^^
    |
 note: lifetime parameter instantiated with the lifetime `'a` as defined here
-  --> $DIR/unsatisfied-item-lifetime-bound.rs:12:10
+  --> $DIR/unsatisfied-item-lifetime-bound.rs:13:10
    |
 LL | struct B<'a, T: for<'r> X<Y<'r> = &'r ()>> {
    |          ^^
    = note: but lifetime parameter must outlive the static lifetime
 
 error[E0478]: lifetime bound not satisfied
-  --> $DIR/unsatisfied-item-lifetime-bound.rs:18:8
+  --> $DIR/unsatisfied-item-lifetime-bound.rs:19:8
    |
 LL |     f: <T as X>::Y<'a>,
    |        ^^^^^^^^^^^^^^^
    |
 note: lifetime parameter instantiated with the lifetime `'a` as defined here
-  --> $DIR/unsatisfied-item-lifetime-bound.rs:17:10
+  --> $DIR/unsatisfied-item-lifetime-bound.rs:18:10
    |
 LL | struct C<'a, T: X> {
    |          ^^
    = note: but lifetime parameter must outlive the static lifetime
 
 error[E0478]: lifetime bound not satisfied
-  --> $DIR/unsatisfied-item-lifetime-bound.rs:23:8
+  --> $DIR/unsatisfied-item-lifetime-bound.rs:24:8
    |
 LL |     f: <() as X>::Y<'a>,
    |        ^^^^^^^^^^^^^^^^
    |
 note: lifetime parameter instantiated with the lifetime `'a` as defined here
-  --> $DIR/unsatisfied-item-lifetime-bound.rs:22:10
+  --> $DIR/unsatisfied-item-lifetime-bound.rs:23:10
    |
 LL | struct D<'a> {
    |          ^^
    = note: but lifetime parameter must outlive the static lifetime
 
-error: aborting due to 3 previous errors; 1 warning emitted
+error[E0478]: lifetime bound not satisfied
+  --> $DIR/unsatisfied-item-lifetime-bound.rs:9:18
+   |
+LL |     type Y<'a: 'static>;
+   |     ------------------- definition of `Y` from trait
+...
+LL |     type Y<'a> = &'a ();
+   |                  ^^^^^^
+   |
+note: lifetime parameter instantiated with the lifetime `'a` as defined here
+  --> $DIR/unsatisfied-item-lifetime-bound.rs:9:12
+   |
+LL |     type Y<'a> = &'a ();
+   |            ^^
+   = note: but lifetime parameter must outlive the static lifetime
+help: copy the `where` clause predicates from the trait
+   |
+LL |     type Y<'a> = &'a () where 'a: 'static;
+   |                         +++++++++++++++++
+
+error: aborting due to 4 previous errors; 1 warning emitted
 
 For more information about this error, try `rustc --explain E0478`.
diff --git a/tests/ui/instrument-coverage/except-unused-functions.rs b/tests/ui/instrument-coverage/except-unused-functions.rs
deleted file mode 100644
index 5a0b7d4fef9..00000000000
--- a/tests/ui/instrument-coverage/except-unused-functions.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-// compile-flags: -Cinstrument-coverage=except-unused-functions
-
-fn main() {}
diff --git a/tests/ui/instrument-coverage/except-unused-generics.rs b/tests/ui/instrument-coverage/except-unused-generics.rs
deleted file mode 100644
index 4b1ddf29026..00000000000
--- a/tests/ui/instrument-coverage/except-unused-generics.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-// compile-flags: -Cinstrument-coverage=except-unused-generics
-
-fn main() {}
diff --git a/tests/ui/instrument-coverage/except-unused-functions.stderr b/tests/ui/instrument-coverage/unstable.branch.stderr
index acc633a2a6d..acc633a2a6d 100644
--- a/tests/ui/instrument-coverage/except-unused-functions.stderr
+++ b/tests/ui/instrument-coverage/unstable.branch.stderr
diff --git a/tests/ui/instrument-coverage/except-unused-generics.stderr b/tests/ui/instrument-coverage/unstable.except-unused-functions.stderr
index acc633a2a6d..acc633a2a6d 100644
--- a/tests/ui/instrument-coverage/except-unused-generics.stderr
+++ b/tests/ui/instrument-coverage/unstable.except-unused-functions.stderr
diff --git a/tests/ui/instrument-coverage/unstable.except-unused-generics.stderr b/tests/ui/instrument-coverage/unstable.except-unused-generics.stderr
new file mode 100644
index 00000000000..acc633a2a6d
--- /dev/null
+++ b/tests/ui/instrument-coverage/unstable.except-unused-generics.stderr
@@ -0,0 +1,2 @@
+error: `-C instrument-coverage=branch` and `-C instrument-coverage=except-*` require `-Z unstable-options`
+
diff --git a/tests/ui/instrument-coverage/unstable.rs b/tests/ui/instrument-coverage/unstable.rs
new file mode 100644
index 00000000000..c16bcd0bf6d
--- /dev/null
+++ b/tests/ui/instrument-coverage/unstable.rs
@@ -0,0 +1,6 @@
+// revisions: branch except-unused-functions except-unused-generics
+// [branch] compile-flags: -Cinstrument-coverage=branch
+// [except-unused-functions] compile-flags: -Cinstrument-coverage=except-unused-functions
+// [except-unused-generics] compile-flags: -Cinstrument-coverage=except-unused-generics
+
+fn main() {}
diff --git a/tests/ui/issues/issue-19380.rs b/tests/ui/issues/issue-19380.rs
index 5c10e2067e4..fce737cba18 100644
--- a/tests/ui/issues/issue-19380.rs
+++ b/tests/ui/issues/issue-19380.rs
@@ -14,5 +14,6 @@ struct Bar {
 
 const FOO : Foo = Foo;
 const BAR : Bar = Bar { foos: &[&FOO]};
+//~^ ERROR E0038
 
 fn main() { }
diff --git a/tests/ui/issues/issue-19380.stderr b/tests/ui/issues/issue-19380.stderr
index b2aeb5edf29..37e280fbcc7 100644
--- a/tests/ui/issues/issue-19380.stderr
+++ b/tests/ui/issues/issue-19380.stderr
@@ -20,6 +20,29 @@ help: alternatively, consider constraining `qiz` so it does not apply to trait o
 LL |   fn qiz() where Self: Sized;
    |            +++++++++++++++++
 
-error: aborting due to previous error
+error[E0038]: the trait `Qiz` cannot be made into an object
+  --> $DIR/issue-19380.rs:16:33
+   |
+LL | const BAR : Bar = Bar { foos: &[&FOO]};
+   |                                 ^^^^ `Qiz` cannot be made into an object
+   |
+note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
+  --> $DIR/issue-19380.rs:2:6
+   |
+LL | trait Qiz {
+   |       --- this trait cannot be made into an object...
+LL |   fn qiz();
+   |      ^^^ ...because associated function `qiz` has no `self` parameter
+   = note: required for the cast from `&Foo` to `&'static (dyn Qiz + 'static)`
+help: consider turning `qiz` into a method by giving it a `&self` argument
+   |
+LL |   fn qiz(&self);
+   |          +++++
+help: alternatively, consider constraining `qiz` so it does not apply to trait objects
+   |
+LL |   fn qiz() where Self: Sized;
+   |            +++++++++++++++++
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0038`.
diff --git a/tests/ui/issues/issue-24446.rs b/tests/ui/issues/issue-24446.rs
index 9ab952ade9c..6cf8846506d 100644
--- a/tests/ui/issues/issue-24446.rs
+++ b/tests/ui/issues/issue-24446.rs
@@ -2,6 +2,8 @@ fn main() {
     static foo: dyn Fn() -> u32 = || -> u32 {
         //~^ ERROR the size for values of type
         //~| ERROR cannot be shared between threads safely
+        //~| ERROR the size for values of type
+        //~| ERROR mismatched types
         0
     };
 }
diff --git a/tests/ui/issues/issue-24446.stderr b/tests/ui/issues/issue-24446.stderr
index 72d528f1619..9c206e5ef3c 100644
--- a/tests/ui/issues/issue-24446.stderr
+++ b/tests/ui/issues/issue-24446.stderr
@@ -15,6 +15,39 @@ LL |     static foo: dyn Fn() -> u32 = || -> u32 {
    |
    = help: the trait `Sized` is not implemented for `(dyn Fn() -> u32 + 'static)`
 
-error: aborting due to 2 previous errors
+error[E0277]: the size for values of type `(dyn Fn() -> u32 + 'static)` cannot be known at compilation time
+  --> $DIR/issue-24446.rs:2:35
+   |
+LL |       static foo: dyn Fn() -> u32 = || -> u32 {
+   |  ___________________________________^
+LL | |
+LL | |
+LL | |
+LL | |
+LL | |         0
+LL | |     };
+   | |_____^ doesn't have a size known at compile-time
+   |
+   = help: the trait `Sized` is not implemented for `(dyn Fn() -> u32 + 'static)`
+   = note: constant expressions must have a statically known size
+
+error[E0308]: mismatched types
+  --> $DIR/issue-24446.rs:2:35
+   |
+LL |       static foo: dyn Fn() -> u32 = || -> u32 {
+   |  ___________________________________^
+LL | |
+LL | |
+LL | |
+LL | |
+LL | |         0
+LL | |     };
+   | |_____^ expected `dyn Fn`, found closure
+   |
+   = note: expected trait object `(dyn Fn() -> u32 + 'static)`
+                   found closure `{closure@$DIR/issue-24446.rs:2:35: 2:44}`
+
+error: aborting due to 4 previous errors
 
-For more information about this error, try `rustc --explain E0277`.
+Some errors have detailed explanations: E0277, E0308.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/issues/issue-77919.rs b/tests/ui/issues/issue-77919.rs
index 3cbf493afb8..bf603314977 100644
--- a/tests/ui/issues/issue-77919.rs
+++ b/tests/ui/issues/issue-77919.rs
@@ -10,3 +10,4 @@ struct Multiply<N, M> {
 }
 impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
 //~^ ERROR cannot find type `VAL` in this scope
+//~| ERROR not all trait items implemented
diff --git a/tests/ui/issues/issue-77919.stderr b/tests/ui/issues/issue-77919.stderr
index 9d2f859e05a..dbbe70ff069 100644
--- a/tests/ui/issues/issue-77919.stderr
+++ b/tests/ui/issues/issue-77919.stderr
@@ -20,6 +20,16 @@ help: you might be missing a type parameter
 LL | impl<N, M, VAL> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
    |          +++++
 
-error: aborting due to 2 previous errors
+error[E0046]: not all trait items implemented, missing: `VAL`
+  --> $DIR/issue-77919.rs:11:1
+   |
+LL |     const VAL: T;
+   |     ------------ `VAL` from trait
+...
+LL | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `VAL` in implementation
+
+error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0412`.
+Some errors have detailed explanations: E0046, E0412.
+For more information about an error, try `rustc --explain E0046`.
diff --git a/tests/ui/layout/issue-84108.rs b/tests/ui/layout/issue-84108.rs
index dd025c9b443..af21d1d6210 100644
--- a/tests/ui/layout/issue-84108.rs
+++ b/tests/ui/layout/issue-84108.rs
@@ -9,6 +9,8 @@ static FOO: (dyn AsRef<OsStr>, u8) = ("hello", 42);
 const BAR: (&Path, [u8], usize) = ("hello", [], 42);
 //~^ ERROR cannot find type `Path` in this scope
 //~| ERROR the size for values of type `[u8]` cannot be known at compilation time
+//~| ERROR mismatched types
 
 static BAZ: ([u8], usize) = ([], 0);
 //~^ ERROR the size for values of type `[u8]` cannot be known at compilation time
+//~| ERROR mismatched types
diff --git a/tests/ui/layout/issue-84108.stderr b/tests/ui/layout/issue-84108.stderr
index 5ad450bed07..3a02e73f96b 100644
--- a/tests/ui/layout/issue-84108.stderr
+++ b/tests/ui/layout/issue-84108.stderr
@@ -30,7 +30,7 @@ LL | const BAR: (&Path, [u8], usize) = ("hello", [], 42);
    = note: only the last element of a tuple may have a dynamically sized type
 
 error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
-  --> $DIR/issue-84108.rs:13:13
+  --> $DIR/issue-84108.rs:14:13
    |
 LL | static BAZ: ([u8], usize) = ([], 0);
    |             ^^^^^^^^^^^^^ doesn't have a size known at compile-time
@@ -38,7 +38,25 @@ LL | static BAZ: ([u8], usize) = ([], 0);
    = help: the trait `Sized` is not implemented for `[u8]`
    = note: only the last element of a tuple may have a dynamically sized type
 
-error: aborting due to 4 previous errors
+error[E0308]: mismatched types
+  --> $DIR/issue-84108.rs:9:45
+   |
+LL | const BAR: (&Path, [u8], usize) = ("hello", [], 42);
+   |                                             ^^ expected `[u8]`, found `[_; 0]`
+   |
+   = note: expected slice `[u8]`
+              found array `[_; 0]`
+
+error[E0308]: mismatched types
+  --> $DIR/issue-84108.rs:14:30
+   |
+LL | static BAZ: ([u8], usize) = ([], 0);
+   |                              ^^ expected `[u8]`, found `[_; 0]`
+   |
+   = note: expected slice `[u8]`
+              found array `[_; 0]`
+
+error: aborting due to 6 previous errors
 
-Some errors have detailed explanations: E0277, E0412.
+Some errors have detailed explanations: E0277, E0308, E0412.
 For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/mismatched_types/async-unwrap-suggestion.rs b/tests/ui/mismatched_types/async-unwrap-suggestion.rs
new file mode 100644
index 00000000000..9698cc29ffd
--- /dev/null
+++ b/tests/ui/mismatched_types/async-unwrap-suggestion.rs
@@ -0,0 +1,22 @@
+// edition: 2021
+
+async fn dont_suggest() -> i32 {
+    if false {
+        return Ok(6);
+        //~^ ERROR mismatched types
+    }
+
+    5
+}
+
+async fn do_suggest() -> i32 {
+    if false {
+        let s = Ok(6);
+        return s;
+        //~^ ERROR mismatched types
+    }
+
+    5
+}
+
+fn main() {}
diff --git a/tests/ui/mismatched_types/async-unwrap-suggestion.stderr b/tests/ui/mismatched_types/async-unwrap-suggestion.stderr
new file mode 100644
index 00000000000..80ca76a4b86
--- /dev/null
+++ b/tests/ui/mismatched_types/async-unwrap-suggestion.stderr
@@ -0,0 +1,25 @@
+error[E0308]: mismatched types
+  --> $DIR/async-unwrap-suggestion.rs:5:16
+   |
+LL |         return Ok(6);
+   |                ^^^^^ expected `i32`, found `Result<{integer}, _>`
+   |
+   = note: expected type `i32`
+              found enum `Result<{integer}, _>`
+
+error[E0308]: mismatched types
+  --> $DIR/async-unwrap-suggestion.rs:15:16
+   |
+LL |         return s;
+   |                ^ expected `i32`, found `Result<{integer}, _>`
+   |
+   = note: expected type `i32`
+              found enum `Result<{integer}, _>`
+help: consider using `Result::expect` to unwrap the `Result<{integer}, _>` value, panicking if the value is a `Result::Err`
+   |
+LL |         return s.expect("REASON");
+   |                 +++++++++++++++++
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/tests/ui/proc-macro/bad-projection.rs b/tests/ui/proc-macro/bad-projection.rs
index d214c7ac8b2..c7cffdc9b47 100644
--- a/tests/ui/proc-macro/bad-projection.rs
+++ b/tests/ui/proc-macro/bad-projection.rs
@@ -13,3 +13,5 @@ trait Project {
 #[proc_macro]
 pub fn uwu() -> <() as Project>::Assoc {}
 //~^ ERROR the trait bound `(): Project` is not satisfied
+//~| ERROR the trait bound `(): Project` is not satisfied
+//~| ERROR function is expected to take 1 argument, but it takes 0 arguments
diff --git a/tests/ui/proc-macro/bad-projection.stderr b/tests/ui/proc-macro/bad-projection.stderr
index 8716defa17a..aea5d6d7c84 100644
--- a/tests/ui/proc-macro/bad-projection.stderr
+++ b/tests/ui/proc-macro/bad-projection.stderr
@@ -10,6 +10,32 @@ help: this trait has no implementations, consider adding one
 LL | trait Project {
    | ^^^^^^^^^^^^^
 
-error: aborting due to previous error
+error[E0593]: function is expected to take 1 argument, but it takes 0 arguments
+  --> $DIR/bad-projection.rs:14:1
+   |
+LL | pub fn uwu() -> <() as Project>::Assoc {}
+   | --------------------------------------^^^
+   | |
+   | expected function that takes 1 argument
+   | takes 0 arguments
+   | required by a bound introduced by this call
+   |
+note: required by a bound in `ProcMacro::bang`
+  --> $SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL
+
+error[E0277]: the trait bound `(): Project` is not satisfied
+  --> $DIR/bad-projection.rs:14:1
+   |
+LL | pub fn uwu() -> <() as Project>::Assoc {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Project` is not implemented for `()`
+   |
+help: this trait has no implementations, consider adding one
+  --> $DIR/bad-projection.rs:9:1
+   |
+LL | trait Project {
+   | ^^^^^^^^^^^^^
+
+error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0277`.
+Some errors have detailed explanations: E0277, E0593.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/simd/array-trait.rs b/tests/ui/simd/array-trait.rs
index 45c10b37816..883d718c49b 100644
--- a/tests/ui/simd/array-trait.rs
+++ b/tests/ui/simd/array-trait.rs
@@ -22,6 +22,7 @@ impl Simd for i32x4 {
 #[derive(Copy, Clone)]
 pub struct T<S: Simd>([S::Lane; S::SIZE]);
 //~^ ERROR unconstrained generic constant
+//~| ERROR SIMD vector element type should be a primitive scalar
 
 extern "platform-intrinsic" {
     fn simd_insert<T, E>(x: T, idx: u32, y: E) -> T;
diff --git a/tests/ui/simd/array-trait.stderr b/tests/ui/simd/array-trait.stderr
index 765215c3939..cf6026912aa 100644
--- a/tests/ui/simd/array-trait.stderr
+++ b/tests/ui/simd/array-trait.stderr
@@ -6,5 +6,12 @@ LL | pub struct T<S: Simd>([S::Lane; S::SIZE]);
    |
    = help: try adding a `where` bound using this expression: `where [(); S::SIZE]:`
 
-error: aborting due to previous error
+error[E0077]: SIMD vector element type should be a primitive scalar (integer/float/pointer) type
+  --> $DIR/array-trait.rs:23:1
+   |
+LL | pub struct T<S: Simd>([S::Lane; S::SIZE]);
+   | ^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
 
+For more information about this error, try `rustc --explain E0077`.
diff --git a/tests/ui/specialization/min_specialization/issue-79224.rs b/tests/ui/specialization/min_specialization/issue-79224.rs
index 104bddd076e..a118cb28b38 100644
--- a/tests/ui/specialization/min_specialization/issue-79224.rs
+++ b/tests/ui/specialization/min_specialization/issue-79224.rs
@@ -19,6 +19,7 @@ impl<B: ?Sized> Display for Cow<'_, B> {
     //~^ ERROR: the trait bound `B: Clone` is not satisfied [E0277]
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         //~^ ERROR: the trait bound `B: Clone` is not satisfied [E0277]
+        //~| ERROR: the trait bound `B: Clone` is not satisfied [E0277]
         write!(f, "foo")
     }
 }
diff --git a/tests/ui/specialization/min_specialization/issue-79224.stderr b/tests/ui/specialization/min_specialization/issue-79224.stderr
index 9a4d557a152..7541579498e 100644
--- a/tests/ui/specialization/min_specialization/issue-79224.stderr
+++ b/tests/ui/specialization/min_specialization/issue-79224.stderr
@@ -22,6 +22,18 @@ help: consider further restricting this bound
 LL | impl<B: ?Sized + std::clone::Clone> Display for Cow<'_, B> {
    |                +++++++++++++++++++
 
-error: aborting due to 2 previous errors
+error[E0277]: the trait bound `B: Clone` is not satisfied
+  --> $DIR/issue-79224.rs:20:5
+   |
+LL |     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `B`
+   |
+   = note: required for `B` to implement `ToOwned`
+help: consider further restricting this bound
+   |
+LL | impl<B: ?Sized + std::clone::Clone> Display for Cow<'_, B> {
+   |                +++++++++++++++++++
+
+error: aborting due to 3 previous errors
 
 For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/bound/on-structs-and-enums-static.rs b/tests/ui/traits/bound/on-structs-and-enums-static.rs
index df3f8b8a599..066416cb362 100644
--- a/tests/ui/traits/bound/on-structs-and-enums-static.rs
+++ b/tests/ui/traits/bound/on-structs-and-enums-static.rs
@@ -8,7 +8,7 @@ struct Foo<T:Trait> {
 
 static X: Foo<usize> = Foo {
 //~^ ERROR E0277
-    x: 1,
+    x: 1, //~ ERROR: E0277
 };
 
 fn main() {
diff --git a/tests/ui/traits/bound/on-structs-and-enums-static.stderr b/tests/ui/traits/bound/on-structs-and-enums-static.stderr
index fa14aff684d..28bbe00c582 100644
--- a/tests/ui/traits/bound/on-structs-and-enums-static.stderr
+++ b/tests/ui/traits/bound/on-structs-and-enums-static.stderr
@@ -15,6 +15,23 @@ note: required by a bound in `Foo`
 LL | struct Foo<T:Trait> {
    |              ^^^^^ required by this bound in `Foo`
 
-error: aborting due to previous error
+error[E0277]: the trait bound `usize: Trait` is not satisfied
+  --> $DIR/on-structs-and-enums-static.rs:11:8
+   |
+LL |     x: 1,
+   |        ^ the trait `Trait` is not implemented for `usize`
+   |
+help: this trait has no implementations, consider adding one
+  --> $DIR/on-structs-and-enums-static.rs:1:1
+   |
+LL | trait Trait {
+   | ^^^^^^^^^^^
+note: required by a bound in `Foo`
+  --> $DIR/on-structs-and-enums-static.rs:5:14
+   |
+LL | struct Foo<T:Trait> {
+   |              ^^^^^ required by this bound in `Foo`
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/traits/new-solver/specialization-transmute.rs b/tests/ui/traits/new-solver/specialization-transmute.rs
index f6b19e7adf5..7523b828321 100644
--- a/tests/ui/traits/new-solver/specialization-transmute.rs
+++ b/tests/ui/traits/new-solver/specialization-transmute.rs
@@ -10,7 +10,7 @@ trait Default {
 }
 
 impl<T> Default for T {
-    default type Id = T;
+    default type Id = T; //~ ERROR: type annotations needed
     // This will be fixed by #111994
     fn intu(&self) -> &Self::Id { //~ ERROR type annotations needed
         self
diff --git a/tests/ui/traits/new-solver/specialization-transmute.stderr b/tests/ui/traits/new-solver/specialization-transmute.stderr
index 09b1405fefb..18965a465b3 100644
--- a/tests/ui/traits/new-solver/specialization-transmute.stderr
+++ b/tests/ui/traits/new-solver/specialization-transmute.stderr
@@ -16,6 +16,13 @@ LL |     fn intu(&self) -> &Self::Id {
    |
    = note: cannot satisfy `<T as Default>::Id == _`
 
-error: aborting due to previous error; 1 warning emitted
+error[E0282]: type annotations needed
+  --> $DIR/specialization-transmute.rs:13:23
+   |
+LL |     default type Id = T;
+   |                       ^ cannot infer type for associated type `<T as Default>::Id`
+
+error: aborting due to 2 previous errors; 1 warning emitted
 
-For more information about this error, try `rustc --explain E0284`.
+Some errors have detailed explanations: E0282, E0284.
+For more information about an error, try `rustc --explain E0282`.
diff --git a/tests/ui/type-alias-impl-trait/generic_underconstrained.rs b/tests/ui/type-alias-impl-trait/generic_underconstrained.rs
index d87a25aad58..1acacc778de 100644
--- a/tests/ui/type-alias-impl-trait/generic_underconstrained.rs
+++ b/tests/ui/type-alias-impl-trait/generic_underconstrained.rs
@@ -8,5 +8,6 @@ type Underconstrained<T: Trait> = impl Send;
 // no `Trait` bound
 fn underconstrain<T>(_: T) -> Underconstrained<T> {
     //~^ ERROR the trait bound `T: Trait`
+    //~| ERROR the trait bound `T: Trait`
     unimplemented!()
 }
diff --git a/tests/ui/type-alias-impl-trait/generic_underconstrained.stderr b/tests/ui/type-alias-impl-trait/generic_underconstrained.stderr
index bc9280127ac..88529b370f1 100644
--- a/tests/ui/type-alias-impl-trait/generic_underconstrained.stderr
+++ b/tests/ui/type-alias-impl-trait/generic_underconstrained.stderr
@@ -14,6 +14,27 @@ help: consider restricting type parameter `T`
 LL | fn underconstrain<T: Trait>(_: T) -> Underconstrained<T> {
    |                    +++++++
 
-error: aborting due to previous error
+error[E0277]: the trait bound `T: Trait` is not satisfied
+  --> $DIR/generic_underconstrained.rs:9:51
+   |
+LL |   fn underconstrain<T>(_: T) -> Underconstrained<T> {
+   |  ___________________________________________________^
+LL | |
+LL | |
+LL | |     unimplemented!()
+LL | | }
+   | |_^ the trait `Trait` is not implemented for `T`
+   |
+note: required by a bound on the type alias `Underconstrained`
+  --> $DIR/generic_underconstrained.rs:6:26
+   |
+LL | type Underconstrained<T: Trait> = impl Send;
+   |                          ^^^^^ required by this bound
+help: consider restricting type parameter `T`
+   |
+LL | fn underconstrain<T: Trait>(_: T) -> Underconstrained<T> {
+   |                    +++++++
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/type-alias-impl-trait/generic_underconstrained2.rs b/tests/ui/type-alias-impl-trait/generic_underconstrained2.rs
index 8adc0bf32a6..1e1bece9a1c 100644
--- a/tests/ui/type-alias-impl-trait/generic_underconstrained2.rs
+++ b/tests/ui/type-alias-impl-trait/generic_underconstrained2.rs
@@ -7,6 +7,7 @@ type Underconstrained<T: std::fmt::Debug> = impl Send;
 // not a defining use, because it doesn't define *all* possible generics
 fn underconstrained<U>(_: U) -> Underconstrained<U> {
     //~^ ERROR `U` doesn't implement `Debug`
+    //~| ERROR `U` doesn't implement `Debug`
     5u32
 }
 
@@ -15,5 +16,6 @@ type Underconstrained2<T: std::fmt::Debug> = impl Send;
 // not a defining use, because it doesn't define *all* possible generics
 fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> {
     //~^ ERROR `V` doesn't implement `Debug`
+    //~| ERROR `V` doesn't implement `Debug`
     5u32
 }
diff --git a/tests/ui/type-alias-impl-trait/generic_underconstrained2.stderr b/tests/ui/type-alias-impl-trait/generic_underconstrained2.stderr
index fdc9ec090db..b3b9cbca968 100644
--- a/tests/ui/type-alias-impl-trait/generic_underconstrained2.stderr
+++ b/tests/ui/type-alias-impl-trait/generic_underconstrained2.stderr
@@ -15,13 +15,13 @@ LL | fn underconstrained<U: std::fmt::Debug>(_: U) -> Underconstrained<U> {
    |                      +++++++++++++++++
 
 error[E0277]: `V` doesn't implement `Debug`
-  --> $DIR/generic_underconstrained2.rs:16:43
+  --> $DIR/generic_underconstrained2.rs:17:43
    |
 LL | fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> {
    |                                           ^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug`
    |
 note: required by a bound on the type alias `Underconstrained2`
-  --> $DIR/generic_underconstrained2.rs:13:27
+  --> $DIR/generic_underconstrained2.rs:14:27
    |
 LL | type Underconstrained2<T: std::fmt::Debug> = impl Send;
    |                           ^^^^^^^^^^^^^^^ required by this bound
@@ -30,6 +30,48 @@ help: consider restricting type parameter `V`
 LL | fn underconstrained2<U, V: std::fmt::Debug>(_: U, _: V) -> Underconstrained2<V> {
    |                          +++++++++++++++++
 
-error: aborting due to 2 previous errors
+error[E0277]: `U` doesn't implement `Debug`
+  --> $DIR/generic_underconstrained2.rs:8:53
+   |
+LL |   fn underconstrained<U>(_: U) -> Underconstrained<U> {
+   |  _____________________________________________________^
+LL | |
+LL | |
+LL | |     5u32
+LL | | }
+   | |_^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+   |
+note: required by a bound on the type alias `Underconstrained`
+  --> $DIR/generic_underconstrained2.rs:5:26
+   |
+LL | type Underconstrained<T: std::fmt::Debug> = impl Send;
+   |                          ^^^^^^^^^^^^^^^ required by this bound
+help: consider restricting type parameter `U`
+   |
+LL | fn underconstrained<U: std::fmt::Debug>(_: U) -> Underconstrained<U> {
+   |                      +++++++++++++++++
+
+error[E0277]: `V` doesn't implement `Debug`
+  --> $DIR/generic_underconstrained2.rs:17:64
+   |
+LL |   fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> {
+   |  ________________________________________________________________^
+LL | |
+LL | |
+LL | |     5u32
+LL | | }
+   | |_^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+   |
+note: required by a bound on the type alias `Underconstrained2`
+  --> $DIR/generic_underconstrained2.rs:14:27
+   |
+LL | type Underconstrained2<T: std::fmt::Debug> = impl Send;
+   |                           ^^^^^^^^^^^^^^^ required by this bound
+help: consider restricting type parameter `V`
+   |
+LL | fn underconstrained2<U, V: std::fmt::Debug>(_: U, _: V) -> Underconstrained2<V> {
+   |                          +++++++++++++++++
+
+error: aborting due to 4 previous errors
 
 For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/ufcs/ufcs-explicit-self-bad.rs b/tests/ui/ufcs/ufcs-explicit-self-bad.rs
index cb1fac0bae6..9b0f99a189a 100644
--- a/tests/ui/ufcs/ufcs-explicit-self-bad.rs
+++ b/tests/ui/ufcs/ufcs-explicit-self-bad.rs
@@ -36,6 +36,7 @@ impl<'a, T> SomeTrait for &'a Bar<T> {
     fn dummy1(self: &&'a Bar<T>) { }
     fn dummy2(self: &Bar<T>) {} //~ ERROR mismatched `self` parameter type
     //~^ ERROR mismatched `self` parameter type
+    //~| ERROR has an incompatible type for trait
     fn dummy3(self: &&Bar<T>) {}
     //~^ ERROR mismatched `self` parameter type
     //~| expected reference `&'a Bar<T>`
diff --git a/tests/ui/ufcs/ufcs-explicit-self-bad.stderr b/tests/ui/ufcs/ufcs-explicit-self-bad.stderr
index f325d1d8182..0efaa41d48a 100644
--- a/tests/ui/ufcs/ufcs-explicit-self-bad.stderr
+++ b/tests/ui/ufcs/ufcs-explicit-self-bad.stderr
@@ -64,7 +64,7 @@ LL |     fn dummy2(self: &Bar<T>) {}
    |                     ^^^^^^^
 
 error[E0308]: mismatched `self` parameter type
-  --> $DIR/ufcs-explicit-self-bad.rs:39:21
+  --> $DIR/ufcs-explicit-self-bad.rs:40:21
    |
 LL |     fn dummy3(self: &&Bar<T>) {}
    |                     ^^^^^^^^ lifetime mismatch
@@ -72,7 +72,7 @@ LL |     fn dummy3(self: &&Bar<T>) {}
    = note: expected reference `&'a Bar<T>`
               found reference `&Bar<T>`
 note: the anonymous lifetime defined here...
-  --> $DIR/ufcs-explicit-self-bad.rs:39:22
+  --> $DIR/ufcs-explicit-self-bad.rs:40:22
    |
 LL |     fn dummy3(self: &&Bar<T>) {}
    |                      ^^^^^^^
@@ -83,7 +83,7 @@ LL | impl<'a, T> SomeTrait for &'a Bar<T> {
    |      ^^
 
 error[E0308]: mismatched `self` parameter type
-  --> $DIR/ufcs-explicit-self-bad.rs:39:21
+  --> $DIR/ufcs-explicit-self-bad.rs:40:21
    |
 LL |     fn dummy3(self: &&Bar<T>) {}
    |                     ^^^^^^^^ lifetime mismatch
@@ -96,12 +96,29 @@ note: the lifetime `'a` as defined here...
 LL | impl<'a, T> SomeTrait for &'a Bar<T> {
    |      ^^
 note: ...does not necessarily outlive the anonymous lifetime defined here
-  --> $DIR/ufcs-explicit-self-bad.rs:39:22
+  --> $DIR/ufcs-explicit-self-bad.rs:40:22
    |
 LL |     fn dummy3(self: &&Bar<T>) {}
    |                      ^^^^^^^
 
-error: aborting due to 7 previous errors
+error[E0053]: method `dummy2` has an incompatible type for trait
+  --> $DIR/ufcs-explicit-self-bad.rs:37:21
+   |
+LL |     fn dummy2(self: &Bar<T>) {}
+   |               ------^^^^^^^
+   |               |     |
+   |               |     expected `&'a Bar<T>`, found `Bar<T>`
+   |               help: change the self-receiver type to match the trait: `&self`
+   |
+note: type in trait
+  --> $DIR/ufcs-explicit-self-bad.rs:31:15
+   |
+LL |     fn dummy2(&self);
+   |               ^^^^^
+   = note: expected signature `fn(&&'a Bar<T>)`
+              found signature `fn(&Bar<T>)`
+
+error: aborting due to 8 previous errors
 
-Some errors have detailed explanations: E0307, E0308.
-For more information about an error, try `rustc --explain E0307`.
+Some errors have detailed explanations: E0053, E0307, E0308.
+For more information about an error, try `rustc --explain E0053`.
diff --git a/tests/ui/union/issue-81199.rs b/tests/ui/union/issue-81199.rs
index 628e7c6ed5d..b8b0d9d33e7 100644
--- a/tests/ui/union/issue-81199.rs
+++ b/tests/ui/union/issue-81199.rs
@@ -4,6 +4,7 @@ union PtrRepr<T: ?Sized> {
     mut_ptr: *mut T,
     components: PtrComponents<T>,
     //~^ ERROR the trait bound
+    //~| ERROR field must implement `Copy`
 }
 
 #[repr(C)]
diff --git a/tests/ui/union/issue-81199.stderr b/tests/ui/union/issue-81199.stderr
index 5bb98675361..0dd894beb2a 100644
--- a/tests/ui/union/issue-81199.stderr
+++ b/tests/ui/union/issue-81199.stderr
@@ -5,7 +5,7 @@ LL |     components: PtrComponents<T>,
    |                 ^^^^^^^^^^^^^^^^ the trait `Pointee` is not implemented for `T`
    |
 note: required by a bound in `PtrComponents`
-  --> $DIR/issue-81199.rs:10:25
+  --> $DIR/issue-81199.rs:11:25
    |
 LL | struct PtrComponents<T: Pointee + ?Sized> {
    |                         ^^^^^^^ required by this bound in `PtrComponents`
@@ -14,6 +14,19 @@ help: consider further restricting this bound
 LL | union PtrRepr<T: ?Sized + Pointee> {
    |                         +++++++++
 
-error: aborting due to previous error
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
+  --> $DIR/issue-81199.rs:5:5
+   |
+LL |     components: PtrComponents<T>,
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
+   |
+LL |     components: std::mem::ManuallyDrop<PtrComponents<T>>,
+   |                 +++++++++++++++++++++++                +
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0277`.
+Some errors have detailed explanations: E0277, E0740.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/union/union-unsized.mirunsafeck.stderr b/tests/ui/union/union-unsized.mirunsafeck.stderr
index 59ab835fba2..f8da20413b2 100644
--- a/tests/ui/union/union-unsized.mirunsafeck.stderr
+++ b/tests/ui/union/union-unsized.mirunsafeck.stderr
@@ -17,7 +17,7 @@ LL |     a: Box<str>,
    |        ++++   +
 
 error[E0277]: the size for values of type `str` cannot be known at compilation time
-  --> $DIR/union-unsized.rs:13:8
+  --> $DIR/union-unsized.rs:14:8
    |
 LL |     b: str,
    |        ^^^ doesn't have a size known at compile-time
@@ -34,6 +34,31 @@ help: the `Box` type always has a statically known size and allocates its conten
 LL |     b: Box<str>,
    |        ++++   +
 
-error: aborting due to 2 previous errors
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
+  --> $DIR/union-unsized.rs:5:5
+   |
+LL |     a: str,
+   |     ^^^^^^
+   |
+   = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
+   |
+LL |     a: std::mem::ManuallyDrop<str>,
+   |        +++++++++++++++++++++++   +
+
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
+  --> $DIR/union-unsized.rs:14:5
+   |
+LL |     b: str,
+   |     ^^^^^^
+   |
+   = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
+   |
+LL |     b: std::mem::ManuallyDrop<str>,
+   |        +++++++++++++++++++++++   +
+
+error: aborting due to 4 previous errors
 
-For more information about this error, try `rustc --explain E0277`.
+Some errors have detailed explanations: E0277, E0740.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/union/union-unsized.rs b/tests/ui/union/union-unsized.rs
index 8e897d7d3c6..b95b2e414f3 100644
--- a/tests/ui/union/union-unsized.rs
+++ b/tests/ui/union/union-unsized.rs
@@ -4,6 +4,7 @@
 union U {
     a: str,
     //~^ ERROR the size for values of type
+    //~| ERROR field must implement `Copy`
 
     b: u8,
 }
@@ -12,6 +13,7 @@ union W {
     a: u8,
     b: str,
     //~^ ERROR the size for values of type
+    //~| ERROR field must implement `Copy`
 }
 
 fn main() {}
diff --git a/tests/ui/union/union-unsized.thirunsafeck.stderr b/tests/ui/union/union-unsized.thirunsafeck.stderr
index 59ab835fba2..f8da20413b2 100644
--- a/tests/ui/union/union-unsized.thirunsafeck.stderr
+++ b/tests/ui/union/union-unsized.thirunsafeck.stderr
@@ -17,7 +17,7 @@ LL |     a: Box<str>,
    |        ++++   +
 
 error[E0277]: the size for values of type `str` cannot be known at compilation time
-  --> $DIR/union-unsized.rs:13:8
+  --> $DIR/union-unsized.rs:14:8
    |
 LL |     b: str,
    |        ^^^ doesn't have a size known at compile-time
@@ -34,6 +34,31 @@ help: the `Box` type always has a statically known size and allocates its conten
 LL |     b: Box<str>,
    |        ++++   +
 
-error: aborting due to 2 previous errors
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
+  --> $DIR/union-unsized.rs:5:5
+   |
+LL |     a: str,
+   |     ^^^^^^
+   |
+   = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
+   |
+LL |     a: std::mem::ManuallyDrop<str>,
+   |        +++++++++++++++++++++++   +
+
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
+  --> $DIR/union-unsized.rs:14:5
+   |
+LL |     b: str,
+   |     ^^^^^^
+   |
+   = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
+   |
+LL |     b: std::mem::ManuallyDrop<str>,
+   |        +++++++++++++++++++++++   +
+
+error: aborting due to 4 previous errors
 
-For more information about this error, try `rustc --explain E0277`.
+Some errors have detailed explanations: E0277, E0740.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/tests/ui/unsized/unsized-trait-impl-self-type.rs b/tests/ui/unsized/unsized-trait-impl-self-type.rs
index df571a83382..603c0a221ec 100644
--- a/tests/ui/unsized/unsized-trait-impl-self-type.rs
+++ b/tests/ui/unsized/unsized-trait-impl-self-type.rs
@@ -9,6 +9,7 @@ struct S5<Y>(Y);
 
 impl<X: ?Sized> T3<X> for S5<X> {
     //~^ ERROR the size for values of type
+    //~| ERROR not all trait items implemented
 }
 
 fn main() { }
diff --git a/tests/ui/unsized/unsized-trait-impl-self-type.stderr b/tests/ui/unsized/unsized-trait-impl-self-type.stderr
index 4955d463fc2..5bc8dc590ca 100644
--- a/tests/ui/unsized/unsized-trait-impl-self-type.stderr
+++ b/tests/ui/unsized/unsized-trait-impl-self-type.stderr
@@ -24,6 +24,16 @@ LL - impl<X: ?Sized> T3<X> for S5<X> {
 LL + impl<X> T3<X> for S5<X> {
    |
 
-error: aborting due to previous error
+error[E0046]: not all trait items implemented, missing: `foo`
+  --> $DIR/unsized-trait-impl-self-type.rs:10:1
+   |
+LL |     fn foo(&self, z: &Z);
+   |     --------------------- `foo` from trait
+...
+LL | impl<X: ?Sized> T3<X> for S5<X> {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0277`.
+Some errors have detailed explanations: E0046, E0277.
+For more information about an error, try `rustc --explain E0046`.
diff --git a/tests/ui/unsized/unsized-trait-impl-trait-arg.rs b/tests/ui/unsized/unsized-trait-impl-trait-arg.rs
index 96e7e371f2a..e7602b175c8 100644
--- a/tests/ui/unsized/unsized-trait-impl-trait-arg.rs
+++ b/tests/ui/unsized/unsized-trait-impl-trait-arg.rs
@@ -7,6 +7,7 @@ trait T2<Z> {
 struct S4<Y: ?Sized>(Box<Y>);
 impl<X: ?Sized> T2<X> for S4<X> {
     //~^ ERROR the size for values of type
+    //~| ERROR not all trait items implemented
 }
 
 fn main() { }
diff --git a/tests/ui/unsized/unsized-trait-impl-trait-arg.stderr b/tests/ui/unsized/unsized-trait-impl-trait-arg.stderr
index 8761c293af4..e9353d2bbd9 100644
--- a/tests/ui/unsized/unsized-trait-impl-trait-arg.stderr
+++ b/tests/ui/unsized/unsized-trait-impl-trait-arg.stderr
@@ -21,6 +21,16 @@ help: consider relaxing the implicit `Sized` restriction
 LL | trait T2<Z: ?Sized> {
    |           ++++++++
 
-error: aborting due to previous error
+error[E0046]: not all trait items implemented, missing: `foo`
+  --> $DIR/unsized-trait-impl-trait-arg.rs:8:1
+   |
+LL |     fn foo(&self, z: Z);
+   |     -------------------- `foo` from trait
+...
+LL | impl<X: ?Sized> T2<X> for S4<X> {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `foo` in implementation
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0277`.
+Some errors have detailed explanations: E0046, E0277.
+For more information about an error, try `rustc --explain E0046`.
diff --git a/tests/ui/unsized/unsized7.rs b/tests/ui/unsized/unsized7.rs
index 422a784814e..63e015c28d3 100644
--- a/tests/ui/unsized/unsized7.rs
+++ b/tests/ui/unsized/unsized7.rs
@@ -11,6 +11,7 @@ trait T1<Z: T> {
 struct S3<Y: ?Sized>(Box<Y>);
 impl<X: ?Sized + T> T1<X> for S3<X> {
     //~^ ERROR the size for values of type
+    //~| ERROR not all trait items implemented
 }
 
 fn main() { }
diff --git a/tests/ui/unsized/unsized7.stderr b/tests/ui/unsized/unsized7.stderr
index c313a2724c0..2edde159653 100644
--- a/tests/ui/unsized/unsized7.stderr
+++ b/tests/ui/unsized/unsized7.stderr
@@ -21,6 +21,16 @@ help: consider relaxing the implicit `Sized` restriction
 LL | trait T1<Z: T + ?Sized> {
    |               ++++++++
 
-error: aborting due to previous error
+error[E0046]: not all trait items implemented, missing: `dummy`
+  --> $DIR/unsized7.rs:12:1
+   |
+LL |     fn dummy(&self) -> Z;
+   |     --------------------- `dummy` from trait
+...
+LL | impl<X: ?Sized + T> T1<X> for S3<X> {
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `dummy` in implementation
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0277`.
+Some errors have detailed explanations: E0046, E0277.
+For more information about an error, try `rustc --explain E0046`.
diff --git a/tests/ui/wf/hir-wf-check-erase-regions.rs b/tests/ui/wf/hir-wf-check-erase-regions.rs
index 3855f2c35c1..2820d5f6d07 100644
--- a/tests/ui/wf/hir-wf-check-erase-regions.rs
+++ b/tests/ui/wf/hir-wf-check-erase-regions.rs
@@ -5,6 +5,7 @@ pub struct Table<T, const N: usize>([Option<T>; N]);
 
 impl<'a, T, const N: usize> IntoIterator for &'a Table<T, N> {
     type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>; //~ ERROR `&'a T` is not an iterator
+    //~^ ERROR `&'a T` is not an iterator
     type Item = &'a T;
 
     fn into_iter(self) -> Self::IntoIter { //~ ERROR `&'a T` is not an iterator
diff --git a/tests/ui/wf/hir-wf-check-erase-regions.stderr b/tests/ui/wf/hir-wf-check-erase-regions.stderr
index 2843983c716..eb0a8f8f69a 100644
--- a/tests/ui/wf/hir-wf-check-erase-regions.stderr
+++ b/tests/ui/wf/hir-wf-check-erase-regions.stderr
@@ -11,7 +11,7 @@ note: required by a bound in `Flatten`
   --> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL
 
 error[E0277]: `&'a T` is not an iterator
-  --> $DIR/hir-wf-check-erase-regions.rs:10:27
+  --> $DIR/hir-wf-check-erase-regions.rs:11:27
    |
 LL |     fn into_iter(self) -> Self::IntoIter {
    |                           ^^^^^^^^^^^^^^ `&'a T` is not an iterator
@@ -22,6 +22,18 @@ LL |     fn into_iter(self) -> Self::IntoIter {
 note: required by a bound in `Flatten`
   --> $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL
 
-error: aborting due to 2 previous errors
+error[E0277]: `&'a T` is not an iterator
+  --> $DIR/hir-wf-check-erase-regions.rs:7:21
+   |
+LL |     type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>;
+   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'a T` is not an iterator
+   |
+   = help: the trait `Iterator` is not implemented for `&'a T`
+   = help: the trait `Iterator` is implemented for `&mut I`
+   = note: required for `Flatten<std::slice::Iter<'a, T>>` to implement `Iterator`
+note: required by a bound in `std::iter::IntoIterator::IntoIter`
+  --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
+
+error: aborting due to 3 previous errors
 
 For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/wf/issue-110157.rs b/tests/ui/wf/issue-110157.rs
index 43a8ce72ff1..07e2c5d58c3 100644
--- a/tests/ui/wf/issue-110157.rs
+++ b/tests/ui/wf/issue-110157.rs
@@ -2,6 +2,7 @@ struct NeedsDropTypes<'tcx, F>(std::marker::PhantomData<&'tcx F>);
 
 impl<'tcx, F, I> Iterator for NeedsDropTypes<'tcx, F>
 //~^ ERROR type annotations needed
+//~| ERROR not all trait items implemented
 where
     F: Fn(&Missing) -> Result<I, ()>,
     //~^ ERROR cannot find type `Missing` in this scope
diff --git a/tests/ui/wf/issue-110157.stderr b/tests/ui/wf/issue-110157.stderr
index 91d801e9470..16bd34a6d8e 100644
--- a/tests/ui/wf/issue-110157.stderr
+++ b/tests/ui/wf/issue-110157.stderr
@@ -1,11 +1,11 @@
 error[E0412]: cannot find type `Missing` in this scope
-  --> $DIR/issue-110157.rs:6:12
+  --> $DIR/issue-110157.rs:7:12
    |
 LL |     F: Fn(&Missing) -> Result<I, ()>,
    |            ^^^^^^^ not found in this scope
 
 error[E0412]: cannot find type `Missing` in this scope
-  --> $DIR/issue-110157.rs:8:24
+  --> $DIR/issue-110157.rs:9:24
    |
 LL |     I: Iterator<Item = Missing>,
    |                        ^^^^^^^ not found in this scope
@@ -26,7 +26,22 @@ LL | impl<'tcx, F, I> Iterator for NeedsDropTypes<'tcx, F>
 LL |     I: Iterator<Item = Missing>,
    |        ------------------------ unsatisfied trait bound introduced here
 
-error: aborting due to 3 previous errors
+error[E0046]: not all trait items implemented, missing: `Item`, `next`
+  --> $DIR/issue-110157.rs:3:1
+   |
+LL | / impl<'tcx, F, I> Iterator for NeedsDropTypes<'tcx, F>
+LL | |
+LL | |
+LL | | where
+LL | |     F: Fn(&Missing) -> Result<I, ()>,
+LL | |
+LL | |     I: Iterator<Item = Missing>,
+   | |________________________________^ missing `Item`, `next` in implementation
+   |
+   = help: implement the missing item: `type Item = /* Type */;`
+   = help: implement the missing item: `fn next(&mut self) -> Option<<Self as Iterator>::Item> { todo!() }`
+
+error: aborting due to 4 previous errors
 
-Some errors have detailed explanations: E0283, E0412.
-For more information about an error, try `rustc --explain E0283`.
+Some errors have detailed explanations: E0046, E0283, E0412.
+For more information about an error, try `rustc --explain E0046`.
diff --git a/tests/ui/wf/wf-const-type.rs b/tests/ui/wf/wf-const-type.rs
index df79aa26712..64b0d9c8de7 100644
--- a/tests/ui/wf/wf-const-type.rs
+++ b/tests/ui/wf/wf-const-type.rs
@@ -9,6 +9,7 @@ struct NotCopy;
 
 const FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
 //~^ ERROR E0277
+//~| ERROR E0277
 
 
 fn main() { }
diff --git a/tests/ui/wf/wf-const-type.stderr b/tests/ui/wf/wf-const-type.stderr
index 617969720a6..039e907705e 100644
--- a/tests/ui/wf/wf-const-type.stderr
+++ b/tests/ui/wf/wf-const-type.stderr
@@ -16,6 +16,24 @@ LL + #[derive(Copy)]
 LL | struct NotCopy;
    |
 
-error: aborting due to previous error
+error[E0277]: the trait bound `NotCopy: Copy` is not satisfied
+  --> $DIR/wf-const-type.rs:10:50
+   |
+LL | const FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
+   |                                                  ^^^^ the trait `Copy` is not implemented for `NotCopy`
+   |
+   = note: required for `Option<NotCopy>` to implement `Copy`
+note: required by a bound in `IsCopy`
+  --> $DIR/wf-const-type.rs:7:17
+   |
+LL | struct IsCopy<T:Copy> { t: T }
+   |                 ^^^^ required by this bound in `IsCopy`
+help: consider annotating `NotCopy` with `#[derive(Copy)]`
+   |
+LL + #[derive(Copy)]
+LL | struct NotCopy;
+   |
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/wf/wf-static-type.rs b/tests/ui/wf/wf-static-type.rs
index 1c35e1daf44..f454fe30e77 100644
--- a/tests/ui/wf/wf-static-type.rs
+++ b/tests/ui/wf/wf-static-type.rs
@@ -9,6 +9,7 @@ struct NotCopy;
 
 static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
 //~^ ERROR E0277
+//~| ERROR E0277
 
 
 fn main() { }
diff --git a/tests/ui/wf/wf-static-type.stderr b/tests/ui/wf/wf-static-type.stderr
index bb5a57834eb..65dae260143 100644
--- a/tests/ui/wf/wf-static-type.stderr
+++ b/tests/ui/wf/wf-static-type.stderr
@@ -16,6 +16,24 @@ LL + #[derive(Copy)]
 LL | struct NotCopy;
    |
 
-error: aborting due to previous error
+error[E0277]: the trait bound `NotCopy: Copy` is not satisfied
+  --> $DIR/wf-static-type.rs:10:51
+   |
+LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None };
+   |                                                   ^^^^ the trait `Copy` is not implemented for `NotCopy`
+   |
+   = note: required for `Option<NotCopy>` to implement `Copy`
+note: required by a bound in `IsCopy`
+  --> $DIR/wf-static-type.rs:7:17
+   |
+LL | struct IsCopy<T:Copy> { t: T }
+   |                 ^^^^ required by this bound in `IsCopy`
+help: consider annotating `NotCopy` with `#[derive(Copy)]`
+   |
+LL + #[derive(Copy)]
+LL | struct NotCopy;
+   |
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0277`.