about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-12-22 05:29:45 +0000
committerbors <bors@rust-lang.org>2024-12-22 05:29:45 +0000
commita2bcfae5c5d05dd7806a79194cda39108ed6cd7d (patch)
tree6d0a6fd8975fc2c731d6ae666db72e63e94f1913
parentc1132470a6986b12503e8000e322e9164c1f03ac (diff)
parent66dbfd4af3069cc2454a982e441aecd1a21616ae (diff)
downloadrust-a2bcfae5c5d05dd7806a79194cda39108ed6cd7d.tar.gz
rust-a2bcfae5c5d05dd7806a79194cda39108ed6cd7d.zip
Auto merge of #134640 - matthiaskrgr:rollup-xlstm3o, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #134364 (Use E0665 for missing `#[default]` on enum and update doc)
 - #134601 (Support pretty-printing `dyn*` trait objects)
 - #134603 (Explain why a type is not eligible for `impl PointerLike`.)
 - #134618 (coroutine_clone: add comments)
 - #134630 (Use `&raw` for `ptr` primitive docs)
 - #134637 (Flatten effects directory now that it doesn't really test anything specific)

r? `@ghost`
`@rustbot` modify labels: rollup
-rw-r--r--compiler/rustc_ast_pretty/src/pprust/state.rs6
-rw-r--r--compiler/rustc_builtin_macros/messages.ftl6
-rw-r--r--compiler/rustc_builtin_macros/src/deriving/default.rs13
-rw-r--r--compiler/rustc_builtin_macros/src/errors.rs13
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0665.md25
-rw-r--r--compiler/rustc_hir_analysis/src/coherence/builtin.rs100
-rw-r--r--compiler/rustc_hir_pretty/src/lib.rs6
-rw-r--r--compiler/rustc_middle/src/mir/syntax.rs5
-rw-r--r--library/core/src/primitive_docs.rs10
-rw-r--r--tests/ui-fulldeps/pprust-parenthesis-insertion.rs4
-rw-r--r--tests/ui/coroutine/clone-impl-static.rs2
-rw-r--r--tests/ui/coroutine/clone-impl-static.stderr16
-rw-r--r--tests/ui/dyn-star/pointer-like-impl-rules.rs82
-rw-r--r--tests/ui/dyn-star/pointer-like-impl-rules.stderr85
-rw-r--r--tests/ui/macros/macros-nonfatal-errors.rs8
-rw-r--r--tests/ui/macros/macros-nonfatal-errors.stderr82
-rw-r--r--tests/ui/suggestions/wrap-dyn-in-suggestion-issue-120223.stderr6
-rw-r--r--tests/ui/traits/const-traits/auxiliary/minicore.rs (renamed from tests/ui/traits/const-traits/effects/auxiliary/minicore.rs)0
-rw-r--r--tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs (renamed from tests/ui/traits/const-traits/effects/const_closure-const_trait_impl-ice-113381.rs)0
-rw-r--r--tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.stderr (renamed from tests/ui/traits/const-traits/effects/const_closure-const_trait_impl-ice-113381.stderr)0
-rw-r--r--tests/ui/traits/const-traits/dont-prefer-param-env-for-infer-self-ty.rs (renamed from tests/ui/traits/const-traits/effects/dont-prefer-param-env-for-infer-self-ty.rs)0
-rw-r--r--tests/ui/traits/const-traits/effect-param-infer.rs (renamed from tests/ui/traits/const-traits/effects/effect-param-infer.rs)0
-rw-r--r--tests/ui/traits/const-traits/effects/auxiliary/cross-crate.rs13
-rw-r--r--tests/ui/traits/const-traits/effects/no-explicit-const-params-cross-crate.rs18
-rw-r--r--tests/ui/traits/const-traits/effects/no-explicit-const-params-cross-crate.stderr59
-rw-r--r--tests/ui/traits/const-traits/fallback.rs (renamed from tests/ui/traits/const-traits/effects/fallback.rs)0
-rw-r--r--tests/ui/traits/const-traits/group-traits.rs (renamed from tests/ui/traits/const-traits/effects/group-traits.rs)0
-rw-r--r--tests/ui/traits/const-traits/ice-112822-expected-type-for-param.rs (renamed from tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.rs)0
-rw-r--r--tests/ui/traits/const-traits/ice-112822-expected-type-for-param.stderr (renamed from tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.stderr)0
-rw-r--r--tests/ui/traits/const-traits/ice-113375-index-out-of-bounds-generics.rs (renamed from tests/ui/traits/const-traits/effects/ice-113375-index-out-of-bounds-generics.rs)0
-rw-r--r--tests/ui/traits/const-traits/infer-fallback.rs (renamed from tests/ui/traits/const-traits/effects/infer-fallback.rs)0
-rw-r--r--tests/ui/traits/const-traits/minicore-const-fn-early-bound.rs (renamed from tests/ui/traits/const-traits/effects/minicore-const-fn-early-bound.rs)0
-rw-r--r--tests/ui/traits/const-traits/minicore-deref-fail.rs (renamed from tests/ui/traits/const-traits/effects/minicore-deref-fail.rs)0
-rw-r--r--tests/ui/traits/const-traits/minicore-deref-fail.stderr (renamed from tests/ui/traits/const-traits/effects/minicore-deref-fail.stderr)0
-rw-r--r--tests/ui/traits/const-traits/minicore-drop-fail.rs (renamed from tests/ui/traits/const-traits/effects/minicore-drop-fail.rs)0
-rw-r--r--tests/ui/traits/const-traits/minicore-drop-fail.stderr (renamed from tests/ui/traits/const-traits/effects/minicore-drop-fail.stderr)0
-rw-r--r--tests/ui/traits/const-traits/minicore-drop-without-feature-gate.no.stderr (renamed from tests/ui/traits/const-traits/effects/minicore-drop-without-feature-gate.no.stderr)0
-rw-r--r--tests/ui/traits/const-traits/minicore-drop-without-feature-gate.rs (renamed from tests/ui/traits/const-traits/effects/minicore-drop-without-feature-gate.rs)0
-rw-r--r--tests/ui/traits/const-traits/minicore-fn-fail.rs (renamed from tests/ui/traits/const-traits/effects/minicore-fn-fail.rs)0
-rw-r--r--tests/ui/traits/const-traits/minicore-fn-fail.stderr (renamed from tests/ui/traits/const-traits/effects/minicore-fn-fail.stderr)0
-rw-r--r--tests/ui/traits/const-traits/minicore-works.rs (renamed from tests/ui/traits/const-traits/effects/minicore-works.rs)0
-rw-r--r--tests/ui/traits/const-traits/mismatched_generic_args.rs (renamed from tests/ui/traits/const-traits/effects/mismatched_generic_args.rs)0
-rw-r--r--tests/ui/traits/const-traits/mismatched_generic_args.stderr (renamed from tests/ui/traits/const-traits/effects/mismatched_generic_args.stderr)0
-rw-r--r--tests/ui/traits/const-traits/no-explicit-const-params.rs (renamed from tests/ui/traits/const-traits/effects/no-explicit-const-params.rs)0
-rw-r--r--tests/ui/traits/const-traits/no-explicit-const-params.stderr (renamed from tests/ui/traits/const-traits/effects/no-explicit-const-params.stderr)0
-rw-r--r--tests/ui/traits/const-traits/project.rs (renamed from tests/ui/traits/const-traits/effects/project.rs)0
-rw-r--r--tests/ui/traits/const-traits/span-bug-issue-121418.rs (renamed from tests/ui/traits/const-traits/effects/span-bug-issue-121418.rs)0
-rw-r--r--tests/ui/traits/const-traits/span-bug-issue-121418.stderr (renamed from tests/ui/traits/const-traits/effects/span-bug-issue-121418.stderr)0
-rw-r--r--tests/ui/traits/const-traits/spec-effectvar-ice.rs (renamed from tests/ui/traits/const-traits/effects/spec-effectvar-ice.rs)0
-rw-r--r--tests/ui/traits/const-traits/spec-effectvar-ice.stderr (renamed from tests/ui/traits/const-traits/effects/spec-effectvar-ice.stderr)0
-rw-r--r--tests/ui/traits/const-traits/trait-fn-const.rs (renamed from tests/ui/traits/const-traits/effects/trait-fn-const.rs)0
-rw-r--r--tests/ui/traits/const-traits/trait-fn-const.stderr (renamed from tests/ui/traits/const-traits/effects/trait-fn-const.stderr)0
-rw-r--r--tests/ui/unpretty/expanded-exhaustive.rs2
-rw-r--r--tests/ui/unpretty/expanded-exhaustive.stdout2
54 files changed, 366 insertions, 197 deletions
diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs
index 24c1c0f221e..172df102929 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state.rs
@@ -1204,8 +1204,10 @@ impl<'a> State<'a> {
             }
             ast::TyKind::Path(Some(qself), path) => self.print_qpath(path, qself, false),
             ast::TyKind::TraitObject(bounds, syntax) => {
-                if *syntax == ast::TraitObjectSyntax::Dyn {
-                    self.word_nbsp("dyn");
+                match syntax {
+                    ast::TraitObjectSyntax::Dyn => self.word_nbsp("dyn"),
+                    ast::TraitObjectSyntax::DynStar => self.word_nbsp("dyn*"),
+                    ast::TraitObjectSyntax::None => {}
                 }
                 self.print_type_bounds(bounds);
             }
diff --git a/compiler/rustc_builtin_macros/messages.ftl b/compiler/rustc_builtin_macros/messages.ftl
index 87d3d288013..7a31d2a2239 100644
--- a/compiler/rustc_builtin_macros/messages.ftl
+++ b/compiler/rustc_builtin_macros/messages.ftl
@@ -249,9 +249,9 @@ builtin_macros_naked_functions_testing_attribute =
     .label = function marked with testing attribute here
     .naked_attribute = `#[naked]` is incompatible with testing attributes
 
-builtin_macros_no_default_variant = no default declared
-    .help = make a unit variant default by placing `#[default]` above it
-    .suggestion = make `{$ident}` default
+builtin_macros_no_default_variant = `#[derive(Default)]` on enum with no `#[default]`
+    .label = this enum needs a unit variant marked with `#[default]`
+    .suggestion = make this unit variant default by placing `#[default]` on it
 
 builtin_macros_non_abi = at least one abi must be provided as an argument to `clobber_abi`
 
diff --git a/compiler/rustc_builtin_macros/src/deriving/default.rs b/compiler/rustc_builtin_macros/src/deriving/default.rs
index a7d9f608cbd..3c7bebd0f19 100644
--- a/compiler/rustc_builtin_macros/src/deriving/default.rs
+++ b/compiler/rustc_builtin_macros/src/deriving/default.rs
@@ -42,7 +42,9 @@ pub(crate) fn expand_deriving_default(
                     StaticStruct(_, fields) => {
                         default_struct_substructure(cx, trait_span, substr, fields)
                     }
-                    StaticEnum(enum_def, _) => default_enum_substructure(cx, trait_span, enum_def),
+                    StaticEnum(enum_def, _) => {
+                        default_enum_substructure(cx, trait_span, enum_def, item.span())
+                    }
                     _ => cx.dcx().span_bug(trait_span, "method in `derive(Default)`"),
                 }
             })),
@@ -96,9 +98,10 @@ fn default_enum_substructure(
     cx: &ExtCtxt<'_>,
     trait_span: Span,
     enum_def: &EnumDef,
+    item_span: Span,
 ) -> BlockOrExpr {
     let expr = match try {
-        let default_variant = extract_default_variant(cx, enum_def, trait_span)?;
+        let default_variant = extract_default_variant(cx, enum_def, trait_span, item_span)?;
         validate_default_attribute(cx, default_variant)?;
         default_variant
     } {
@@ -146,6 +149,7 @@ fn extract_default_variant<'a>(
     cx: &ExtCtxt<'_>,
     enum_def: &'a EnumDef,
     trait_span: Span,
+    item_span: Span,
 ) -> Result<&'a rustc_ast::Variant, ErrorGuaranteed> {
     let default_variants: SmallVec<[_; 1]> = enum_def
         .variants
@@ -163,9 +167,10 @@ fn extract_default_variant<'a>(
                 .filter(|variant| !attr::contains_name(&variant.attrs, sym::non_exhaustive));
 
             let suggs = possible_defaults
-                .map(|v| errors::NoDefaultVariantSugg { span: v.span, ident: v.ident })
+                .map(|v| errors::NoDefaultVariantSugg { span: v.span.shrink_to_lo() })
                 .collect();
-            let guar = cx.dcx().emit_err(errors::NoDefaultVariant { span: trait_span, suggs });
+            let guar =
+                cx.dcx().emit_err(errors::NoDefaultVariant { span: trait_span, item_span, suggs });
 
             return Err(guar);
         }
diff --git a/compiler/rustc_builtin_macros/src/errors.rs b/compiler/rustc_builtin_macros/src/errors.rs
index b3198e7743d..1abdfdb9c65 100644
--- a/compiler/rustc_builtin_macros/src/errors.rs
+++ b/compiler/rustc_builtin_macros/src/errors.rs
@@ -369,26 +369,21 @@ pub(crate) struct DerivePathArgsValue {
 }
 
 #[derive(Diagnostic)]
-#[diag(builtin_macros_no_default_variant)]
-#[help]
+#[diag(builtin_macros_no_default_variant, code = E0665)]
 pub(crate) struct NoDefaultVariant {
     #[primary_span]
     pub(crate) span: Span,
+    #[label]
+    pub(crate) item_span: Span,
     #[subdiagnostic]
     pub(crate) suggs: Vec<NoDefaultVariantSugg>,
 }
 
 #[derive(Subdiagnostic)]
-#[suggestion(
-    builtin_macros_suggestion,
-    code = "#[default] {ident}",
-    applicability = "maybe-incorrect",
-    style = "tool-only"
-)]
+#[suggestion(builtin_macros_suggestion, code = "#[default] ", applicability = "maybe-incorrect")]
 pub(crate) struct NoDefaultVariantSugg {
     #[primary_span]
     pub(crate) span: Span,
-    pub(crate) ident: Ident,
 }
 
 #[derive(Diagnostic)]
diff --git a/compiler/rustc_error_codes/src/error_codes/E0665.md b/compiler/rustc_error_codes/src/error_codes/E0665.md
index ae54d6d1579..caa94423377 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0665.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0665.md
@@ -1,10 +1,9 @@
-#### Note: this error code is no longer emitted by the compiler.
-
-The `Default` trait was derived on an enum.
+The `Default` trait was derived on an enum without specifying the default
+variant.
 
 Erroneous code example:
 
-```compile_fail
+```compile_fail,E0665
 #[derive(Default)]
 enum Food {
     Sweet,
@@ -16,18 +15,30 @@ The `Default` cannot be derived on an enum for the simple reason that the
 compiler doesn't know which value to pick by default whereas it can for a
 struct as long as all its fields implement the `Default` trait as well.
 
-If you still want to implement `Default` on your enum, you'll have to do it "by
-hand":
+For the case where the desired default variant has no payload, you can
+annotate it with `#[default]` to derive it:
 
 ```
+#[derive(Default)]
 enum Food {
+    #[default]
     Sweet,
     Salty,
 }
+```
+
+In the case where the default variant does have a payload, you will have to
+implement `Default` on your enum manually:
+
+```
+enum Food {
+    Sweet(i32),
+    Salty,
+}
 
 impl Default for Food {
     fn default() -> Food {
-        Food::Sweet
+        Food::Sweet(1)
     }
 }
 ```
diff --git a/compiler/rustc_hir_analysis/src/coherence/builtin.rs b/compiler/rustc_hir_analysis/src/coherence/builtin.rs
index 2eea65125b0..3b98f358b1e 100644
--- a/compiler/rustc_hir_analysis/src/coherence/builtin.rs
+++ b/compiler/rustc_hir_analysis/src/coherence/builtin.rs
@@ -673,37 +673,6 @@ fn visit_implementation_of_pointer_like(checker: &Checker<'_>) -> Result<(), Err
     let impl_span = tcx.def_span(checker.impl_def_id);
     let self_ty = tcx.impl_trait_ref(checker.impl_def_id).unwrap().instantiate_identity().self_ty();
 
-    // If an ADT is repr(transparent)...
-    if let ty::Adt(def, args) = *self_ty.kind()
-        && def.repr().transparent()
-    {
-        // FIXME(compiler-errors): This should and could be deduplicated into a query.
-        // Find the nontrivial field.
-        let adt_typing_env = ty::TypingEnv::non_body_analysis(tcx, def.did());
-        let nontrivial_field = def.all_fields().find(|field_def| {
-            let field_ty = tcx.type_of(field_def.did).instantiate_identity();
-            !tcx.layout_of(adt_typing_env.as_query_input(field_ty))
-                .is_ok_and(|layout| layout.layout.is_1zst())
-        });
-
-        if let Some(nontrivial_field) = nontrivial_field {
-            // Check that the nontrivial field implements `PointerLike`.
-            let nontrivial_field = nontrivial_field.ty(tcx, args);
-            let (infcx, param_env) = tcx.infer_ctxt().build_with_typing_env(typing_env);
-            let ocx = ObligationCtxt::new(&infcx);
-            ocx.register_bound(
-                ObligationCause::misc(impl_span, checker.impl_def_id),
-                param_env,
-                nontrivial_field,
-                tcx.lang_items().pointer_like().unwrap(),
-            );
-            // FIXME(dyn-star): We should regionck this implementation.
-            if ocx.select_all_or_error().is_empty() {
-                return Ok(());
-            }
-        }
-    }
-
     let is_permitted_primitive = match *self_ty.kind() {
         ty::Adt(def, _) => def.is_box(),
         ty::Uint(..) | ty::Int(..) | ty::RawPtr(..) | ty::Ref(..) | ty::FnPtr(..) => true,
@@ -717,6 +686,74 @@ fn visit_implementation_of_pointer_like(checker: &Checker<'_>) -> Result<(), Err
         return Ok(());
     }
 
+    let why_disqualified = match *self_ty.kind() {
+        // If an ADT is repr(transparent)
+        ty::Adt(self_ty_def, args) => {
+            if self_ty_def.repr().transparent() {
+                // FIXME(compiler-errors): This should and could be deduplicated into a query.
+                // Find the nontrivial field.
+                let adt_typing_env = ty::TypingEnv::non_body_analysis(tcx, self_ty_def.did());
+                let nontrivial_field = self_ty_def.all_fields().find(|field_def| {
+                    let field_ty = tcx.type_of(field_def.did).instantiate_identity();
+                    !tcx.layout_of(adt_typing_env.as_query_input(field_ty))
+                        .is_ok_and(|layout| layout.layout.is_1zst())
+                });
+
+                if let Some(nontrivial_field) = nontrivial_field {
+                    // Check that the nontrivial field implements `PointerLike`.
+                    let nontrivial_field_ty = nontrivial_field.ty(tcx, args);
+                    let (infcx, param_env) = tcx.infer_ctxt().build_with_typing_env(typing_env);
+                    let ocx = ObligationCtxt::new(&infcx);
+                    ocx.register_bound(
+                        ObligationCause::misc(impl_span, checker.impl_def_id),
+                        param_env,
+                        nontrivial_field_ty,
+                        tcx.lang_items().pointer_like().unwrap(),
+                    );
+                    // FIXME(dyn-star): We should regionck this implementation.
+                    if ocx.select_all_or_error().is_empty() {
+                        return Ok(());
+                    } else {
+                        format!(
+                            "the field `{field_name}` of {descr} `{self_ty}` \
+                    does not implement `PointerLike`",
+                            field_name = nontrivial_field.name,
+                            descr = self_ty_def.descr()
+                        )
+                    }
+                } else {
+                    format!(
+                        "the {descr} `{self_ty}` is `repr(transparent)`, \
+                but does not have a non-trivial field (it is zero-sized)",
+                        descr = self_ty_def.descr()
+                    )
+                }
+            } else if self_ty_def.is_box() {
+                // If we got here, then the `layout.is_pointer_like()` check failed
+                // and this box is not a thin pointer.
+
+                String::from("boxes of dynamically-sized types are too large to be `PointerLike`")
+            } else {
+                format!(
+                    "the {descr} `{self_ty}` is not `repr(transparent)`",
+                    descr = self_ty_def.descr()
+                )
+            }
+        }
+        ty::Ref(..) => {
+            // If we got here, then the `layout.is_pointer_like()` check failed
+            // and this reference is not a thin pointer.
+            String::from("references to dynamically-sized types are too large to be `PointerLike`")
+        }
+        ty::Dynamic(..) | ty::Foreign(..) => {
+            String::from("types of dynamic or unknown size may not implement `PointerLike`")
+        }
+        _ => {
+            // This is a white lie; it is true everywhere outside the standard library.
+            format!("only user-defined sized types are eligible for `impl PointerLike`")
+        }
+    };
+
     Err(tcx
         .dcx()
         .struct_span_err(
@@ -724,5 +761,6 @@ fn visit_implementation_of_pointer_like(checker: &Checker<'_>) -> Result<(), Err
             "implementation must be applied to type that has the same ABI as a pointer, \
             or is `repr(transparent)` and whose field is `PointerLike`",
         )
+        .with_note(why_disqualified)
         .emit())
 }
diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs
index de2a7726e9b..5c1c5892190 100644
--- a/compiler/rustc_hir_pretty/src/lib.rs
+++ b/compiler/rustc_hir_pretty/src/lib.rs
@@ -402,8 +402,10 @@ impl<'a> State<'a> {
             }
             hir::TyKind::Path(ref qpath) => self.print_qpath(qpath, false),
             hir::TyKind::TraitObject(bounds, lifetime, syntax) => {
-                if syntax == ast::TraitObjectSyntax::Dyn {
-                    self.word_space("dyn");
+                match syntax {
+                    ast::TraitObjectSyntax::Dyn => self.word_nbsp("dyn"),
+                    ast::TraitObjectSyntax::DynStar => self.word_nbsp("dyn*"),
+                    ast::TraitObjectSyntax::None => {}
                 }
                 let mut first = true;
                 for bound in bounds {
diff --git a/compiler/rustc_middle/src/mir/syntax.rs b/compiler/rustc_middle/src/mir/syntax.rs
index b7ece5ffa62..0c17a2e0fe5 100644
--- a/compiler/rustc_middle/src/mir/syntax.rs
+++ b/compiler/rustc_middle/src/mir/syntax.rs
@@ -821,6 +821,11 @@ pub enum TerminatorKind<'tcx> {
     /// continues at the `resume` basic block, with the second argument written to the `resume_arg`
     /// place. If the coroutine is dropped before then, the `drop` basic block is invoked.
     ///
+    /// Note that coroutines can be (unstably) cloned under certain conditions, which means that
+    /// this terminator can **return multiple times**! MIR optimizations that reorder code into
+    /// different basic blocks needs to be aware of that.
+    /// See <https://github.com/rust-lang/rust/issues/95360>.
+    ///
     /// Not permitted in bodies that are not coroutine bodies, or after coroutine lowering.
     ///
     /// **Needs clarification**: What about the evaluation order of the `resume_arg` and `value`?
diff --git a/library/core/src/primitive_docs.rs b/library/core/src/primitive_docs.rs
index e105ceadff7..c5f029363e5 100644
--- a/library/core/src/primitive_docs.rs
+++ b/library/core/src/primitive_docs.rs
@@ -563,11 +563,11 @@ impl () {}
 /// Note that here the call to [`drop`] is for clarity - it indicates
 /// that we are done with the given value and it should be destroyed.
 ///
-/// ## 3. Create it using `ptr::addr_of!`
+/// ## 3. Create it using `&raw`
 ///
-/// Instead of coercing a reference to a raw pointer, you can use the macros
-/// [`ptr::addr_of!`] (for `*const T`) and [`ptr::addr_of_mut!`] (for `*mut T`).
-/// These macros allow you to create raw pointers to fields to which you cannot
+/// Instead of coercing a reference to a raw pointer, you can use the raw borrow
+/// operators `&raw const` (for `*const T`) and `&raw mut` (for `*mut T`).
+/// These operators allow you to create raw pointers to fields to which you cannot
 /// create a reference (without causing undefined behavior), such as an
 /// unaligned field. This might be necessary if packed structs or uninitialized
 /// memory is involved.
@@ -580,7 +580,7 @@ impl () {}
 ///     unaligned: u32,
 /// }
 /// let s = S::default();
-/// let p = std::ptr::addr_of!(s.unaligned); // not allowed with coercion
+/// let p = &raw const s.unaligned; // not allowed with coercion
 /// ```
 ///
 /// ## 4. Get it from C.
diff --git a/tests/ui-fulldeps/pprust-parenthesis-insertion.rs b/tests/ui-fulldeps/pprust-parenthesis-insertion.rs
index 258a1fdb1d3..d6021b559d6 100644
--- a/tests/ui-fulldeps/pprust-parenthesis-insertion.rs
+++ b/tests/ui-fulldeps/pprust-parenthesis-insertion.rs
@@ -135,10 +135,6 @@ static EXPRS: &[&str] = &[
     "(0.).to_string()",
     "0. .. 1.",
     */
-    /*
-    // FIXME: pretty-printer loses the dyn*. `i as Trait`
-    "i as dyn* Trait",
-    */
 ];
 
 // Flatten the content of parenthesis nodes into their parent node. For example
diff --git a/tests/ui/coroutine/clone-impl-static.rs b/tests/ui/coroutine/clone-impl-static.rs
index 62d4392e30c..f6fadff7faf 100644
--- a/tests/ui/coroutine/clone-impl-static.rs
+++ b/tests/ui/coroutine/clone-impl-static.rs
@@ -1,6 +1,8 @@
 //@compile-flags: --diagnostic-width=300
 // gate-test-coroutine_clone
 // Verifies that static coroutines cannot be cloned/copied.
+// This is important: the cloned coroutine would reference state of the original
+// coroutine, leading to semantic nonsense.
 
 #![feature(coroutines, coroutine_clone, stmt_expr_attributes)]
 
diff --git a/tests/ui/coroutine/clone-impl-static.stderr b/tests/ui/coroutine/clone-impl-static.stderr
index bf16b166960..db1d2770346 100644
--- a/tests/ui/coroutine/clone-impl-static.stderr
+++ b/tests/ui/coroutine/clone-impl-static.stderr
@@ -1,27 +1,27 @@
-error[E0277]: the trait bound `{static coroutine@$DIR/clone-impl-static.rs:9:5: 9:19}: Copy` is not satisfied
-  --> $DIR/clone-impl-static.rs:12:16
+error[E0277]: the trait bound `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}: Copy` is not satisfied
+  --> $DIR/clone-impl-static.rs:14:16
    |
 LL |     check_copy(&gen);
-   |     ---------- ^^^^ the trait `Copy` is not implemented for `{static coroutine@$DIR/clone-impl-static.rs:9:5: 9:19}`
+   |     ---------- ^^^^ the trait `Copy` is not implemented for `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}`
    |     |
    |     required by a bound introduced by this call
    |
 note: required by a bound in `check_copy`
-  --> $DIR/clone-impl-static.rs:18:18
+  --> $DIR/clone-impl-static.rs:20:18
    |
 LL | fn check_copy<T: Copy>(_x: &T) {}
    |                  ^^^^ required by this bound in `check_copy`
 
-error[E0277]: the trait bound `{static coroutine@$DIR/clone-impl-static.rs:9:5: 9:19}: Clone` is not satisfied
-  --> $DIR/clone-impl-static.rs:14:17
+error[E0277]: the trait bound `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}: Clone` is not satisfied
+  --> $DIR/clone-impl-static.rs:16:17
    |
 LL |     check_clone(&gen);
-   |     ----------- ^^^^ the trait `Clone` is not implemented for `{static coroutine@$DIR/clone-impl-static.rs:9:5: 9:19}`
+   |     ----------- ^^^^ the trait `Clone` is not implemented for `{static coroutine@$DIR/clone-impl-static.rs:11:5: 11:19}`
    |     |
    |     required by a bound introduced by this call
    |
 note: required by a bound in `check_clone`
-  --> $DIR/clone-impl-static.rs:19:19
+  --> $DIR/clone-impl-static.rs:21:19
    |
 LL | fn check_clone<T: Clone>(_x: &T) {}
    |                   ^^^^^ required by this bound in `check_clone`
diff --git a/tests/ui/dyn-star/pointer-like-impl-rules.rs b/tests/ui/dyn-star/pointer-like-impl-rules.rs
new file mode 100644
index 00000000000..c234e86e09a
--- /dev/null
+++ b/tests/ui/dyn-star/pointer-like-impl-rules.rs
@@ -0,0 +1,82 @@
+//@ check-fail
+
+#![feature(extern_types)]
+#![feature(pointer_like_trait)]
+
+use std::marker::PointerLike;
+
+struct NotReprTransparent;
+impl PointerLike for NotReprTransparent {}
+//~^ ERROR: implementation must be applied to type that
+//~| NOTE: the struct `NotReprTransparent` is not `repr(transparent)`
+
+#[repr(transparent)]
+struct FieldIsPl(usize);
+impl PointerLike for FieldIsPl {}
+
+#[repr(transparent)]
+struct FieldIsPlAndHasOtherField(usize, ());
+impl PointerLike for FieldIsPlAndHasOtherField {}
+
+#[repr(transparent)]
+struct FieldIsNotPl(u8);
+impl PointerLike for FieldIsNotPl {}
+//~^ ERROR: implementation must be applied to type that
+//~| NOTE: the field `0` of struct `FieldIsNotPl` does not implement `PointerLike`
+
+#[repr(transparent)]
+struct GenericFieldIsNotPl<T>(T);
+impl<T> PointerLike for GenericFieldIsNotPl<T> {}
+//~^ ERROR: implementation must be applied to type that
+//~| NOTE: the field `0` of struct `GenericFieldIsNotPl<T>` does not implement `PointerLike`
+
+#[repr(transparent)]
+struct GenericFieldIsPl<T>(T);
+impl<T: PointerLike> PointerLike for GenericFieldIsPl<T> {}
+
+#[repr(transparent)]
+struct IsZeroSized(());
+impl PointerLike for IsZeroSized {}
+//~^ ERROR: implementation must be applied to type that
+//~| NOTE: the struct `IsZeroSized` is `repr(transparent)`, but does not have a non-trivial field
+
+trait SomeTrait {}
+impl PointerLike for dyn SomeTrait {}
+//~^ ERROR: implementation must be applied to type that
+//~| NOTE: types of dynamic or unknown size
+
+extern "C" {
+    type ExternType;
+}
+impl PointerLike for ExternType {}
+//~^ ERROR: implementation must be applied to type that
+//~| NOTE: types of dynamic or unknown size
+
+struct LocalSizedType(&'static str);
+struct LocalUnsizedType(str);
+
+// This is not a special error but a normal coherence error,
+// which should still happen.
+impl PointerLike for &LocalSizedType {}
+//~^ ERROR: conflicting implementations of trait `PointerLike`
+//~| NOTE: conflicting implementation in crate `core`
+
+impl PointerLike for &LocalUnsizedType {}
+//~^ ERROR: implementation must be applied to type that
+//~| NOTE: references to dynamically-sized types are too large to be `PointerLike`
+
+impl PointerLike for Box<LocalSizedType> {}
+//~^ ERROR: conflicting implementations of trait `PointerLike`
+//~| NOTE: conflicting implementation in crate `alloc`
+
+impl PointerLike for Box<LocalUnsizedType> {}
+//~^ ERROR: implementation must be applied to type that
+//~| NOTE: boxes of dynamically-sized types are too large to be `PointerLike`
+
+fn expects_pointer_like(x: impl PointerLike) {}
+
+fn main() {
+    expects_pointer_like(FieldIsPl(1usize));
+    expects_pointer_like(FieldIsPlAndHasOtherField(1usize, ()));
+    expects_pointer_like(GenericFieldIsPl(1usize));
+}
diff --git a/tests/ui/dyn-star/pointer-like-impl-rules.stderr b/tests/ui/dyn-star/pointer-like-impl-rules.stderr
new file mode 100644
index 00000000000..39f08f442c4
--- /dev/null
+++ b/tests/ui/dyn-star/pointer-like-impl-rules.stderr
@@ -0,0 +1,85 @@
+error[E0119]: conflicting implementations of trait `PointerLike` for type `&LocalSizedType`
+  --> $DIR/pointer-like-impl-rules.rs:60:1
+   |
+LL | impl PointerLike for &LocalSizedType {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: conflicting implementation in crate `core`:
+           - impl<T> PointerLike for &T;
+
+error[E0119]: conflicting implementations of trait `PointerLike` for type `Box<LocalSizedType>`
+  --> $DIR/pointer-like-impl-rules.rs:68:1
+   |
+LL | impl PointerLike for Box<LocalSizedType> {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: conflicting implementation in crate `alloc`:
+           - impl<T> PointerLike for Box<T>;
+
+error: implementation must be applied to type that has the same ABI as a pointer, or is `repr(transparent)` and whose field is `PointerLike`
+  --> $DIR/pointer-like-impl-rules.rs:9:1
+   |
+LL | impl PointerLike for NotReprTransparent {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the struct `NotReprTransparent` is not `repr(transparent)`
+
+error: implementation must be applied to type that has the same ABI as a pointer, or is `repr(transparent)` and whose field is `PointerLike`
+  --> $DIR/pointer-like-impl-rules.rs:23:1
+   |
+LL | impl PointerLike for FieldIsNotPl {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the field `0` of struct `FieldIsNotPl` does not implement `PointerLike`
+
+error: implementation must be applied to type that has the same ABI as a pointer, or is `repr(transparent)` and whose field is `PointerLike`
+  --> $DIR/pointer-like-impl-rules.rs:29:1
+   |
+LL | impl<T> PointerLike for GenericFieldIsNotPl<T> {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the field `0` of struct `GenericFieldIsNotPl<T>` does not implement `PointerLike`
+
+error: implementation must be applied to type that has the same ABI as a pointer, or is `repr(transparent)` and whose field is `PointerLike`
+  --> $DIR/pointer-like-impl-rules.rs:39:1
+   |
+LL | impl PointerLike for IsZeroSized {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: the struct `IsZeroSized` is `repr(transparent)`, but does not have a non-trivial field (it is zero-sized)
+
+error: implementation must be applied to type that has the same ABI as a pointer, or is `repr(transparent)` and whose field is `PointerLike`
+  --> $DIR/pointer-like-impl-rules.rs:44:1
+   |
+LL | impl PointerLike for dyn SomeTrait {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: types of dynamic or unknown size may not implement `PointerLike`
+
+error: implementation must be applied to type that has the same ABI as a pointer, or is `repr(transparent)` and whose field is `PointerLike`
+  --> $DIR/pointer-like-impl-rules.rs:51:1
+   |
+LL | impl PointerLike for ExternType {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: types of dynamic or unknown size may not implement `PointerLike`
+
+error: implementation must be applied to type that has the same ABI as a pointer, or is `repr(transparent)` and whose field is `PointerLike`
+  --> $DIR/pointer-like-impl-rules.rs:64:1
+   |
+LL | impl PointerLike for &LocalUnsizedType {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: references to dynamically-sized types are too large to be `PointerLike`
+
+error: implementation must be applied to type that has the same ABI as a pointer, or is `repr(transparent)` and whose field is `PointerLike`
+  --> $DIR/pointer-like-impl-rules.rs:72:1
+   |
+LL | impl PointerLike for Box<LocalUnsizedType> {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: boxes of dynamically-sized types are too large to be `PointerLike`
+
+error: aborting due to 10 previous errors
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/tests/ui/macros/macros-nonfatal-errors.rs b/tests/ui/macros/macros-nonfatal-errors.rs
index 46e865031ec..658455b1b5b 100644
--- a/tests/ui/macros/macros-nonfatal-errors.rs
+++ b/tests/ui/macros/macros-nonfatal-errors.rs
@@ -39,12 +39,18 @@ enum AttrOnInnerExpression {
     Baz,
 }
 
-#[derive(Default)] //~ ERROR no default declared
+#[derive(Default)] //~ ERROR `#[derive(Default)]` on enum with no `#[default]`
 enum NoDeclaredDefault {
     Foo,
     Bar,
 }
 
+#[derive(Default)] //~ ERROR `#[derive(Default)]` on enum with no `#[default]`
+enum NoDeclaredDefaultWithoutUnitVariant {
+    Foo(i32),
+    Bar(i32),
+}
+
 #[derive(Default)] //~ ERROR multiple declared defaults
 enum MultipleDefaults {
     #[default]
diff --git a/tests/ui/macros/macros-nonfatal-errors.stderr b/tests/ui/macros/macros-nonfatal-errors.stderr
index abf43e2a009..fd5e41986a8 100644
--- a/tests/ui/macros/macros-nonfatal-errors.stderr
+++ b/tests/ui/macros/macros-nonfatal-errors.stderr
@@ -46,18 +46,43 @@ LL |     Bar([u8; #[default] 1]),
    |
    = help: consider a manual implementation of `Default`
 
-error: no default declared
+error[E0665]: `#[derive(Default)]` on enum with no `#[default]`
   --> $DIR/macros-nonfatal-errors.rs:42:10
    |
-LL | #[derive(Default)]
-   |          ^^^^^^^
+LL |   #[derive(Default)]
+   |            ^^^^^^^
+LL | / enum NoDeclaredDefault {
+LL | |     Foo,
+LL | |     Bar,
+LL | | }
+   | |_- this enum needs a unit variant marked with `#[default]`
    |
-   = help: make a unit variant default by placing `#[default]` above it
    = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: make this unit variant default by placing `#[default]` on it
+   |
+LL |     #[default] Foo,
+   |     ++++++++++
+help: make this unit variant default by placing `#[default]` on it
+   |
+LL |     #[default] Bar,
+   |     ++++++++++
 
-error: multiple declared defaults
+error[E0665]: `#[derive(Default)]` on enum with no `#[default]`
   --> $DIR/macros-nonfatal-errors.rs:48:10
    |
+LL |   #[derive(Default)]
+   |            ^^^^^^^
+LL | / enum NoDeclaredDefaultWithoutUnitVariant {
+LL | |     Foo(i32),
+LL | |     Bar(i32),
+LL | | }
+   | |_- this enum needs a unit variant marked with `#[default]`
+   |
+   = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: multiple declared defaults
+  --> $DIR/macros-nonfatal-errors.rs:54:10
+   |
 LL | #[derive(Default)]
    |          ^^^^^^^
 ...
@@ -74,7 +99,7 @@ LL |     Baz,
    = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: `#[default]` attribute does not accept a value
-  --> $DIR/macros-nonfatal-errors.rs:60:5
+  --> $DIR/macros-nonfatal-errors.rs:66:5
    |
 LL |     #[default = 1]
    |     ^^^^^^^^^^^^^^
@@ -82,7 +107,7 @@ LL |     #[default = 1]
    = help: try using `#[default]`
 
 error: multiple `#[default]` attributes
-  --> $DIR/macros-nonfatal-errors.rs:68:5
+  --> $DIR/macros-nonfatal-errors.rs:74:5
    |
 LL |     #[default]
    |     ---------- `#[default]` used here
@@ -93,13 +118,13 @@ LL |     Foo,
    |
    = note: only one `#[default]` attribute is needed
 help: try removing this
-  --> $DIR/macros-nonfatal-errors.rs:67:5
+  --> $DIR/macros-nonfatal-errors.rs:73:5
    |
 LL |     #[default]
    |     ^^^^^^^^^^
 
 error: multiple `#[default]` attributes
-  --> $DIR/macros-nonfatal-errors.rs:78:5
+  --> $DIR/macros-nonfatal-errors.rs:84:5
    |
 LL |     #[default]
    |     ---------- `#[default]` used here
@@ -111,7 +136,7 @@ LL |     Foo,
    |
    = note: only one `#[default]` attribute is needed
 help: try removing these
-  --> $DIR/macros-nonfatal-errors.rs:75:5
+  --> $DIR/macros-nonfatal-errors.rs:81:5
    |
 LL |     #[default]
    |     ^^^^^^^^^^
@@ -121,7 +146,7 @@ LL |     #[default]
    |     ^^^^^^^^^^
 
 error: the `#[default]` attribute may only be used on unit enum variants
-  --> $DIR/macros-nonfatal-errors.rs:85:5
+  --> $DIR/macros-nonfatal-errors.rs:91:5
    |
 LL |     Foo {},
    |     ^^^
@@ -129,7 +154,7 @@ LL |     Foo {},
    = help: consider a manual implementation of `Default`
 
 error: default variant must be exhaustive
-  --> $DIR/macros-nonfatal-errors.rs:93:5
+  --> $DIR/macros-nonfatal-errors.rs:99:5
    |
 LL |     #[non_exhaustive]
    |     ----------------- declared `#[non_exhaustive]` here
@@ -139,37 +164,37 @@ LL |     Foo,
    = help: consider a manual implementation of `Default`
 
 error: asm template must be a string literal
-  --> $DIR/macros-nonfatal-errors.rs:98:10
+  --> $DIR/macros-nonfatal-errors.rs:104:10
    |
 LL |     asm!(invalid);
    |          ^^^^^^^
 
 error: `concat_idents!()` requires ident args
-  --> $DIR/macros-nonfatal-errors.rs:101:5
+  --> $DIR/macros-nonfatal-errors.rs:107:5
    |
 LL |     concat_idents!("not", "idents");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: argument must be a string literal
-  --> $DIR/macros-nonfatal-errors.rs:103:17
+  --> $DIR/macros-nonfatal-errors.rs:109:17
    |
 LL |     option_env!(invalid);
    |                 ^^^^^^^
 
 error: expected string literal
-  --> $DIR/macros-nonfatal-errors.rs:104:10
+  --> $DIR/macros-nonfatal-errors.rs:110:10
    |
 LL |     env!(invalid);
    |          ^^^^^^^
 
 error: `env!()` takes 1 or 2 arguments
-  --> $DIR/macros-nonfatal-errors.rs:105:5
+  --> $DIR/macros-nonfatal-errors.rs:111:5
    |
 LL |     env!(foo, abr, baz);
    |     ^^^^^^^^^^^^^^^^^^^
 
 error: environment variable `RUST_HOPEFULLY_THIS_DOESNT_EXIST` not defined at compile time
-  --> $DIR/macros-nonfatal-errors.rs:106:5
+  --> $DIR/macros-nonfatal-errors.rs:112:5
    |
 LL |     env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -178,7 +203,7 @@ LL |     env!("RUST_HOPEFULLY_THIS_DOESNT_EXIST");
    = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: format argument must be a string literal
-  --> $DIR/macros-nonfatal-errors.rs:108:13
+  --> $DIR/macros-nonfatal-errors.rs:114:13
    |
 LL |     format!(invalid);
    |             ^^^^^^^
@@ -189,19 +214,19 @@ LL |     format!("{}", invalid);
    |             +++++
 
 error: argument must be a string literal
-  --> $DIR/macros-nonfatal-errors.rs:110:14
+  --> $DIR/macros-nonfatal-errors.rs:116:14
    |
 LL |     include!(invalid);
    |              ^^^^^^^
 
 error: argument must be a string literal
-  --> $DIR/macros-nonfatal-errors.rs:112:18
+  --> $DIR/macros-nonfatal-errors.rs:118:18
    |
 LL |     include_str!(invalid);
    |                  ^^^^^^^
 
 error: couldn't read `$DIR/i'd be quite surprised if a file with this name existed`: $FILE_NOT_FOUND_MSG
-  --> $DIR/macros-nonfatal-errors.rs:113:5
+  --> $DIR/macros-nonfatal-errors.rs:119:5
    |
 LL |     include_str!("i'd be quite surprised if a file with this name existed");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -209,13 +234,13 @@ LL |     include_str!("i'd be quite surprised if a file with this name existed")
    = note: this error originates in the macro `include_str` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: argument must be a string literal
-  --> $DIR/macros-nonfatal-errors.rs:114:20
+  --> $DIR/macros-nonfatal-errors.rs:120:20
    |
 LL |     include_bytes!(invalid);
    |                    ^^^^^^^
 
 error: couldn't read `$DIR/i'd be quite surprised if a file with this name existed`: $FILE_NOT_FOUND_MSG
-  --> $DIR/macros-nonfatal-errors.rs:115:5
+  --> $DIR/macros-nonfatal-errors.rs:121:5
    |
 LL |     include_bytes!("i'd be quite surprised if a file with this name existed");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -223,13 +248,13 @@ LL |     include_bytes!("i'd be quite surprised if a file with this name existed
    = note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: trace_macros! accepts only `true` or `false`
-  --> $DIR/macros-nonfatal-errors.rs:117:5
+  --> $DIR/macros-nonfatal-errors.rs:123:5
    |
 LL |     trace_macros!(invalid);
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 error: default variant must be exhaustive
-  --> $DIR/macros-nonfatal-errors.rs:127:9
+  --> $DIR/macros-nonfatal-errors.rs:133:9
    |
 LL |         #[non_exhaustive]
    |         ----------------- declared `#[non_exhaustive]` here
@@ -239,10 +264,11 @@ LL |         Foo,
    = help: consider a manual implementation of `Default`
 
 error: cannot find macro `llvm_asm` in this scope
-  --> $DIR/macros-nonfatal-errors.rs:99:5
+  --> $DIR/macros-nonfatal-errors.rs:105:5
    |
 LL |     llvm_asm!(invalid);
    |     ^^^^^^^^
 
-error: aborting due to 28 previous errors
+error: aborting due to 29 previous errors
 
+For more information about this error, try `rustc --explain E0665`.
diff --git a/tests/ui/suggestions/wrap-dyn-in-suggestion-issue-120223.stderr b/tests/ui/suggestions/wrap-dyn-in-suggestion-issue-120223.stderr
index f7fc17ea24f..1fb3e7d211e 100644
--- a/tests/ui/suggestions/wrap-dyn-in-suggestion-issue-120223.stderr
+++ b/tests/ui/suggestions/wrap-dyn-in-suggestion-issue-120223.stderr
@@ -58,14 +58,14 @@ help: consider adding an explicit lifetime bound
 LL |     executor: impl FnOnce(T) -> (dyn Future<Output = ()>) + 'static,
    |                                 +                       +++++++++++
 
-error[E0310]: the parameter type `impl FnOnce(T) -> Future<Output = ()>` may not live long enough
+error[E0310]: the parameter type `impl FnOnce(T) -> dyn* Future<Output = ()>` may not live long enough
   --> $DIR/wrap-dyn-in-suggestion-issue-120223.rs:14:5
    |
 LL |     Box::new(executor)
    |     ^^^^^^^^^^^^^^^^^^
    |     |
-   |     the parameter type `impl FnOnce(T) -> Future<Output = ()>` must be valid for the static lifetime...
-   |     ...so that the type `impl FnOnce(T) -> Future<Output = ()>` will meet its required lifetime bounds
+   |     the parameter type `impl FnOnce(T) -> dyn* Future<Output = ()>` must be valid for the static lifetime...
+   |     ...so that the type `impl FnOnce(T) -> dyn* Future<Output = ()>` will meet its required lifetime bounds
    |
 help: consider adding an explicit lifetime bound
    |
diff --git a/tests/ui/traits/const-traits/effects/auxiliary/minicore.rs b/tests/ui/traits/const-traits/auxiliary/minicore.rs
index e606d896e93..e606d896e93 100644
--- a/tests/ui/traits/const-traits/effects/auxiliary/minicore.rs
+++ b/tests/ui/traits/const-traits/auxiliary/minicore.rs
diff --git a/tests/ui/traits/const-traits/effects/const_closure-const_trait_impl-ice-113381.rs b/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs
index 877249135cd..877249135cd 100644
--- a/tests/ui/traits/const-traits/effects/const_closure-const_trait_impl-ice-113381.rs
+++ b/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.rs
diff --git a/tests/ui/traits/const-traits/effects/const_closure-const_trait_impl-ice-113381.stderr b/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.stderr
index 243e94087bb..243e94087bb 100644
--- a/tests/ui/traits/const-traits/effects/const_closure-const_trait_impl-ice-113381.stderr
+++ b/tests/ui/traits/const-traits/const_closure-const_trait_impl-ice-113381.stderr
diff --git a/tests/ui/traits/const-traits/effects/dont-prefer-param-env-for-infer-self-ty.rs b/tests/ui/traits/const-traits/dont-prefer-param-env-for-infer-self-ty.rs
index 08dcd7d80b3..08dcd7d80b3 100644
--- a/tests/ui/traits/const-traits/effects/dont-prefer-param-env-for-infer-self-ty.rs
+++ b/tests/ui/traits/const-traits/dont-prefer-param-env-for-infer-self-ty.rs
diff --git a/tests/ui/traits/const-traits/effects/effect-param-infer.rs b/tests/ui/traits/const-traits/effect-param-infer.rs
index fcacf458a9f..fcacf458a9f 100644
--- a/tests/ui/traits/const-traits/effects/effect-param-infer.rs
+++ b/tests/ui/traits/const-traits/effect-param-infer.rs
diff --git a/tests/ui/traits/const-traits/effects/auxiliary/cross-crate.rs b/tests/ui/traits/const-traits/effects/auxiliary/cross-crate.rs
deleted file mode 100644
index e02bf6a4d2c..00000000000
--- a/tests/ui/traits/const-traits/effects/auxiliary/cross-crate.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-//@ compile-flags: -Znext-solver
-#![feature(const_trait_impl)]
-
-pub const fn foo() {}
-
-#[const_trait]
-pub trait Bar {
-    fn bar();
-}
-
-impl Bar for () {
-    fn bar() {}
-}
diff --git a/tests/ui/traits/const-traits/effects/no-explicit-const-params-cross-crate.rs b/tests/ui/traits/const-traits/effects/no-explicit-const-params-cross-crate.rs
deleted file mode 100644
index 97052a1d09a..00000000000
--- a/tests/ui/traits/const-traits/effects/no-explicit-const-params-cross-crate.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-//@ aux-build: cross-crate.rs
-extern crate cross_crate;
-
-use cross_crate::{Bar, foo};
-
-fn main() {
-    foo::<true>();
-    //~^ ERROR: function takes 0 generic arguments but 1 generic argument was supplied
-    <() as Bar<true>>::bar();
-    //~^ ERROR: trait takes 0 generic arguments but 1 generic argument was supplied
-}
-
-const FOO: () = {
-    foo::<false>();
-    //~^ ERROR: function takes 0 generic arguments but 1 generic argument was supplied
-    <() as Bar<false>>::bar();
-    //~^ ERROR: trait takes 0 generic arguments but 1 generic argument was supplied
-};
diff --git a/tests/ui/traits/const-traits/effects/no-explicit-const-params-cross-crate.stderr b/tests/ui/traits/const-traits/effects/no-explicit-const-params-cross-crate.stderr
deleted file mode 100644
index d1180dbd80e..00000000000
--- a/tests/ui/traits/const-traits/effects/no-explicit-const-params-cross-crate.stderr
+++ /dev/null
@@ -1,59 +0,0 @@
-error[E0107]: function takes 0 generic arguments but 1 generic argument was supplied
-  --> $DIR/no-explicit-const-params-cross-crate.rs:14:5
-   |
-LL |     foo::<false>();
-   |     ^^^--------- help: remove the unnecessary generics
-   |     |
-   |     expected 0 generic arguments
-   |
-note: function defined here, with 0 generic parameters
-  --> $DIR/auxiliary/cross-crate.rs:4:14
-   |
-LL | pub const fn foo() {}
-   |              ^^^
-
-error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied
-  --> $DIR/no-explicit-const-params-cross-crate.rs:16:12
-   |
-LL |     <() as Bar<false>>::bar();
-   |            ^^^------- help: remove the unnecessary generics
-   |            |
-   |            expected 0 generic arguments
-   |
-note: trait defined here, with 0 generic parameters
-  --> $DIR/auxiliary/cross-crate.rs:7:11
-   |
-LL | pub trait Bar {
-   |           ^^^
-
-error[E0107]: function takes 0 generic arguments but 1 generic argument was supplied
-  --> $DIR/no-explicit-const-params-cross-crate.rs:7:5
-   |
-LL |     foo::<true>();
-   |     ^^^-------- help: remove the unnecessary generics
-   |     |
-   |     expected 0 generic arguments
-   |
-note: function defined here, with 0 generic parameters
-  --> $DIR/auxiliary/cross-crate.rs:4:14
-   |
-LL | pub const fn foo() {}
-   |              ^^^
-
-error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied
-  --> $DIR/no-explicit-const-params-cross-crate.rs:9:12
-   |
-LL |     <() as Bar<true>>::bar();
-   |            ^^^------ help: remove the unnecessary generics
-   |            |
-   |            expected 0 generic arguments
-   |
-note: trait defined here, with 0 generic parameters
-  --> $DIR/auxiliary/cross-crate.rs:7:11
-   |
-LL | pub trait Bar {
-   |           ^^^
-
-error: aborting due to 4 previous errors
-
-For more information about this error, try `rustc --explain E0107`.
diff --git a/tests/ui/traits/const-traits/effects/fallback.rs b/tests/ui/traits/const-traits/fallback.rs
index 253d16f3251..253d16f3251 100644
--- a/tests/ui/traits/const-traits/effects/fallback.rs
+++ b/tests/ui/traits/const-traits/fallback.rs
diff --git a/tests/ui/traits/const-traits/effects/group-traits.rs b/tests/ui/traits/const-traits/group-traits.rs
index 2c5b6cc40e6..2c5b6cc40e6 100644
--- a/tests/ui/traits/const-traits/effects/group-traits.rs
+++ b/tests/ui/traits/const-traits/group-traits.rs
diff --git a/tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.rs b/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.rs
index 8ff15dd09cc..8ff15dd09cc 100644
--- a/tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.rs
+++ b/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.rs
diff --git a/tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.stderr b/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.stderr
index 280f8807f5f..280f8807f5f 100644
--- a/tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.stderr
+++ b/tests/ui/traits/const-traits/ice-112822-expected-type-for-param.stderr
diff --git a/tests/ui/traits/const-traits/effects/ice-113375-index-out-of-bounds-generics.rs b/tests/ui/traits/const-traits/ice-113375-index-out-of-bounds-generics.rs
index f3cbaf847a9..f3cbaf847a9 100644
--- a/tests/ui/traits/const-traits/effects/ice-113375-index-out-of-bounds-generics.rs
+++ b/tests/ui/traits/const-traits/ice-113375-index-out-of-bounds-generics.rs
diff --git a/tests/ui/traits/const-traits/effects/infer-fallback.rs b/tests/ui/traits/const-traits/infer-fallback.rs
index a7342d72a9c..a7342d72a9c 100644
--- a/tests/ui/traits/const-traits/effects/infer-fallback.rs
+++ b/tests/ui/traits/const-traits/infer-fallback.rs
diff --git a/tests/ui/traits/const-traits/effects/minicore-const-fn-early-bound.rs b/tests/ui/traits/const-traits/minicore-const-fn-early-bound.rs
index ee47f92a0bc..ee47f92a0bc 100644
--- a/tests/ui/traits/const-traits/effects/minicore-const-fn-early-bound.rs
+++ b/tests/ui/traits/const-traits/minicore-const-fn-early-bound.rs
diff --git a/tests/ui/traits/const-traits/effects/minicore-deref-fail.rs b/tests/ui/traits/const-traits/minicore-deref-fail.rs
index f4a7678a009..f4a7678a009 100644
--- a/tests/ui/traits/const-traits/effects/minicore-deref-fail.rs
+++ b/tests/ui/traits/const-traits/minicore-deref-fail.rs
diff --git a/tests/ui/traits/const-traits/effects/minicore-deref-fail.stderr b/tests/ui/traits/const-traits/minicore-deref-fail.stderr
index a1f840114fc..a1f840114fc 100644
--- a/tests/ui/traits/const-traits/effects/minicore-deref-fail.stderr
+++ b/tests/ui/traits/const-traits/minicore-deref-fail.stderr
diff --git a/tests/ui/traits/const-traits/effects/minicore-drop-fail.rs b/tests/ui/traits/const-traits/minicore-drop-fail.rs
index 274e5db21c4..274e5db21c4 100644
--- a/tests/ui/traits/const-traits/effects/minicore-drop-fail.rs
+++ b/tests/ui/traits/const-traits/minicore-drop-fail.rs
diff --git a/tests/ui/traits/const-traits/effects/minicore-drop-fail.stderr b/tests/ui/traits/const-traits/minicore-drop-fail.stderr
index 12d1877a18a..12d1877a18a 100644
--- a/tests/ui/traits/const-traits/effects/minicore-drop-fail.stderr
+++ b/tests/ui/traits/const-traits/minicore-drop-fail.stderr
diff --git a/tests/ui/traits/const-traits/effects/minicore-drop-without-feature-gate.no.stderr b/tests/ui/traits/const-traits/minicore-drop-without-feature-gate.no.stderr
index 218f3661e39..218f3661e39 100644
--- a/tests/ui/traits/const-traits/effects/minicore-drop-without-feature-gate.no.stderr
+++ b/tests/ui/traits/const-traits/minicore-drop-without-feature-gate.no.stderr
diff --git a/tests/ui/traits/const-traits/effects/minicore-drop-without-feature-gate.rs b/tests/ui/traits/const-traits/minicore-drop-without-feature-gate.rs
index e75bf3db007..e75bf3db007 100644
--- a/tests/ui/traits/const-traits/effects/minicore-drop-without-feature-gate.rs
+++ b/tests/ui/traits/const-traits/minicore-drop-without-feature-gate.rs
diff --git a/tests/ui/traits/const-traits/effects/minicore-fn-fail.rs b/tests/ui/traits/const-traits/minicore-fn-fail.rs
index ae1cbc6ca58..ae1cbc6ca58 100644
--- a/tests/ui/traits/const-traits/effects/minicore-fn-fail.rs
+++ b/tests/ui/traits/const-traits/minicore-fn-fail.rs
diff --git a/tests/ui/traits/const-traits/effects/minicore-fn-fail.stderr b/tests/ui/traits/const-traits/minicore-fn-fail.stderr
index fa8be631a26..fa8be631a26 100644
--- a/tests/ui/traits/const-traits/effects/minicore-fn-fail.stderr
+++ b/tests/ui/traits/const-traits/minicore-fn-fail.stderr
diff --git a/tests/ui/traits/const-traits/effects/minicore-works.rs b/tests/ui/traits/const-traits/minicore-works.rs
index c79b4fc07df..c79b4fc07df 100644
--- a/tests/ui/traits/const-traits/effects/minicore-works.rs
+++ b/tests/ui/traits/const-traits/minicore-works.rs
diff --git a/tests/ui/traits/const-traits/effects/mismatched_generic_args.rs b/tests/ui/traits/const-traits/mismatched_generic_args.rs
index 21e91c731b3..21e91c731b3 100644
--- a/tests/ui/traits/const-traits/effects/mismatched_generic_args.rs
+++ b/tests/ui/traits/const-traits/mismatched_generic_args.rs
diff --git a/tests/ui/traits/const-traits/effects/mismatched_generic_args.stderr b/tests/ui/traits/const-traits/mismatched_generic_args.stderr
index 8e12b40381f..8e12b40381f 100644
--- a/tests/ui/traits/const-traits/effects/mismatched_generic_args.stderr
+++ b/tests/ui/traits/const-traits/mismatched_generic_args.stderr
diff --git a/tests/ui/traits/const-traits/effects/no-explicit-const-params.rs b/tests/ui/traits/const-traits/no-explicit-const-params.rs
index 76663292223..76663292223 100644
--- a/tests/ui/traits/const-traits/effects/no-explicit-const-params.rs
+++ b/tests/ui/traits/const-traits/no-explicit-const-params.rs
diff --git a/tests/ui/traits/const-traits/effects/no-explicit-const-params.stderr b/tests/ui/traits/const-traits/no-explicit-const-params.stderr
index 9bd2c2cb8da..9bd2c2cb8da 100644
--- a/tests/ui/traits/const-traits/effects/no-explicit-const-params.stderr
+++ b/tests/ui/traits/const-traits/no-explicit-const-params.stderr
diff --git a/tests/ui/traits/const-traits/effects/project.rs b/tests/ui/traits/const-traits/project.rs
index 139299753e5..139299753e5 100644
--- a/tests/ui/traits/const-traits/effects/project.rs
+++ b/tests/ui/traits/const-traits/project.rs
diff --git a/tests/ui/traits/const-traits/effects/span-bug-issue-121418.rs b/tests/ui/traits/const-traits/span-bug-issue-121418.rs
index 50a7e12f2a7..50a7e12f2a7 100644
--- a/tests/ui/traits/const-traits/effects/span-bug-issue-121418.rs
+++ b/tests/ui/traits/const-traits/span-bug-issue-121418.rs
diff --git a/tests/ui/traits/const-traits/effects/span-bug-issue-121418.stderr b/tests/ui/traits/const-traits/span-bug-issue-121418.stderr
index fe1e5e558b2..fe1e5e558b2 100644
--- a/tests/ui/traits/const-traits/effects/span-bug-issue-121418.stderr
+++ b/tests/ui/traits/const-traits/span-bug-issue-121418.stderr
diff --git a/tests/ui/traits/const-traits/effects/spec-effectvar-ice.rs b/tests/ui/traits/const-traits/spec-effectvar-ice.rs
index c85b1746967..c85b1746967 100644
--- a/tests/ui/traits/const-traits/effects/spec-effectvar-ice.rs
+++ b/tests/ui/traits/const-traits/spec-effectvar-ice.rs
diff --git a/tests/ui/traits/const-traits/effects/spec-effectvar-ice.stderr b/tests/ui/traits/const-traits/spec-effectvar-ice.stderr
index 474d96698d5..474d96698d5 100644
--- a/tests/ui/traits/const-traits/effects/spec-effectvar-ice.stderr
+++ b/tests/ui/traits/const-traits/spec-effectvar-ice.stderr
diff --git a/tests/ui/traits/const-traits/effects/trait-fn-const.rs b/tests/ui/traits/const-traits/trait-fn-const.rs
index 07eac032a82..07eac032a82 100644
--- a/tests/ui/traits/const-traits/effects/trait-fn-const.rs
+++ b/tests/ui/traits/const-traits/trait-fn-const.rs
diff --git a/tests/ui/traits/const-traits/effects/trait-fn-const.stderr b/tests/ui/traits/const-traits/trait-fn-const.stderr
index 4d0b03046d2..4d0b03046d2 100644
--- a/tests/ui/traits/const-traits/effects/trait-fn-const.stderr
+++ b/tests/ui/traits/const-traits/trait-fn-const.stderr
diff --git a/tests/ui/unpretty/expanded-exhaustive.rs b/tests/ui/unpretty/expanded-exhaustive.rs
index 98fe05cf7c8..e052627e71c 100644
--- a/tests/ui/unpretty/expanded-exhaustive.rs
+++ b/tests/ui/unpretty/expanded-exhaustive.rs
@@ -9,6 +9,7 @@
 #![feature(const_trait_impl)]
 #![feature(decl_macro)]
 #![feature(deref_patterns)]
+#![feature(dyn_star)]
 #![feature(explicit_tail_calls)]
 #![feature(gen_blocks)]
 #![feature(let_chains)]
@@ -800,6 +801,7 @@ mod types {
         let _: dyn Send + 'static;
         let _: dyn 'static + Send;
         let _: dyn for<'a> Send;
+        let _: dyn* Send;
     }
 
     /// TyKind::ImplTrait
diff --git a/tests/ui/unpretty/expanded-exhaustive.stdout b/tests/ui/unpretty/expanded-exhaustive.stdout
index 452c06dd7e4..132d00cd8ed 100644
--- a/tests/ui/unpretty/expanded-exhaustive.stdout
+++ b/tests/ui/unpretty/expanded-exhaustive.stdout
@@ -10,6 +10,7 @@
 #![feature(const_trait_impl)]
 #![feature(decl_macro)]
 #![feature(deref_patterns)]
+#![feature(dyn_star)]
 #![feature(explicit_tail_calls)]
 #![feature(gen_blocks)]
 #![feature(let_chains)]
@@ -647,6 +648,7 @@ mod types {
         let _: dyn Send + 'static;
         let _: dyn 'static + Send;
         let _: dyn for<'a> Send;
+        let _: dyn* Send;
     }
     /// TyKind::ImplTrait
     const fn ty_impl_trait() {