about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-04-07 15:33:46 +0000
committerbors <bors@rust-lang.org>2021-04-07 15:33:46 +0000
commite9cdcccfa8321363999a43ee30a18b3aadbc20de (patch)
treeb9649646765b2d3c8d0a6d6595fdd5efa1cc9b03
parentb01026de465d5a5ef51e32c1012c43927d2a111c (diff)
parentd82419b4062d69a197d543a17367f254d1b4fcff (diff)
downloadrust-e9cdcccfa8321363999a43ee30a18b3aadbc20de.tar.gz
rust-e9cdcccfa8321363999a43ee30a18b3aadbc20de.zip
Auto merge of #83964 - Dylan-DPC:rollup-9kinaiv, r=Dylan-DPC
Rollup of 8 pull requests

Successful merges:

 - #83476 (Add strong_count mutation methods to Rc)
 - #83634 (Do not emit the advanced diagnostics on macros)
 - #83816 (Trigger `unused_doc_comments` on macros at once)
 - #83916 (Use AnonConst for asm! constants)
 - #83935 (forbid `impl Trait` in generic param defaults)
 - #83936 (Disable using non-ascii identifiers in extern blocks.)
 - #83945 (Add suggestion to reborrow mutable references when they're moved in a for loop)
 - #83954 (Do not ICE when closure is involved in Trait Alias Impl Trait)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
-rw-r--r--compiler/rustc_ast/src/ast.rs2
-rw-r--r--compiler/rustc_ast/src/mut_visit.rs2
-rw-r--r--compiler/rustc_ast/src/visit.rs4
-rw-r--r--compiler/rustc_ast_lowering/src/expr.rs6
-rw-r--r--compiler/rustc_ast_lowering/src/lib.rs8
-rw-r--r--compiler/rustc_ast_passes/src/ast_validation.rs24
-rw-r--r--compiler/rustc_ast_pretty/src/pprust/state.rs4
-rw-r--r--compiler/rustc_builtin_macros/src/asm.rs4
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/block.rs64
-rw-r--r--compiler/rustc_expand/src/expand.rs14
-rw-r--r--compiler/rustc_hir/src/hir.rs2
-rw-r--r--compiler/rustc_hir/src/intravisit.rs4
-rw-r--r--compiler/rustc_hir_pretty/src/lib.rs4
-rw-r--r--compiler/rustc_lint/src/builtin.rs2
-rw-r--r--compiler/rustc_middle/src/mir/mod.rs2
-rw-r--r--compiler/rustc_middle/src/mir/visit.rs6
-rw-r--r--compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs19
-rw-r--r--compiler/rustc_mir/src/borrow_check/invalidation.rs6
-rw-r--r--compiler/rustc_mir/src/borrow_check/mod.rs6
-rw-r--r--compiler/rustc_mir/src/dataflow/move_paths/builder.rs5
-rw-r--r--compiler/rustc_mir/src/transform/dest_prop.rs4
-rw-r--r--compiler/rustc_mir/src/transform/promote_consts.rs82
-rw-r--r--compiler/rustc_mir_build/src/build/expr/into.rs8
-rw-r--r--compiler/rustc_mir_build/src/thir/cx/expr.rs8
-rw-r--r--compiler/rustc_mir_build/src/thir/mod.rs3
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs2
-rw-r--r--compiler/rustc_passes/src/intrinsicck.rs11
-rw-r--r--compiler/rustc_passes/src/liveness.rs2
-rw-r--r--compiler/rustc_resolve/src/late/diagnostics.rs4
-rw-r--r--compiler/rustc_trait_selection/src/traits/coherence.rs7
-rw-r--r--compiler/rustc_trait_selection/src/traits/specialize/mod.rs4
-rw-r--r--compiler/rustc_typeck/src/check/expr.rs5
-rw-r--r--compiler/rustc_typeck/src/check/mod.rs13
-rw-r--r--compiler/rustc_typeck/src/collect/type_of.rs9
-rw-r--r--compiler/rustc_typeck/src/expr_use_visitor.rs2
-rw-r--r--library/alloc/src/rc.rs67
-rw-r--r--src/test/ui/asm/const.rs36
-rw-r--r--src/test/ui/asm/parse-error.rs6
-rw-r--r--src/test/ui/asm/parse-error.stderr77
-rw-r--r--src/test/ui/asm/type-check-1.rs18
-rw-r--r--src/test/ui/asm/type-check-1.stderr32
-rw-r--r--src/test/ui/asm/type-check-2.rs24
-rw-r--r--src/test/ui/asm/type-check-2.stderr50
-rw-r--r--src/test/ui/associated-types/associated-types-coherence-failure.stderr4
-rw-r--r--src/test/ui/async-await/issue-67651.stderr2
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.stderr2
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.stderr2
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.stderr2
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.stderr2
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.stderr2
-rw-r--r--src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr2
-rw-r--r--src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr2
-rw-r--r--src/test/ui/coherence/coherence-cross-crate-conflict.stderr2
-rw-r--r--src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr2
-rw-r--r--src/test/ui/coherence/coherence-fn-implied-bounds.stderr2
-rw-r--r--src/test/ui/coherence/coherence-fn-inputs.stderr2
-rw-r--r--src/test/ui/coherence/coherence-free-vs-bound-region.stderr2
-rw-r--r--src/test/ui/coherence/coherence-impls-copy.stderr6
-rw-r--r--src/test/ui/coherence/coherence-impls-send.stderr2
-rw-r--r--src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr2
-rw-r--r--src/test/ui/coherence/coherence-overlap-all-t-and-tuple.stderr2
-rw-r--r--src/test/ui/coherence/coherence-overlap-downstream.stderr4
-rw-r--r--src/test/ui/coherence/coherence-overlap-issue-23516.stderr2
-rw-r--r--src/test/ui/coherence/coherence-overlap-messages.stderr10
-rw-r--r--src/test/ui/coherence/coherence-overlap-upstream.stderr2
-rw-r--r--src/test/ui/coherence/coherence-projection-conflict-orphan.stderr2
-rw-r--r--src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr2
-rw-r--r--src/test/ui/coherence/coherence-projection-conflict.stderr2
-rw-r--r--src/test/ui/coherence/coherence-subtyping.stderr2
-rw-r--r--src/test/ui/coherence/coherence-tuple-conflict.stderr2
-rw-r--r--src/test/ui/coherence/coherence-wasm-bindgen.stderr2
-rw-r--r--src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.stderr2
-rw-r--r--src/test/ui/coherence/coherence_copy_like_err_struct.stderr2
-rw-r--r--src/test/ui/coherence/coherence_copy_like_err_tuple.stderr2
-rw-r--r--src/test/ui/const-generics/issues/issue-64494.min.stderr2
-rw-r--r--src/test/ui/error-codes/E0119.stderr2
-rw-r--r--src/test/ui/error-codes/e0119/complex-impl.stderr2
-rw-r--r--src/test/ui/error-codes/e0119/conflict-with-std.stderr6
-rw-r--r--src/test/ui/error-codes/e0119/issue-23563.stderr2
-rw-r--r--src/test/ui/error-codes/e0119/issue-27403.stderr2
-rw-r--r--src/test/ui/error-codes/e0119/issue-28981.stderr2
-rw-r--r--src/test/ui/error-codes/e0119/so-37347311.stderr2
-rw-r--r--src/test/ui/feature-gates/feature-gate-non_ascii_idents.rs1
-rw-r--r--src/test/ui/feature-gates/feature-gate-non_ascii_idents.stderr12
-rw-r--r--src/test/ui/feature-gates/feature-gate-overlapping_marker_traits.stderr2
-rw-r--r--src/test/ui/impl-trait/auto-trait.full_tait.stderr2
-rw-r--r--src/test/ui/impl-trait/auto-trait.min_tait.stderr2
-rw-r--r--src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.rs12
-rw-r--r--src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.stderr15
-rw-r--r--src/test/ui/impl-trait/negative-reasoning.full_tait.stderr2
-rw-r--r--src/test/ui/impl-trait/negative-reasoning.min_tait.stderr2
-rw-r--r--src/test/ui/impl-trait/where-allowed.rs32
-rw-r--r--src/test/ui/impl-trait/where-allowed.stderr133
-rw-r--r--src/test/ui/issues/issue-28568.stderr2
-rw-r--r--src/test/ui/issues/issue-41974.stderr2
-rw-r--r--src/test/ui/issues/issue-43355.stderr2
-rw-r--r--src/test/ui/issues/issue-48728.stderr2
-rw-r--r--src/test/ui/issues/issue-83924.fixed20
-rw-r--r--src/test/ui/issues/issue-83924.rs20
-rw-r--r--src/test/ui/issues/issue-83924.stderr25
-rw-r--r--src/test/ui/never_type/never-from-impl-is-reserved.stderr2
-rw-r--r--src/test/ui/proc-macro/auxiliary/issue-83510.rs19
-rw-r--r--src/test/ui/proc-macro/issue-83510.rs11
-rw-r--r--src/test/ui/proc-macro/issue-83510.stderr38
-rw-r--r--src/test/ui/rfc-2457/extern_block_nonascii_forbidden.rs10
-rw-r--r--src/test/ui/rfc-2457/extern_block_nonascii_forbidden.stderr34
-rw-r--r--src/test/ui/rfc-2457/mod_file_nonascii_forbidden.stderr2
-rw-r--r--src/test/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr4
-rw-r--r--src/test/ui/specialization/issue-52050.stderr2
-rw-r--r--src/test/ui/specialization/specialization-feature-gate-overlap.stderr2
-rw-r--r--src/test/ui/specialization/specialization-overlap.stderr8
-rw-r--r--src/test/ui/traits/alias/issue-83613.rs13
-rw-r--r--src/test/ui/traits/alias/issue-83613.stderr23
-rw-r--r--src/test/ui/traits/issue-33140-hack-boundaries.stderr14
-rw-r--r--src/test/ui/traits/issue-33140.stderr4
-rw-r--r--src/test/ui/traits/negative-impls/rely-on-negative-impl-in-coherence.stderr2
-rw-r--r--src/test/ui/traits/overlap-not-permitted-for-builtin-trait.stderr2
-rw-r--r--src/test/ui/traits/reservation-impl/coherence-conflict.stderr2
-rw-r--r--src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.full_tait.stderr2
-rw-r--r--src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.min_tait.stderr2
-rw-r--r--src/test/ui/unused/unused-doc-comments-for-macros.rs17
-rw-r--r--src/test/ui/unused/unused-doc-comments-for-macros.stderr31
-rw-r--r--src/test/ui/unused/useless-comment.rs (renamed from src/test/ui/useless-comment.rs)0
-rw-r--r--src/test/ui/unused/useless-comment.stderr (renamed from src/test/ui/useless-comment.stderr)0
-rw-r--r--src/tools/clippy/clippy_lints/src/loops/never_loop.rs2
-rw-r--r--src/tools/clippy/clippy_lints/src/utils/inspector.rs5
-rw-r--r--src/tools/clippy/clippy_utils/src/hir_utils.rs3
127 files changed, 902 insertions, 400 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs
index 2cffddfcd0b..da9accd1839 100644
--- a/compiler/rustc_ast/src/ast.rs
+++ b/compiler/rustc_ast/src/ast.rs
@@ -1998,7 +1998,7 @@ pub enum InlineAsmOperand {
         out_expr: Option<P<Expr>>,
     },
     Const {
-        expr: P<Expr>,
+        anon_const: AnonConst,
     },
     Sym {
         expr: P<Expr>,
diff --git a/compiler/rustc_ast/src/mut_visit.rs b/compiler/rustc_ast/src/mut_visit.rs
index f426f2c7fec..b1840f475aa 100644
--- a/compiler/rustc_ast/src/mut_visit.rs
+++ b/compiler/rustc_ast/src/mut_visit.rs
@@ -1252,7 +1252,6 @@ pub fn noop_visit_expr<T: MutVisitor>(
                 match op {
                     InlineAsmOperand::In { expr, .. }
                     | InlineAsmOperand::InOut { expr, .. }
-                    | InlineAsmOperand::Const { expr, .. }
                     | InlineAsmOperand::Sym { expr, .. } => vis.visit_expr(expr),
                     InlineAsmOperand::Out { expr, .. } => {
                         if let Some(expr) = expr {
@@ -1265,6 +1264,7 @@ pub fn noop_visit_expr<T: MutVisitor>(
                             vis.visit_expr(out_expr);
                         }
                     }
+                    InlineAsmOperand::Const { anon_const, .. } => vis.visit_anon_const(anon_const),
                 }
             }
         }
diff --git a/compiler/rustc_ast/src/visit.rs b/compiler/rustc_ast/src/visit.rs
index b1ad29e4ad8..3f35919ae6a 100644
--- a/compiler/rustc_ast/src/visit.rs
+++ b/compiler/rustc_ast/src/visit.rs
@@ -835,7 +835,6 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) {
                 match op {
                     InlineAsmOperand::In { expr, .. }
                     | InlineAsmOperand::InOut { expr, .. }
-                    | InlineAsmOperand::Const { expr, .. }
                     | InlineAsmOperand::Sym { expr, .. } => visitor.visit_expr(expr),
                     InlineAsmOperand::Out { expr, .. } => {
                         if let Some(expr) = expr {
@@ -848,6 +847,9 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) {
                             visitor.visit_expr(out_expr);
                         }
                     }
+                    InlineAsmOperand::Const { anon_const, .. } => {
+                        visitor.visit_anon_const(anon_const)
+                    }
                 }
             }
         }
diff --git a/compiler/rustc_ast_lowering/src/expr.rs b/compiler/rustc_ast_lowering/src/expr.rs
index d5a9d7ee6e3..75dfe951c94 100644
--- a/compiler/rustc_ast_lowering/src/expr.rs
+++ b/compiler/rustc_ast_lowering/src/expr.rs
@@ -1411,9 +1411,9 @@ impl<'hir> LoweringContext<'_, 'hir> {
                             out_expr: out_expr.as_ref().map(|expr| self.lower_expr_mut(expr)),
                         }
                     }
-                    InlineAsmOperand::Const { ref expr } => {
-                        hir::InlineAsmOperand::Const { expr: self.lower_expr_mut(expr) }
-                    }
+                    InlineAsmOperand::Const { ref anon_const } => hir::InlineAsmOperand::Const {
+                        anon_const: self.lower_anon_const(anon_const),
+                    },
                     InlineAsmOperand::Sym { ref expr } => {
                         hir::InlineAsmOperand::Sym { expr: self.lower_expr_mut(expr) }
                     }
diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs
index 4e375e00682..be56f97af8a 100644
--- a/compiler/rustc_ast_lowering/src/lib.rs
+++ b/compiler/rustc_ast_lowering/src/lib.rs
@@ -2259,13 +2259,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
 
                 let kind = hir::GenericParamKind::Type {
                     default: default.as_ref().map(|x| {
-                        self.lower_ty(
-                            x,
-                            ImplTraitContext::OtherOpaqueTy {
-                                capturable_lifetimes: &mut FxHashSet::default(),
-                                origin: hir::OpaqueTyOrigin::Misc,
-                            },
-                        )
+                        self.lower_ty(x, ImplTraitContext::Disallowed(ImplTraitPosition::Other))
                     }),
                     synthetic: param
                         .attrs
diff --git a/compiler/rustc_ast_passes/src/ast_validation.rs b/compiler/rustc_ast_passes/src/ast_validation.rs
index 96bb9cfb1a6..bb09f701531 100644
--- a/compiler/rustc_ast_passes/src/ast_validation.rs
+++ b/compiler/rustc_ast_passes/src/ast_validation.rs
@@ -532,6 +532,25 @@ impl<'a> AstValidator<'a> {
         }
     }
 
+    /// An item in `extern { ... }` cannot use non-ascii identifier.
+    fn check_foreign_item_ascii_only(&self, ident: Ident) {
+        let symbol_str = ident.as_str();
+        if !symbol_str.is_ascii() {
+            let n = 83942;
+            self.err_handler()
+                .struct_span_err(
+                    ident.span,
+                    "items in `extern` blocks cannot use non-ascii identifiers",
+                )
+                .span_label(self.current_extern_span(), "in this `extern` block")
+                .note(&format!(
+                    "This limitation may be lifted in the future; see issue #{} <https://github.com/rust-lang/rust/issues/{}> for more information",
+                    n, n,
+                ))
+                .emit();
+        }
+    }
+
     /// Reject C-varadic type unless the function is foreign,
     /// or free and `unsafe extern "C"` semantically.
     fn check_c_varadic_type(&self, fk: FnKind<'a>) {
@@ -592,7 +611,7 @@ impl<'a> AstValidator<'a> {
             self.session,
             ident.span,
             E0754,
-            "trying to load file for module `{}` with non ascii identifer name",
+            "trying to load file for module `{}` with non-ascii identifier name",
             ident.name
         )
         .help("consider using `#[path]` attribute to specify filesystem path")
@@ -1103,15 +1122,18 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
                 self.check_defaultness(fi.span, *def);
                 self.check_foreign_fn_bodyless(fi.ident, body.as_deref());
                 self.check_foreign_fn_headerless(fi.ident, fi.span, sig.header);
+                self.check_foreign_item_ascii_only(fi.ident);
             }
             ForeignItemKind::TyAlias(box TyAliasKind(def, generics, bounds, body)) => {
                 self.check_defaultness(fi.span, *def);
                 self.check_foreign_kind_bodyless(fi.ident, "type", body.as_ref().map(|b| b.span));
                 self.check_type_no_bounds(bounds, "`extern` blocks");
                 self.check_foreign_ty_genericless(generics);
+                self.check_foreign_item_ascii_only(fi.ident);
             }
             ForeignItemKind::Static(_, _, body) => {
                 self.check_foreign_kind_bodyless(fi.ident, "static", body.as_ref().map(|b| b.span));
+                self.check_foreign_item_ascii_only(fi.ident);
             }
             ForeignItemKind::MacCall(..) => {}
         }
diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs
index 627c0584b61..789d2c296e2 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state.rs
@@ -2149,10 +2149,10 @@ impl<'a> State<'a> {
                                     None => s.word("_"),
                                 }
                             }
-                            InlineAsmOperand::Const { expr } => {
+                            InlineAsmOperand::Const { anon_const } => {
                                 s.word("const");
                                 s.space();
-                                s.print_expr(expr);
+                                s.print_expr(&anon_const.value);
                             }
                             InlineAsmOperand::Sym { expr } => {
                                 s.word("sym");
diff --git a/compiler/rustc_builtin_macros/src/asm.rs b/compiler/rustc_builtin_macros/src/asm.rs
index e6afc81d039..fd976b119b7 100644
--- a/compiler/rustc_builtin_macros/src/asm.rs
+++ b/compiler/rustc_builtin_macros/src/asm.rs
@@ -136,8 +136,8 @@ fn parse_args<'a>(
                 ast::InlineAsmOperand::InOut { reg, expr, late: true }
             }
         } else if p.eat_keyword(kw::Const) {
-            let expr = p.parse_expr()?;
-            ast::InlineAsmOperand::Const { expr }
+            let anon_const = p.parse_anon_const_expr()?;
+            ast::InlineAsmOperand::Const { anon_const }
         } else if p.eat_keyword(sym::sym) {
             let expr = p.parse_expr()?;
             match expr.kind {
diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs
index 04225ddd36f..fd3f89a2aee 100644
--- a/compiler/rustc_codegen_ssa/src/mir/block.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/block.rs
@@ -822,41 +822,37 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
                     InlineAsmOperandRef::InOut { reg, late, in_value, out_place }
                 }
                 mir::InlineAsmOperand::Const { ref value } => {
-                    if let mir::Operand::Constant(constant) = value {
-                        let const_value = self
-                            .eval_mir_constant(constant)
-                            .unwrap_or_else(|_| span_bug!(span, "asm const cannot be resolved"));
-                        let ty = constant.ty();
-                        let size = bx.layout_of(ty).size;
-                        let scalar = match const_value {
-                            ConstValue::Scalar(s) => s,
-                            _ => span_bug!(
-                                span,
-                                "expected Scalar for promoted asm const, but got {:#?}",
-                                const_value
-                            ),
-                        };
-                        let value = scalar.assert_bits(size);
-                        let string = match ty.kind() {
-                            ty::Uint(_) => value.to_string(),
-                            ty::Int(int_ty) => {
-                                match int_ty.normalize(bx.tcx().sess.target.pointer_width) {
-                                    ty::IntTy::I8 => (value as i8).to_string(),
-                                    ty::IntTy::I16 => (value as i16).to_string(),
-                                    ty::IntTy::I32 => (value as i32).to_string(),
-                                    ty::IntTy::I64 => (value as i64).to_string(),
-                                    ty::IntTy::I128 => (value as i128).to_string(),
-                                    ty::IntTy::Isize => unreachable!(),
-                                }
+                    let const_value = self
+                        .eval_mir_constant(value)
+                        .unwrap_or_else(|_| span_bug!(span, "asm const cannot be resolved"));
+                    let ty = value.ty();
+                    let size = bx.layout_of(ty).size;
+                    let scalar = match const_value {
+                        ConstValue::Scalar(s) => s,
+                        _ => span_bug!(
+                            span,
+                            "expected Scalar for promoted asm const, but got {:#?}",
+                            const_value
+                        ),
+                    };
+                    let value = scalar.assert_bits(size);
+                    let string = match ty.kind() {
+                        ty::Uint(_) => value.to_string(),
+                        ty::Int(int_ty) => {
+                            match int_ty.normalize(bx.tcx().sess.target.pointer_width) {
+                                ty::IntTy::I8 => (value as i8).to_string(),
+                                ty::IntTy::I16 => (value as i16).to_string(),
+                                ty::IntTy::I32 => (value as i32).to_string(),
+                                ty::IntTy::I64 => (value as i64).to_string(),
+                                ty::IntTy::I128 => (value as i128).to_string(),
+                                ty::IntTy::Isize => unreachable!(),
                             }
-                            ty::Float(ty::FloatTy::F32) => f32::from_bits(value as u32).to_string(),
-                            ty::Float(ty::FloatTy::F64) => f64::from_bits(value as u64).to_string(),
-                            _ => span_bug!(span, "asm const has bad type {}", ty),
-                        };
-                        InlineAsmOperandRef::Const { string }
-                    } else {
-                        span_bug!(span, "asm const is not a constant");
-                    }
+                        }
+                        ty::Float(ty::FloatTy::F32) => f32::from_bits(value as u32).to_string(),
+                        ty::Float(ty::FloatTy::F64) => f64::from_bits(value as u64).to_string(),
+                        _ => span_bug!(span, "asm const has bad type {}", ty),
+                    };
+                    InlineAsmOperandRef::Const { string }
                 }
                 mir::InlineAsmOperand::SymFn { ref value } => {
                     let literal = self.monomorphize(value.literal);
diff --git a/compiler/rustc_expand/src/expand.rs b/compiler/rustc_expand/src/expand.rs
index b732e449374..0f4441d020b 100644
--- a/compiler/rustc_expand/src/expand.rs
+++ b/compiler/rustc_expand/src/expand.rs
@@ -1067,13 +1067,23 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
     // since they will not be detected after macro expansion.
     fn check_attributes(&mut self, attrs: &[ast::Attribute]) {
         let features = self.cx.ecfg.features.unwrap();
-        for attr in attrs.iter() {
+        let mut attrs = attrs.iter().peekable();
+        let mut span: Option<Span> = None;
+        while let Some(attr) = attrs.next() {
             rustc_ast_passes::feature_gate::check_attribute(attr, self.cx.sess, features);
             validate_attr::check_meta(&self.cx.sess.parse_sess, attr);
+
+            let current_span = if let Some(sp) = span { sp.to(attr.span) } else { attr.span };
+            span = Some(current_span);
+
+            if attrs.peek().map_or(false, |next_attr| next_attr.doc_str().is_some()) {
+                continue;
+            }
+
             if attr.doc_str().is_some() {
                 self.cx.sess.parse_sess.buffer_lint_with_diagnostic(
                     &UNUSED_DOC_COMMENTS,
-                    attr.span,
+                    current_span,
                     ast::CRATE_NODE_ID,
                     "unused doc comment",
                     BuiltinLintDiagnostics::UnusedDocComment(attr.span),
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs
index 6317808e7fb..1051fb8cea2 100644
--- a/compiler/rustc_hir/src/hir.rs
+++ b/compiler/rustc_hir/src/hir.rs
@@ -2347,7 +2347,7 @@ pub enum InlineAsmOperand<'hir> {
         out_expr: Option<Expr<'hir>>,
     },
     Const {
-        expr: Expr<'hir>,
+        anon_const: AnonConst,
     },
     Sym {
         expr: Expr<'hir>,
diff --git a/compiler/rustc_hir/src/intravisit.rs b/compiler/rustc_hir/src/intravisit.rs
index d766a68e194..43b67f95510 100644
--- a/compiler/rustc_hir/src/intravisit.rs
+++ b/compiler/rustc_hir/src/intravisit.rs
@@ -1189,7 +1189,6 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr<'v>)
                 match op {
                     InlineAsmOperand::In { expr, .. }
                     | InlineAsmOperand::InOut { expr, .. }
-                    | InlineAsmOperand::Const { expr, .. }
                     | InlineAsmOperand::Sym { expr, .. } => visitor.visit_expr(expr),
                     InlineAsmOperand::Out { expr, .. } => {
                         if let Some(expr) = expr {
@@ -1202,6 +1201,9 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr<'v>)
                             visitor.visit_expr(out_expr);
                         }
                     }
+                    InlineAsmOperand::Const { anon_const, .. } => {
+                        visitor.visit_anon_const(anon_const)
+                    }
                 }
             }
         }
diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs
index 2d499e194e1..5820e7a2612 100644
--- a/compiler/rustc_hir_pretty/src/lib.rs
+++ b/compiler/rustc_hir_pretty/src/lib.rs
@@ -1570,10 +1570,10 @@ impl<'a> State<'a> {
                                 None => s.word("_"),
                             }
                         }
-                        hir::InlineAsmOperand::Const { expr } => {
+                        hir::InlineAsmOperand::Const { anon_const } => {
                             s.word("const");
                             s.space();
-                            s.print_expr(expr);
+                            s.print_anon_const(anon_const);
                         }
                         hir::InlineAsmOperand::Sym { expr } => {
                             s.word("sym");
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs
index 3f16bb9f442..b9de144b0eb 100644
--- a/compiler/rustc_lint/src/builtin.rs
+++ b/compiler/rustc_lint/src/builtin.rs
@@ -989,7 +989,7 @@ fn warn_if_doc(cx: &EarlyContext<'_>, node_span: Span, node_kind: &str, attrs: &
                 Some(sugared_span.map_or(attr.span, |span| span.with_hi(attr.span.hi())));
         }
 
-        if attrs.peek().map(|next_attr| next_attr.is_doc_comment()).unwrap_or_default() {
+        if attrs.peek().map_or(false, |next_attr| next_attr.is_doc_comment()) {
             continue;
         }
 
diff --git a/compiler/rustc_middle/src/mir/mod.rs b/compiler/rustc_middle/src/mir/mod.rs
index a7e9fc468b4..89f45640094 100644
--- a/compiler/rustc_middle/src/mir/mod.rs
+++ b/compiler/rustc_middle/src/mir/mod.rs
@@ -1213,7 +1213,7 @@ pub enum InlineAsmOperand<'tcx> {
         out_place: Option<Place<'tcx>>,
     },
     Const {
-        value: Operand<'tcx>,
+        value: Box<Constant<'tcx>>,
     },
     SymFn {
         value: Box<Constant<'tcx>>,
diff --git a/compiler/rustc_middle/src/mir/visit.rs b/compiler/rustc_middle/src/mir/visit.rs
index fd504f8c5d5..5516a045c1d 100644
--- a/compiler/rustc_middle/src/mir/visit.rs
+++ b/compiler/rustc_middle/src/mir/visit.rs
@@ -584,8 +584,7 @@ macro_rules! make_mir_visitor {
                     } => {
                         for op in operands {
                             match op {
-                                InlineAsmOperand::In { value, .. }
-                                | InlineAsmOperand::Const { value } => {
+                                InlineAsmOperand::In { value, .. } => {
                                     self.visit_operand(value, location);
                                 }
                                 InlineAsmOperand::Out { place, .. } => {
@@ -607,7 +606,8 @@ macro_rules! make_mir_visitor {
                                         );
                                     }
                                 }
-                                InlineAsmOperand::SymFn { value } => {
+                                InlineAsmOperand::Const { value }
+                                | InlineAsmOperand::SymFn { value } => {
                                     self.visit_constant(value, location);
                                 }
                                 InlineAsmOperand::SymStatic { def_id: _ } => {}
diff --git a/compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs b/compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs
index d5deec82088..5fdf8a8d1ee 100644
--- a/compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs
+++ b/compiler/rustc_mir/src/borrow_check/diagnostics/conflict_errors.rs
@@ -264,7 +264,24 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
 
                 if let Some(DesugaringKind::ForLoop(_)) = move_span.desugaring_kind() {
                     let sess = self.infcx.tcx.sess;
-                    if let Ok(snippet) = sess.source_map().span_to_snippet(move_span) {
+                    let ty = used_place.ty(self.body, self.infcx.tcx).ty;
+                    // If we have a `&mut` ref, we need to reborrow.
+                    if let ty::Ref(_, _, hir::Mutability::Mut) = ty.kind() {
+                        // If we are in a loop this will be suggested later.
+                        if !is_loop_move {
+                            err.span_suggestion_verbose(
+                                move_span.shrink_to_lo(),
+                                &format!(
+                                    "consider creating a fresh reborrow of {} here",
+                                    self.describe_place(moved_place.as_ref())
+                                        .map(|n| format!("`{}`", n))
+                                        .unwrap_or_else(|| "the mutable reference".to_string()),
+                                ),
+                                format!("&mut *"),
+                                Applicability::MachineApplicable,
+                            );
+                        }
+                    } else if let Ok(snippet) = sess.source_map().span_to_snippet(move_span) {
                         err.span_suggestion(
                             move_span,
                             "consider borrowing to avoid moving into the for loop",
diff --git a/compiler/rustc_mir/src/borrow_check/invalidation.rs b/compiler/rustc_mir/src/borrow_check/invalidation.rs
index 9374741f837..e621bafb671 100644
--- a/compiler/rustc_mir/src/borrow_check/invalidation.rs
+++ b/compiler/rustc_mir/src/borrow_check/invalidation.rs
@@ -204,8 +204,7 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
             } => {
                 for op in operands {
                     match *op {
-                        InlineAsmOperand::In { reg: _, ref value }
-                        | InlineAsmOperand::Const { ref value } => {
+                        InlineAsmOperand::In { reg: _, ref value } => {
                             self.consume_operand(location, value);
                         }
                         InlineAsmOperand::Out { reg: _, late: _, place, .. } => {
@@ -219,7 +218,8 @@ impl<'cx, 'tcx> Visitor<'tcx> for InvalidationGenerator<'cx, 'tcx> {
                                 self.mutate_place(location, out_place, Shallow(None), JustWrite);
                             }
                         }
-                        InlineAsmOperand::SymFn { value: _ }
+                        InlineAsmOperand::Const { value: _ }
+                        | InlineAsmOperand::SymFn { value: _ }
                         | InlineAsmOperand::SymStatic { def_id: _ } => {}
                     }
                 }
diff --git a/compiler/rustc_mir/src/borrow_check/mod.rs b/compiler/rustc_mir/src/borrow_check/mod.rs
index 71db6abde43..2d1d83b1655 100644
--- a/compiler/rustc_mir/src/borrow_check/mod.rs
+++ b/compiler/rustc_mir/src/borrow_check/mod.rs
@@ -734,8 +734,7 @@ impl<'cx, 'tcx> dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtxt<'cx, 'tc
             } => {
                 for op in operands {
                     match *op {
-                        InlineAsmOperand::In { reg: _, ref value }
-                        | InlineAsmOperand::Const { ref value } => {
+                        InlineAsmOperand::In { reg: _, ref value } => {
                             self.consume_operand(loc, (value, span), flow_state);
                         }
                         InlineAsmOperand::Out { reg: _, late: _, place, .. } => {
@@ -761,7 +760,8 @@ impl<'cx, 'tcx> dataflow::ResultsVisitor<'cx, 'tcx> for MirBorrowckCtxt<'cx, 'tc
                                 );
                             }
                         }
-                        InlineAsmOperand::SymFn { value: _ }
+                        InlineAsmOperand::Const { value: _ }
+                        | InlineAsmOperand::SymFn { value: _ }
                         | InlineAsmOperand::SymStatic { def_id: _ } => {}
                     }
                 }
diff --git a/compiler/rustc_mir/src/dataflow/move_paths/builder.rs b/compiler/rustc_mir/src/dataflow/move_paths/builder.rs
index 538d8921869..994b403abf3 100644
--- a/compiler/rustc_mir/src/dataflow/move_paths/builder.rs
+++ b/compiler/rustc_mir/src/dataflow/move_paths/builder.rs
@@ -425,7 +425,7 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
                 for op in operands {
                     match *op {
                         InlineAsmOperand::In { reg: _, ref value }
-                        | InlineAsmOperand::Const { ref value } => {
+                         => {
                             self.gather_operand(value);
                         }
                         InlineAsmOperand::Out { reg: _, late: _, place, .. } => {
@@ -441,7 +441,8 @@ impl<'b, 'a, 'tcx> Gatherer<'b, 'a, 'tcx> {
                                 self.gather_init(out_place.as_ref(), InitKind::Deep);
                             }
                         }
-                        InlineAsmOperand::SymFn { value: _ }
+                        InlineAsmOperand::Const { value: _ }
+                        | InlineAsmOperand::SymFn { value: _ }
                         | InlineAsmOperand::SymStatic { def_id: _ } => {}
                     }
                 }
diff --git a/compiler/rustc_mir/src/transform/dest_prop.rs b/compiler/rustc_mir/src/transform/dest_prop.rs
index 6656deac967..29df86ca6cd 100644
--- a/compiler/rustc_mir/src/transform/dest_prop.rs
+++ b/compiler/rustc_mir/src/transform/dest_prop.rs
@@ -720,9 +720,6 @@ impl Conflicts<'a> {
                                 }
                             }
                         }
-                        InlineAsmOperand::Const { value } => {
-                            assert!(value.place().is_none());
-                        }
                         InlineAsmOperand::InOut {
                             reg: _,
                             late: _,
@@ -731,6 +728,7 @@ impl Conflicts<'a> {
                         }
                         | InlineAsmOperand::In { reg: _, value: _ }
                         | InlineAsmOperand::Out { reg: _, late: _, place: None }
+                        | InlineAsmOperand::Const { value: _ }
                         | InlineAsmOperand::SymFn { value: _ }
                         | InlineAsmOperand::SymStatic { def_id: _ } => {}
                     }
diff --git a/compiler/rustc_mir/src/transform/promote_consts.rs b/compiler/rustc_mir/src/transform/promote_consts.rs
index c5a03f3a045..1bbaf833c4f 100644
--- a/compiler/rustc_mir/src/transform/promote_consts.rs
+++ b/compiler/rustc_mir/src/transform/promote_consts.rs
@@ -108,9 +108,6 @@ pub enum Candidate {
     /// the attribute currently provides the semantic requirement that arguments
     /// must be constant.
     Argument { bb: BasicBlock, index: usize },
-
-    /// `const` operand in asm!.
-    InlineAsm { bb: BasicBlock, index: usize },
 }
 
 impl Candidate {
@@ -118,16 +115,14 @@ impl Candidate {
     fn forces_explicit_promotion(&self) -> bool {
         match self {
             Candidate::Ref(_) => false,
-            Candidate::Argument { .. } | Candidate::InlineAsm { .. } => true,
+            Candidate::Argument { .. } => true,
         }
     }
 
     fn source_info(&self, body: &Body<'_>) -> SourceInfo {
         match self {
             Candidate::Ref(location) => *body.source_info(*location),
-            Candidate::Argument { bb, .. } | Candidate::InlineAsm { bb, .. } => {
-                *body.source_info(body.terminator_loc(*bb))
-            }
+            Candidate::Argument { bb, .. } => *body.source_info(body.terminator_loc(*bb)),
         }
     }
 }
@@ -217,36 +212,25 @@ impl<'tcx> Visitor<'tcx> for Collector<'_, 'tcx> {
     fn visit_terminator(&mut self, terminator: &Terminator<'tcx>, location: Location) {
         self.super_terminator(terminator, location);
 
-        match terminator.kind {
-            TerminatorKind::Call { ref func, .. } => {
-                if let ty::FnDef(def_id, _) = *func.ty(self.ccx.body, self.ccx.tcx).kind() {
-                    let fn_sig = self.ccx.tcx.fn_sig(def_id);
-                    if let Abi::RustIntrinsic | Abi::PlatformIntrinsic = fn_sig.abi() {
-                        let name = self.ccx.tcx.item_name(def_id);
-                        // FIXME(eddyb) use `#[rustc_args_required_const(2)]` for shuffles.
-                        if name.as_str().starts_with("simd_shuffle") {
-                            self.candidates
-                                .push(Candidate::Argument { bb: location.block, index: 2 });
-
-                            return; // Don't double count `simd_shuffle` candidates
-                        }
-                    }
+        if let TerminatorKind::Call { ref func, .. } = terminator.kind {
+            if let ty::FnDef(def_id, _) = *func.ty(self.ccx.body, self.ccx.tcx).kind() {
+                let fn_sig = self.ccx.tcx.fn_sig(def_id);
+                if let Abi::RustIntrinsic | Abi::PlatformIntrinsic = fn_sig.abi() {
+                    let name = self.ccx.tcx.item_name(def_id);
+                    // FIXME(eddyb) use `#[rustc_args_required_const(2)]` for shuffles.
+                    if name.as_str().starts_with("simd_shuffle") {
+                        self.candidates.push(Candidate::Argument { bb: location.block, index: 2 });
 
-                    if let Some(constant_args) = args_required_const(self.ccx.tcx, def_id) {
-                        for index in constant_args {
-                            self.candidates.push(Candidate::Argument { bb: location.block, index });
-                        }
+                        return; // Don't double count `simd_shuffle` candidates
                     }
                 }
-            }
-            TerminatorKind::InlineAsm { ref operands, .. } => {
-                for (index, op) in operands.iter().enumerate() {
-                    if let InlineAsmOperand::Const { .. } = op {
-                        self.candidates.push(Candidate::InlineAsm { bb: location.block, index })
+
+                if let Some(constant_args) = args_required_const(self.ccx.tcx, def_id) {
+                    for index in constant_args {
+                        self.candidates.push(Candidate::Argument { bb: location.block, index });
                     }
                 }
             }
-            _ => {}
         }
     }
 }
@@ -335,18 +319,6 @@ impl<'tcx> Validator<'_, 'tcx> {
                     _ => bug!(),
                 }
             }
-            Candidate::InlineAsm { bb, index } => {
-                assert!(self.explicit);
-
-                let terminator = self.body[bb].terminator();
-                match &terminator.kind {
-                    TerminatorKind::InlineAsm { operands, .. } => match &operands[index] {
-                        InlineAsmOperand::Const { value } => self.validate_operand(value),
-                        _ => bug!(),
-                    },
-                    _ => bug!(),
-                }
-            }
         }
     }
 
@@ -818,9 +790,7 @@ pub fn validate_candidates(
             }
 
             match candidate {
-                Candidate::Argument { bb, index } | Candidate::InlineAsm { bb, index }
-                    if !is_promotable =>
-                {
+                Candidate::Argument { bb, index } if !is_promotable => {
                     let span = ccx.body[bb].terminator().source_info.span;
                     let msg = format!("argument {} is required to be a constant", index + 1);
                     ccx.tcx.sess.span_err(span, &msg);
@@ -1089,24 +1059,6 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> {
                         _ => bug!(),
                     }
                 }
-                Candidate::InlineAsm { bb, index } => {
-                    let terminator = blocks[bb].terminator_mut();
-                    match terminator.kind {
-                        TerminatorKind::InlineAsm { ref mut operands, .. } => {
-                            match &mut operands[index] {
-                                InlineAsmOperand::Const { ref mut value } => {
-                                    let ty = value.ty(local_decls, self.tcx);
-                                    let span = terminator.source_info.span;
-
-                                    Rvalue::Use(mem::replace(value, promoted_operand(ty, span)))
-                                }
-                                _ => bug!(),
-                            }
-                        }
-
-                        _ => bug!(),
-                    }
-                }
             }
         };
 
@@ -1161,7 +1113,7 @@ pub fn promote_candidates<'tcx>(
                     }
                 }
             }
-            Candidate::Argument { .. } | Candidate::InlineAsm { .. } => {}
+            Candidate::Argument { .. } => {}
         }
 
         // Declare return place local so that `mir::Body::new` doesn't complain.
diff --git a/compiler/rustc_mir_build/src/build/expr/into.rs b/compiler/rustc_mir_build/src/build/expr/into.rs
index 80a5bff8cad..1e7ed3d95d2 100644
--- a/compiler/rustc_mir_build/src/build/expr/into.rs
+++ b/compiler/rustc_mir_build/src/build/expr/into.rs
@@ -355,9 +355,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
                                 }),
                             }
                         }
-                        thir::InlineAsmOperand::Const { expr } => mir::InlineAsmOperand::Const {
-                            value: unpack!(block = this.as_local_operand(block, expr)),
-                        },
+                        thir::InlineAsmOperand::Const { value, span } => {
+                            mir::InlineAsmOperand::Const {
+                                value: box Constant { span, user_ty: None, literal: value.into() },
+                            }
+                        }
                         thir::InlineAsmOperand::SymFn { expr } => {
                             mir::InlineAsmOperand::SymFn { value: box this.as_constant(expr) }
                         }
diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs
index 9abee283160..924278e1a7f 100644
--- a/compiler/rustc_mir_build/src/thir/cx/expr.rs
+++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs
@@ -503,8 +503,12 @@ impl<'thir, 'tcx> Cx<'thir, 'tcx> {
                             in_expr: self.mirror_expr(in_expr),
                             out_expr: out_expr.as_ref().map(|expr| self.mirror_expr(expr)),
                         },
-                        hir::InlineAsmOperand::Const { ref expr } => {
-                            InlineAsmOperand::Const { expr: self.mirror_expr(expr) }
+                        hir::InlineAsmOperand::Const { ref anon_const } => {
+                            let anon_const_def_id = self.tcx.hir().local_def_id(anon_const.hir_id);
+                            let value = ty::Const::from_anon_const(self.tcx, anon_const_def_id);
+                            let span = self.tcx.hir().span(anon_const.hir_id);
+
+                            InlineAsmOperand::Const { value, span }
                         }
                         hir::InlineAsmOperand::Sym { ref expr } => {
                             let qpath = match expr.kind {
diff --git a/compiler/rustc_mir_build/src/thir/mod.rs b/compiler/rustc_mir_build/src/thir/mod.rs
index 6f20195db0b..f4596d523d0 100644
--- a/compiler/rustc_mir_build/src/thir/mod.rs
+++ b/compiler/rustc_mir_build/src/thir/mod.rs
@@ -374,7 +374,8 @@ pub enum InlineAsmOperand<'thir, 'tcx> {
         out_expr: Option<&'thir Expr<'thir, 'tcx>>,
     },
     Const {
-        expr: &'thir Expr<'thir, 'tcx>,
+        value: &'tcx Const<'tcx>,
+        span: Span,
     },
     SymFn {
         expr: &'thir Expr<'thir, 'tcx>,
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index fe190bfe9d9..02ee268b88c 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -107,7 +107,7 @@ impl<'a> Parser<'a> {
         }
     }
 
-    pub(super) fn parse_anon_const_expr(&mut self) -> PResult<'a, AnonConst> {
+    pub fn parse_anon_const_expr(&mut self) -> PResult<'a, AnonConst> {
         self.parse_expr().map(|value| AnonConst { id: DUMMY_NODE_ID, value })
     }
 
diff --git a/compiler/rustc_passes/src/intrinsicck.rs b/compiler/rustc_passes/src/intrinsicck.rs
index 0f4bb635eee..3f095d0e824 100644
--- a/compiler/rustc_passes/src/intrinsicck.rs
+++ b/compiler/rustc_passes/src/intrinsicck.rs
@@ -347,7 +347,7 @@ impl ExprVisitor<'tcx> {
     }
 
     fn check_asm(&self, asm: &hir::InlineAsm<'tcx>) {
-        for (idx, (op, _op_sp)) in asm.operands.iter().enumerate() {
+        for (idx, (op, op_sp)) in asm.operands.iter().enumerate() {
             match *op {
                 hir::InlineAsmOperand::In { reg, ref expr } => {
                     self.check_asm_operand_type(idx, reg, expr, asm.template, None);
@@ -372,14 +372,15 @@ impl ExprVisitor<'tcx> {
                         );
                     }
                 }
-                hir::InlineAsmOperand::Const { ref expr } => {
-                    let ty = self.typeck_results.expr_ty_adjusted(expr);
-                    match ty.kind() {
+                hir::InlineAsmOperand::Const { ref anon_const } => {
+                    let anon_const_def_id = self.tcx.hir().local_def_id(anon_const.hir_id);
+                    let value = ty::Const::from_anon_const(self.tcx, anon_const_def_id);
+                    match value.ty.kind() {
                         ty::Int(_) | ty::Uint(_) | ty::Float(_) => {}
                         _ => {
                             let msg =
                                 "asm `const` arguments must be integer or floating-point values";
-                            self.tcx.sess.span_err(expr.span, msg);
+                            self.tcx.sess.span_err(*op_sp, msg);
                         }
                     }
                 }
diff --git a/compiler/rustc_passes/src/liveness.rs b/compiler/rustc_passes/src/liveness.rs
index f24309fa950..e22a108aaf0 100644
--- a/compiler/rustc_passes/src/liveness.rs
+++ b/compiler/rustc_passes/src/liveness.rs
@@ -1067,7 +1067,6 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
                 for (op, _op_sp) in asm.operands.iter().rev() {
                     match op {
                         hir::InlineAsmOperand::In { expr, .. }
-                        | hir::InlineAsmOperand::Const { expr, .. }
                         | hir::InlineAsmOperand::Sym { expr, .. } => {
                             succ = self.propagate_through_expr(expr, succ)
                         }
@@ -1085,6 +1084,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
                             }
                             succ = self.propagate_through_expr(in_expr, succ);
                         }
+                        hir::InlineAsmOperand::Const { .. } => {}
                     }
                 }
                 succ
diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs
index 1fb07bdae9d..6fae6921fc9 100644
--- a/compiler/rustc_resolve/src/late/diagnostics.rs
+++ b/compiler/rustc_resolve/src/late/diagnostics.rs
@@ -456,12 +456,14 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
             }
         }
 
+        let is_macro = base_span.from_expansion() && base_span.desugaring_kind().is_none();
         if !self.type_ascription_suggestion(&mut err, base_span) {
             let mut fallback = false;
             if let (
                 PathSource::Trait(AliasPossibility::Maybe),
                 Some(Res::Def(DefKind::Struct | DefKind::Enum | DefKind::Union, _)),
-            ) = (source, res)
+                false,
+            ) = (source, res, is_macro)
             {
                 if let Some(bounds @ [_, .., _]) = self.diagnostic_metadata.current_trait_object {
                     fallback = true;
diff --git a/compiler/rustc_trait_selection/src/traits/coherence.rs b/compiler/rustc_trait_selection/src/traits/coherence.rs
index 38cb4ee66ca..9bb4af16a8f 100644
--- a/compiler/rustc_trait_selection/src/traits/coherence.rs
+++ b/compiler/rustc_trait_selection/src/traits/coherence.rs
@@ -586,6 +586,11 @@ fn ty_is_local_constructor(ty: Ty<'_>, in_crate: InCrate) -> bool {
             false
         }
 
+        ty::Closure(..) => {
+            // Similar to the `Opaque` case (#83613).
+            false
+        }
+
         ty::Dynamic(ref tt, ..) => {
             if let Some(principal) = tt.principal() {
                 def_id_is_local(principal.def_id(), in_crate)
@@ -596,7 +601,7 @@ fn ty_is_local_constructor(ty: Ty<'_>, in_crate: InCrate) -> bool {
 
         ty::Error(_) => true,
 
-        ty::Closure(..) | ty::Generator(..) | ty::GeneratorWitness(..) => {
+        ty::Generator(..) | ty::GeneratorWitness(..) => {
             bug!("ty_is_local invoked on unexpected type: {:?}", ty)
         }
     }
diff --git a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs
index 264cc4f248c..4b563a87a15 100644
--- a/compiler/rustc_trait_selection/src/traits/specialize/mod.rs
+++ b/compiler/rustc_trait_selection/src/traits/specialize/mod.rs
@@ -395,14 +395,14 @@ fn report_conflicting_impls(
     // that's passed in.
     let decorate = |err: LintDiagnosticBuilder<'_>| {
         let msg = format!(
-            "conflicting implementations of trait `{}`{}:{}",
+            "conflicting implementations of trait `{}`{}{}",
             overlap.trait_desc,
             overlap
                 .self_desc
                 .clone()
                 .map_or_else(String::new, |ty| { format!(" for type `{}`", ty) }),
             match used_to_be_allowed {
-                Some(FutureCompatOverlapErrorKind::Issue33140) => " (E0119)",
+                Some(FutureCompatOverlapErrorKind::Issue33140) => ": (E0119)",
                 _ => "",
             }
         );
diff --git a/compiler/rustc_typeck/src/check/expr.rs b/compiler/rustc_typeck/src/check/expr.rs
index 67714b714c9..60c40da8f31 100644
--- a/compiler/rustc_typeck/src/check/expr.rs
+++ b/compiler/rustc_typeck/src/check/expr.rs
@@ -2087,7 +2087,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
     fn check_expr_asm(&self, asm: &'tcx hir::InlineAsm<'tcx>) -> Ty<'tcx> {
         for (op, _op_sp) in asm.operands {
             match op {
-                hir::InlineAsmOperand::In { expr, .. } | hir::InlineAsmOperand::Const { expr } => {
+                hir::InlineAsmOperand::In { expr, .. } => {
                     self.check_expr_asm_operand(expr, true);
                 }
                 hir::InlineAsmOperand::Out { expr, .. } => {
@@ -2104,6 +2104,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
                         self.check_expr_asm_operand(out_expr, false);
                     }
                 }
+                hir::InlineAsmOperand::Const { anon_const } => {
+                    self.to_const(anon_const);
+                }
                 hir::InlineAsmOperand::Sym { expr } => {
                     self.check_expr(expr);
                 }
diff --git a/compiler/rustc_typeck/src/check/mod.rs b/compiler/rustc_typeck/src/check/mod.rs
index 0760d59875c..80e173de6b6 100644
--- a/compiler/rustc_typeck/src/check/mod.rs
+++ b/compiler/rustc_typeck/src/check/mod.rs
@@ -540,6 +540,19 @@ fn typeck_with_fallback<'tcx>(
                             kind: TypeVariableOriginKind::TypeInference,
                             span,
                         }),
+                        Node::Expr(&hir::Expr { kind: hir::ExprKind::InlineAsm(ia), .. })
+                            if ia.operands.iter().any(|(op, _op_sp)| match op {
+                                hir::InlineAsmOperand::Const { anon_const } => {
+                                    anon_const.hir_id == id
+                                }
+                                _ => false,
+                            }) =>
+                        {
+                            fcx.next_ty_var(TypeVariableOrigin {
+                                kind: TypeVariableOriginKind::MiscVariable,
+                                span,
+                            })
+                        }
                         _ => fallback(),
                     },
                     _ => fallback(),
diff --git a/compiler/rustc_typeck/src/collect/type_of.rs b/compiler/rustc_typeck/src/collect/type_of.rs
index a05cc36fd4c..d8eea1ad80b 100644
--- a/compiler/rustc_typeck/src/collect/type_of.rs
+++ b/compiler/rustc_typeck/src/collect/type_of.rs
@@ -430,6 +430,15 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
                     tcx.typeck(def_id).node_type(anon_const.hir_id)
                 }
 
+                Node::Expr(&Expr { kind: ExprKind::InlineAsm(ia), .. })
+                    if ia.operands.iter().any(|(op, _op_sp)| match op {
+                        hir::InlineAsmOperand::Const { anon_const } => anon_const.hir_id == hir_id,
+                        _ => false,
+                    }) =>
+                {
+                    tcx.typeck(def_id).node_type(hir_id)
+                }
+
                 Node::Variant(Variant { disr_expr: Some(ref e), .. }) if e.hir_id == hir_id => tcx
                     .adt_def(tcx.hir().get_parent_did(hir_id).to_def_id())
                     .repr
diff --git a/compiler/rustc_typeck/src/expr_use_visitor.rs b/compiler/rustc_typeck/src/expr_use_visitor.rs
index 02510cb6a44..837fd3447ea 100644
--- a/compiler/rustc_typeck/src/expr_use_visitor.rs
+++ b/compiler/rustc_typeck/src/expr_use_visitor.rs
@@ -318,7 +318,6 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
                 for (op, _op_sp) in asm.operands {
                     match op {
                         hir::InlineAsmOperand::In { expr, .. }
-                        | hir::InlineAsmOperand::Const { expr, .. }
                         | hir::InlineAsmOperand::Sym { expr, .. } => self.consume_expr(expr),
                         hir::InlineAsmOperand::Out { expr, .. } => {
                             if let Some(expr) = expr {
@@ -334,6 +333,7 @@ impl<'a, 'tcx> ExprUseVisitor<'a, 'tcx> {
                                 self.mutate_expr(out_expr);
                             }
                         }
+                        hir::InlineAsmOperand::Const { .. } => {}
                     }
                 }
             }
diff --git a/library/alloc/src/rc.rs b/library/alloc/src/rc.rs
index 2ee5e6c791c..c81ababf151 100644
--- a/library/alloc/src/rc.rs
+++ b/library/alloc/src/rc.rs
@@ -910,6 +910,73 @@ impl<T: ?Sized> Rc<T> {
         this.inner().strong()
     }
 
+    /// Increments the strong reference count on the `Rc<T>` associated with the
+    /// provided pointer by one.
+    ///
+    /// # Safety
+    ///
+    /// The pointer must have been obtained through `Rc::into_raw`, and the
+    /// associated `Rc` instance must be valid (i.e. the strong count must be at
+    /// least 1) for the duration of this method.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::rc::Rc;
+    ///
+    /// let five = Rc::new(5);
+    ///
+    /// unsafe {
+    ///     let ptr = Rc::into_raw(five);
+    ///     Rc::increment_strong_count(ptr);
+    ///
+    ///     let five = Rc::from_raw(ptr);
+    ///     assert_eq!(2, Rc::strong_count(&five));
+    /// }
+    /// ```
+    #[inline]
+    #[stable(feature = "rc_mutate_strong_count", since = "1.53.0")]
+    pub unsafe fn increment_strong_count(ptr: *const T) {
+        // Retain Rc, but don't touch refcount by wrapping in ManuallyDrop
+        let rc = unsafe { mem::ManuallyDrop::new(Rc::<T>::from_raw(ptr)) };
+        // Now increase refcount, but don't drop new refcount either
+        let _rc_clone: mem::ManuallyDrop<_> = rc.clone();
+    }
+
+    /// Decrements the strong reference count on the `Rc<T>` associated with the
+    /// provided pointer by one.
+    ///
+    /// # Safety
+    ///
+    /// The pointer must have been obtained through `Rc::into_raw`, and the
+    /// associated `Rc` instance must be valid (i.e. the strong count must be at
+    /// least 1) when invoking this method. This method can be used to release
+    /// the final `Rc` and backing storage, but **should not** be called after
+    /// the final `Rc` has been released.
+    ///
+    /// # Examples
+    ///
+    /// ```
+    /// use std::rc::Rc;
+    ///
+    /// let five = Rc::new(5);
+    ///
+    /// unsafe {
+    ///     let ptr = Rc::into_raw(five);
+    ///     Rc::increment_strong_count(ptr);
+    ///
+    ///     let five = Rc::from_raw(ptr);
+    ///     assert_eq!(2, Rc::strong_count(&five));
+    ///     Rc::decrement_strong_count(ptr);
+    ///     assert_eq!(1, Rc::strong_count(&five));
+    /// }
+    /// ```
+    #[inline]
+    #[stable(feature = "rc_mutate_strong_count", since = "1.53.0")]
+    pub unsafe fn decrement_strong_count(ptr: *const T) {
+        unsafe { mem::drop(Rc::from_raw(ptr)) };
+    }
+
     /// Returns `true` if there are no other `Rc` or [`Weak`] pointers to
     /// this allocation.
     #[inline]
diff --git a/src/test/ui/asm/const.rs b/src/test/ui/asm/const.rs
index 22bc790713d..0f6a7cd4474 100644
--- a/src/test/ui/asm/const.rs
+++ b/src/test/ui/asm/const.rs
@@ -4,38 +4,18 @@
 
 #![feature(asm)]
 
-use std::mem::size_of;
-
-trait Proj {
-    const C: usize;
-}
-impl Proj for i8 {
-    const C: usize = 8;
-}
-impl Proj for i16 {
-    const C: usize = 16;
+fn const_generic<const X: usize>() -> usize {
+    unsafe {
+        let a: usize;
+        asm!("mov {}, {}", out(reg) a, const X);
+        a
+    }
 }
 
 const fn constfn(x: usize) -> usize {
     x
 }
 
-fn generic<T: Proj>() {
-    unsafe {
-        let a: usize;
-        asm!("mov {}, {}", out(reg) a, const size_of::<T>());
-        assert_eq!(a, size_of::<T>());
-
-        let b: usize;
-        asm!("mov {}, {}", out(reg) b, const size_of::<T>() + constfn(5));
-        assert_eq!(b, size_of::<T>() + 5);
-
-        let c: usize;
-        asm!("mov {}, {}", out(reg) c, const T::C);
-        assert_eq!(c, T::C);
-    }
-}
-
 fn main() {
     unsafe {
         let a: usize;
@@ -51,6 +31,6 @@ fn main() {
         assert_eq!(c, 10);
     }
 
-    generic::<i8>();
-    generic::<i16>();
+    let d = const_generic::<5>();
+    assert_eq!(d, 5);
 }
diff --git a/src/test/ui/asm/parse-error.rs b/src/test/ui/asm/parse-error.rs
index 538a3fde8fd..f2e9d9ca08b 100644
--- a/src/test/ui/asm/parse-error.rs
+++ b/src/test/ui/asm/parse-error.rs
@@ -36,17 +36,23 @@ fn main() {
         //~^ ERROR expected one of
         asm!("{}", options(), const foo);
         //~^ ERROR arguments are not allowed after options
+        //~^^ ERROR attempt to use a non-constant value in a constant
         asm!("{a}", a = const foo, a = const bar);
         //~^ ERROR duplicate argument named `a`
         //~^^ ERROR argument never used
+        //~^^^ ERROR attempt to use a non-constant value in a constant
+        //~^^^^ ERROR attempt to use a non-constant value in a constant
         asm!("", a = in("eax") foo);
         //~^ ERROR explicit register arguments cannot have names
         asm!("{a}", in("eax") foo, a = const bar);
         //~^ ERROR named arguments cannot follow explicit register arguments
+        //~^^ ERROR attempt to use a non-constant value in a constant
         asm!("{a}", in("eax") foo, a = const bar);
         //~^ ERROR named arguments cannot follow explicit register arguments
+        //~^^ ERROR attempt to use a non-constant value in a constant
         asm!("{1}", in("eax") foo, const bar);
         //~^ ERROR positional arguments cannot follow named arguments or explicit register arguments
+        //~^^ ERROR attempt to use a non-constant value in a constant
         asm!("", options(), "");
         //~^ ERROR expected one of
         asm!("{}", in(reg) foo, "{}", out(reg) foo);
diff --git a/src/test/ui/asm/parse-error.stderr b/src/test/ui/asm/parse-error.stderr
index dfbfc0abe34..4ab9d86948d 100644
--- a/src/test/ui/asm/parse-error.stderr
+++ b/src/test/ui/asm/parse-error.stderr
@@ -91,7 +91,7 @@ LL |         asm!("{}", options(), const foo);
    |                    previous options
 
 error: duplicate argument named `a`
-  --> $DIR/parse-error.rs:39:36
+  --> $DIR/parse-error.rs:40:36
    |
 LL |         asm!("{a}", a = const foo, a = const bar);
    |                     -------------  ^^^^^^^^^^^^^ duplicate argument
@@ -99,7 +99,7 @@ LL |         asm!("{a}", a = const foo, a = const bar);
    |                     previously here
 
 error: argument never used
-  --> $DIR/parse-error.rs:39:36
+  --> $DIR/parse-error.rs:40:36
    |
 LL |         asm!("{a}", a = const foo, a = const bar);
    |                                    ^^^^^^^^^^^^^ argument never used
@@ -107,13 +107,13 @@ LL |         asm!("{a}", a = const foo, a = const bar);
    = help: if this argument is intentionally unused, consider using it in an asm comment: `"/* {1} */"`
 
 error: explicit register arguments cannot have names
-  --> $DIR/parse-error.rs:42:18
+  --> $DIR/parse-error.rs:45:18
    |
 LL |         asm!("", a = in("eax") foo);
    |                  ^^^^^^^^^^^^^^^^^
 
 error: named arguments cannot follow explicit register arguments
-  --> $DIR/parse-error.rs:44:36
+  --> $DIR/parse-error.rs:47:36
    |
 LL |         asm!("{a}", in("eax") foo, a = const bar);
    |                     -------------  ^^^^^^^^^^^^^ named argument
@@ -121,7 +121,7 @@ LL |         asm!("{a}", in("eax") foo, a = const bar);
    |                     explicit register argument
 
 error: named arguments cannot follow explicit register arguments
-  --> $DIR/parse-error.rs:46:36
+  --> $DIR/parse-error.rs:50:36
    |
 LL |         asm!("{a}", in("eax") foo, a = const bar);
    |                     -------------  ^^^^^^^^^^^^^ named argument
@@ -129,7 +129,7 @@ LL |         asm!("{a}", in("eax") foo, a = const bar);
    |                     explicit register argument
 
 error: positional arguments cannot follow named arguments or explicit register arguments
-  --> $DIR/parse-error.rs:48:36
+  --> $DIR/parse-error.rs:53:36
    |
 LL |         asm!("{1}", in("eax") foo, const bar);
    |                     -------------  ^^^^^^^^^ positional argument
@@ -137,19 +137,19 @@ LL |         asm!("{1}", in("eax") foo, const bar);
    |                     explicit register argument
 
 error: expected one of `const`, `in`, `inlateout`, `inout`, `lateout`, `options`, `out`, or `sym`, found `""`
-  --> $DIR/parse-error.rs:50:29
+  --> $DIR/parse-error.rs:56:29
    |
 LL |         asm!("", options(), "");
    |                             ^^ expected one of 8 possible tokens
 
 error: expected one of `const`, `in`, `inlateout`, `inout`, `lateout`, `options`, `out`, or `sym`, found `"{}"`
-  --> $DIR/parse-error.rs:52:33
+  --> $DIR/parse-error.rs:58:33
    |
 LL |         asm!("{}", in(reg) foo, "{}", out(reg) foo);
    |                                 ^^^^ expected one of 8 possible tokens
 
 error: asm template must be a string literal
-  --> $DIR/parse-error.rs:54:14
+  --> $DIR/parse-error.rs:60:14
    |
 LL |         asm!(format!("{{{}}}", 0), in(reg) foo);
    |              ^^^^^^^^^^^^^^^^^^^^
@@ -157,12 +157,67 @@ LL |         asm!(format!("{{{}}}", 0), in(reg) foo);
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: asm template must be a string literal
-  --> $DIR/parse-error.rs:56:21
+  --> $DIR/parse-error.rs:62:21
    |
 LL |         asm!("{1}", format!("{{{}}}", 0), in(reg) foo, out(reg) bar);
    |                     ^^^^^^^^^^^^^^^^^^^^
    |
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: aborting due to 25 previous errors
+error[E0435]: attempt to use a non-constant value in a constant
+  --> $DIR/parse-error.rs:37:37
+   |
+LL |     let mut foo = 0;
+   |      ---------- help: consider using `const` instead of `let`: `const foo`
+...
+LL |         asm!("{}", options(), const foo);
+   |                                     ^^^ non-constant value
+
+error[E0435]: attempt to use a non-constant value in a constant
+  --> $DIR/parse-error.rs:40:31
+   |
+LL |     let mut foo = 0;
+   |      ---------- help: consider using `const` instead of `let`: `const foo`
+...
+LL |         asm!("{a}", a = const foo, a = const bar);
+   |                               ^^^ non-constant value
+
+error[E0435]: attempt to use a non-constant value in a constant
+  --> $DIR/parse-error.rs:40:46
+   |
+LL |     let mut bar = 0;
+   |      ---------- help: consider using `const` instead of `let`: `const bar`
+...
+LL |         asm!("{a}", a = const foo, a = const bar);
+   |                                              ^^^ non-constant value
+
+error[E0435]: attempt to use a non-constant value in a constant
+  --> $DIR/parse-error.rs:47:46
+   |
+LL |     let mut bar = 0;
+   |      ---------- help: consider using `const` instead of `let`: `const bar`
+...
+LL |         asm!("{a}", in("eax") foo, a = const bar);
+   |                                              ^^^ non-constant value
+
+error[E0435]: attempt to use a non-constant value in a constant
+  --> $DIR/parse-error.rs:50:46
+   |
+LL |     let mut bar = 0;
+   |      ---------- help: consider using `const` instead of `let`: `const bar`
+...
+LL |         asm!("{a}", in("eax") foo, a = const bar);
+   |                                              ^^^ non-constant value
+
+error[E0435]: attempt to use a non-constant value in a constant
+  --> $DIR/parse-error.rs:53:42
+   |
+LL |     let mut bar = 0;
+   |      ---------- help: consider using `const` instead of `let`: `const bar`
+...
+LL |         asm!("{1}", in("eax") foo, const bar);
+   |                                          ^^^ non-constant value
+
+error: aborting due to 31 previous errors
 
+For more information about this error, try `rustc --explain E0435`.
diff --git a/src/test/ui/asm/type-check-1.rs b/src/test/ui/asm/type-check-1.rs
index 7880382c3b7..57a91aaa934 100644
--- a/src/test/ui/asm/type-check-1.rs
+++ b/src/test/ui/asm/type-check-1.rs
@@ -21,5 +21,23 @@ fn main() {
         //~^ ERROR the size for values of type `[u64]` cannot be known at compilation time
         asm!("{}", inout(reg) v[..]);
         //~^ ERROR the size for values of type `[u64]` cannot be known at compilation time
+
+        // Constants must be... constant
+
+        let x = 0;
+        const fn const_foo(x: i32) -> i32 {
+            x
+        }
+        const fn const_bar<T>(x: T) -> T {
+            x
+        }
+        asm!("{}", const x);
+        //~^ ERROR attempt to use a non-constant value in a constant
+        asm!("{}", const const_foo(0));
+        asm!("{}", const const_foo(x));
+        //~^ ERROR attempt to use a non-constant value in a constant
+        asm!("{}", const const_bar(0));
+        asm!("{}", const const_bar(x));
+        //~^ ERROR attempt to use a non-constant value in a constant
     }
 }
diff --git a/src/test/ui/asm/type-check-1.stderr b/src/test/ui/asm/type-check-1.stderr
index 556e83fdb0d..eefab6d3977 100644
--- a/src/test/ui/asm/type-check-1.stderr
+++ b/src/test/ui/asm/type-check-1.stderr
@@ -1,3 +1,30 @@
+error[E0435]: attempt to use a non-constant value in a constant
+  --> $DIR/type-check-1.rs:34:26
+   |
+LL |         let x = 0;
+   |         ----- help: consider using `const` instead of `let`: `const x`
+...
+LL |         asm!("{}", const x);
+   |                          ^ non-constant value
+
+error[E0435]: attempt to use a non-constant value in a constant
+  --> $DIR/type-check-1.rs:37:36
+   |
+LL |         let x = 0;
+   |         ----- help: consider using `const` instead of `let`: `const x`
+...
+LL |         asm!("{}", const const_foo(x));
+   |                                    ^ non-constant value
+
+error[E0435]: attempt to use a non-constant value in a constant
+  --> $DIR/type-check-1.rs:40:36
+   |
+LL |         let x = 0;
+   |         ----- help: consider using `const` instead of `let`: `const x`
+...
+LL |         asm!("{}", const const_bar(x));
+   |                                    ^ non-constant value
+
 error: invalid asm output
   --> $DIR/type-check-1.rs:10:29
    |
@@ -37,6 +64,7 @@ LL |         asm!("{}", inout(reg) v[..]);
    = help: the trait `Sized` is not implemented for `[u64]`
    = note: all inline asm arguments must have a statically known size
 
-error: aborting due to 5 previous errors
+error: aborting due to 8 previous errors
 
-For more information about this error, try `rustc --explain E0277`.
+Some errors have detailed explanations: E0277, E0435.
+For more information about an error, try `rustc --explain E0277`.
diff --git a/src/test/ui/asm/type-check-2.rs b/src/test/ui/asm/type-check-2.rs
index 01c8b4eb654..0677167ccfe 100644
--- a/src/test/ui/asm/type-check-2.rs
+++ b/src/test/ui/asm/type-check-2.rs
@@ -28,31 +28,19 @@ fn main() {
 
         // Const operands must be integer or floats, and must be constants.
 
-        let x = 0;
-        const C: i32 = 0;
-        const fn const_foo(x: i32) -> i32 {
-            x
-        }
-        const fn const_bar<T>(x: T) -> T {
-            x
-        }
+        asm!("{}", const 0);
         asm!("{}", const 0i32);
         asm!("{}", const 0f32);
         asm!("{}", const 0 as *mut u8);
         //~^ ERROR asm `const` arguments must be integer or floating-point values
-        asm!("{}", const &0);
-        //~^ ERROR asm `const` arguments must be integer or floating-point values
-        asm!("{}", const x);
-        //~^ ERROR argument 1 is required to be a constant
-        asm!("{}", const const_foo(0));
-        asm!("{}", const const_foo(x));
-        //~^ ERROR argument 1 is required to be a constant
-        asm!("{}", const const_bar(0));
-        asm!("{}", const const_bar(x));
-        //~^ ERROR argument 1 is required to be a constant
+
+        // This currently causes an ICE: https://github.com/rust-lang/rust/issues/81857
+        // asm!("{}", const &0);
+        // ERROR asm `const` arguments must be integer or floating-point values
 
         // Sym operands must point to a function or static
 
+        const C: i32 = 0;
         static S: i32 = 0;
         asm!("{}", sym S);
         asm!("{}", sym main);
diff --git a/src/test/ui/asm/type-check-2.stderr b/src/test/ui/asm/type-check-2.stderr
index a520bea8f1d..830ca7b5550 100644
--- a/src/test/ui/asm/type-check-2.stderr
+++ b/src/test/ui/asm/type-check-2.stderr
@@ -1,25 +1,19 @@
 error: asm `const` arguments must be integer or floating-point values
-  --> $DIR/type-check-2.rs:41:26
+  --> $DIR/type-check-2.rs:34:20
    |
 LL |         asm!("{}", const 0 as *mut u8);
-   |                          ^^^^^^^^^^^^
-
-error: asm `const` arguments must be integer or floating-point values
-  --> $DIR/type-check-2.rs:43:26
-   |
-LL |         asm!("{}", const &0);
-   |                          ^^
+   |                    ^^^^^^^^^^^^^^^^^^
 
 error: arguments for inline assembly must be copyable
-  --> $DIR/type-check-2.rs:66:32
+  --> $DIR/type-check-2.rs:54:32
    |
 LL |         asm!("{}", in(xmm_reg) SimdNonCopy(0.0, 0.0, 0.0, 0.0));
    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: `SimdNonCopy` does not implement the Copy trait
 
-error: cannot use value of type `[closure@$DIR/type-check-2.rs:78:28: 78:38]` for inline assembly
-  --> $DIR/type-check-2.rs:78:28
+error: cannot use value of type `[closure@$DIR/type-check-2.rs:66:28: 66:38]` for inline assembly
+  --> $DIR/type-check-2.rs:66:28
    |
 LL |         asm!("{}", in(reg) |x: i32| x);
    |                            ^^^^^^^^^^
@@ -27,7 +21,7 @@ LL |         asm!("{}", in(reg) |x: i32| x);
    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
 
 error: cannot use value of type `Vec<i32>` for inline assembly
-  --> $DIR/type-check-2.rs:80:28
+  --> $DIR/type-check-2.rs:68:28
    |
 LL |         asm!("{}", in(reg) vec![0]);
    |                            ^^^^^^^
@@ -36,7 +30,7 @@ LL |         asm!("{}", in(reg) vec![0]);
    = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: cannot use value of type `(i32, i32, i32)` for inline assembly
-  --> $DIR/type-check-2.rs:82:28
+  --> $DIR/type-check-2.rs:70:28
    |
 LL |         asm!("{}", in(reg) (1, 2, 3));
    |                            ^^^^^^^^^
@@ -44,7 +38,7 @@ LL |         asm!("{}", in(reg) (1, 2, 3));
    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
 
 error: cannot use value of type `[i32; 3]` for inline assembly
-  --> $DIR/type-check-2.rs:84:28
+  --> $DIR/type-check-2.rs:72:28
    |
 LL |         asm!("{}", in(reg) [1, 2, 3]);
    |                            ^^^^^^^^^
@@ -52,7 +46,7 @@ LL |         asm!("{}", in(reg) [1, 2, 3]);
    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
 
 error: cannot use value of type `fn() {main}` for inline assembly
-  --> $DIR/type-check-2.rs:92:31
+  --> $DIR/type-check-2.rs:80:31
    |
 LL |         asm!("{}", inout(reg) f);
    |                               ^
@@ -60,7 +54,7 @@ LL |         asm!("{}", inout(reg) f);
    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
 
 error: cannot use value of type `&mut i32` for inline assembly
-  --> $DIR/type-check-2.rs:95:31
+  --> $DIR/type-check-2.rs:83:31
    |
 LL |         asm!("{}", inout(reg) r);
    |                               ^
@@ -68,35 +62,17 @@ LL |         asm!("{}", inout(reg) r);
    = note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
 
 error: asm `sym` operand must point to a fn or static
-  --> $DIR/type-check-2.rs:59:24
+  --> $DIR/type-check-2.rs:47:24
    |
 LL |         asm!("{}", sym C);
    |                        ^
 
 error: asm `sym` operand must point to a fn or static
-  --> $DIR/type-check-2.rs:61:24
+  --> $DIR/type-check-2.rs:49:24
    |
 LL |         asm!("{}", sym x);
    |                        ^
 
-error: argument 1 is required to be a constant
-  --> $DIR/type-check-2.rs:45:9
-   |
-LL |         asm!("{}", const x);
-   |         ^^^^^^^^^^^^^^^^^^^^
-
-error: argument 1 is required to be a constant
-  --> $DIR/type-check-2.rs:48:9
-   |
-LL |         asm!("{}", const const_foo(x));
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: argument 1 is required to be a constant
-  --> $DIR/type-check-2.rs:51:9
-   |
-LL |         asm!("{}", const const_bar(x));
-   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
 error[E0381]: use of possibly-uninitialized variable: `x`
   --> $DIR/type-check-2.rs:13:28
    |
@@ -127,7 +103,7 @@ LL |         let v: Vec<u64> = vec![0, 1, 2];
 LL |         asm!("{}", inout(reg) v[0]);
    |                               ^ cannot borrow as mutable
 
-error: aborting due to 18 previous errors
+error: aborting due to 14 previous errors
 
 Some errors have detailed explanations: E0381, E0596.
 For more information about an error, try `rustc --explain E0381`.
diff --git a/src/test/ui/associated-types/associated-types-coherence-failure.stderr b/src/test/ui/associated-types/associated-types-coherence-failure.stderr
index 2c53b0a2248..211613b3714 100644
--- a/src/test/ui/associated-types/associated-types-coherence-failure.stderr
+++ b/src/test/ui/associated-types/associated-types-coherence-failure.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `IntoCow<'_, _>` for type `Cow<'_, _>`:
+error[E0119]: conflicting implementations of trait `IntoCow<'_, _>` for type `Cow<'_, _>`
   --> $DIR/associated-types-coherence-failure.rs:21:1
    |
 LL | impl<'a, B: ?Sized> IntoCow<'a, B> for <B as ToOwned>::Owned where B: ToOwned {
@@ -7,7 +7,7 @@ LL | impl<'a, B: ?Sized> IntoCow<'a, B> for <B as ToOwned>::Owned where B: ToOwn
 LL | impl<'a, B: ?Sized> IntoCow<'a, B> for Cow<'a, B> where B: ToOwned {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Cow<'_, _>`
 
-error[E0119]: conflicting implementations of trait `IntoCow<'_, _>` for type `&_`:
+error[E0119]: conflicting implementations of trait `IntoCow<'_, _>` for type `&_`
   --> $DIR/associated-types-coherence-failure.rs:28:1
    |
 LL | impl<'a, B: ?Sized> IntoCow<'a, B> for <B as ToOwned>::Owned where B: ToOwned {
diff --git a/src/test/ui/async-await/issue-67651.stderr b/src/test/ui/async-await/issue-67651.stderr
index 99857c215eb..89017f6cc3e 100644
--- a/src/test/ui/async-await/issue-67651.stderr
+++ b/src/test/ui/async-await/issue-67651.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `From` for type `()`:
+error[E0119]: conflicting implementations of trait `From` for type `()`
   --> $DIR/issue-67651.rs:11:1
    |
 LL | impl From for () {
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.stderr
index e95826ed4d5..9156972a1df 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.stderr
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-implemented.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `MyTrait`:
+error[E0119]: conflicting implementations of trait `MyTrait`
   --> $DIR/coherence-blanket-conflicts-with-blanket-implemented.rs:24:1
    |
 LL | impl<T:Even> MyTrait for T {
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.stderr
index ea9838b4520..8400968e122 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.stderr
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-blanket-unimplemented.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `MyTrait`:
+error[E0119]: conflicting implementations of trait `MyTrait`
   --> $DIR/coherence-blanket-conflicts-with-blanket-unimplemented.rs:20:1
    |
 LL | impl<T:Even> MyTrait for T {
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.stderr
index a2008f04265..c25c4369292 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.stderr
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-cross-crate.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `go_trait::GoMut` for type `MyThingy`:
+error[E0119]: conflicting implementations of trait `go_trait::GoMut` for type `MyThingy`
   --> $DIR/coherence-blanket-conflicts-with-specific-cross-crate.rs:15:1
    |
 LL | impl GoMut for MyThingy {
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.stderr
index af4f4d09d7a..c2a925213da 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.stderr
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `MyTrait<MyType>` for type `MyType`:
+error[E0119]: conflicting implementations of trait `MyTrait<MyType>` for type `MyType`
   --> $DIR/coherence-blanket-conflicts-with-specific-multidispatch.rs:22:1
    |
 LL | impl<T> MyTrait<T> for T {
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.stderr
index 6922f3ebffa..e1a5dffebda 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.stderr
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific-trait.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType`:
+error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType`
   --> $DIR/coherence-blanket-conflicts-with-specific-trait.rs:20:1
    |
 LL | impl<T:OtherTrait> MyTrait for T {
diff --git a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr
index 4bc28276479..ba60a2ea929 100644
--- a/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr
+++ b/src/test/ui/coherence/coherence-blanket-conflicts-with-specific.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType`:
+error[E0119]: conflicting implementations of trait `MyTrait` for type `MyType`
   --> $DIR/coherence-blanket-conflicts-with-specific.rs:19:1
    |
 LL | impl<T> MyTrait for T {
diff --git a/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr b/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr
index 4d9f815c795..5295170cd8b 100644
--- a/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr
+++ b/src/test/ui/coherence/coherence-conflicting-negative-trait-impl.stderr
@@ -7,7 +7,7 @@ LL |
 LL | impl<T: MyTrait> !Send for TestType<T> {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here
 
-error[E0119]: conflicting implementations of trait `std::marker::Send` for type `TestType<_>`:
+error[E0119]: conflicting implementations of trait `std::marker::Send` for type `TestType<_>`
   --> $DIR/coherence-conflicting-negative-trait-impl.rs:13:1
    |
 LL | unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
diff --git a/src/test/ui/coherence/coherence-cross-crate-conflict.stderr b/src/test/ui/coherence/coherence-cross-crate-conflict.stderr
index 827d26ab434..d0d86c72ffc 100644
--- a/src/test/ui/coherence/coherence-cross-crate-conflict.stderr
+++ b/src/test/ui/coherence/coherence-cross-crate-conflict.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `trait_impl_conflict::Foo` for type `isize`:
+error[E0119]: conflicting implementations of trait `trait_impl_conflict::Foo` for type `isize`
   --> $DIR/coherence-cross-crate-conflict.rs:9:1
    |
 LL | impl<A> Foo for A {
diff --git a/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr b/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr
index 49271edf8e5..7dabd97b94e 100644
--- a/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr
+++ b/src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `Trait` for type `for<'r> fn(fn(&'r ()))`:
+error[E0119]: conflicting implementations of trait `Trait` for type `for<'r> fn(fn(&'r ()))`
   --> $DIR/coherence-fn-covariant-bound-vs-static.rs:17:1
    |
 LL | impl Trait for for<'r> fn(fn(&'r ())) {}
diff --git a/src/test/ui/coherence/coherence-fn-implied-bounds.stderr b/src/test/ui/coherence/coherence-fn-implied-bounds.stderr
index a3e7f0bcde3..c8accc99747 100644
--- a/src/test/ui/coherence/coherence-fn-implied-bounds.stderr
+++ b/src/test/ui/coherence/coherence-fn-implied-bounds.stderr
@@ -1,4 +1,4 @@
-error: conflicting implementations of trait `Trait` for type `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32`:
+error: conflicting implementations of trait `Trait` for type `for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32`
   --> $DIR/coherence-fn-implied-bounds.rs:21:1
    |
 LL | impl Trait for for<'a, 'b> fn(&'a &'b u32, &'b &'a u32) -> &'b u32 {}
diff --git a/src/test/ui/coherence/coherence-fn-inputs.stderr b/src/test/ui/coherence/coherence-fn-inputs.stderr
index 56ab873a393..82bd8a35f45 100644
--- a/src/test/ui/coherence/coherence-fn-inputs.stderr
+++ b/src/test/ui/coherence/coherence-fn-inputs.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `Trait` for type `for<'a, 'b> fn(&'a u32, &'b u32)`:
+error[E0119]: conflicting implementations of trait `Trait` for type `for<'a, 'b> fn(&'a u32, &'b u32)`
   --> $DIR/coherence-fn-inputs.rs:15:1
    |
 LL | impl Trait for for<'a, 'b> fn(&'a u32, &'b u32) {}
diff --git a/src/test/ui/coherence/coherence-free-vs-bound-region.stderr b/src/test/ui/coherence/coherence-free-vs-bound-region.stderr
index 97aa4912721..c249fa43c3b 100644
--- a/src/test/ui/coherence/coherence-free-vs-bound-region.stderr
+++ b/src/test/ui/coherence/coherence-free-vs-bound-region.stderr
@@ -1,4 +1,4 @@
-error: conflicting implementations of trait `TheTrait` for type `fn(&u8)`:
+error: conflicting implementations of trait `TheTrait` for type `fn(&u8)`
   --> $DIR/coherence-free-vs-bound-region.rs:16:1
    |
 LL | impl<'a> TheTrait for fn(&'a u8) {}
diff --git a/src/test/ui/coherence/coherence-impls-copy.stderr b/src/test/ui/coherence/coherence-impls-copy.stderr
index 8cc24f099e3..2ac0706d72e 100644
--- a/src/test/ui/coherence/coherence-impls-copy.stderr
+++ b/src/test/ui/coherence/coherence-impls-copy.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `i32`:
+error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `i32`
   --> $DIR/coherence-impls-copy.rs:5:1
    |
 LL | impl Copy for i32 {}
@@ -7,7 +7,7 @@ LL | impl Copy for i32 {}
    = note: conflicting implementation in crate `core`:
            - impl Copy for i32;
 
-error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&NotSync`:
+error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&NotSync`
   --> $DIR/coherence-impls-copy.rs:29:1
    |
 LL | impl Copy for &'static NotSync {}
@@ -17,7 +17,7 @@ LL | impl Copy for &'static NotSync {}
            - impl<T> Copy for &T
              where T: ?Sized;
 
-error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&[NotSync]`:
+error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&[NotSync]`
   --> $DIR/coherence-impls-copy.rs:34:1
    |
 LL | impl Copy for &'static [NotSync] {}
diff --git a/src/test/ui/coherence/coherence-impls-send.stderr b/src/test/ui/coherence/coherence-impls-send.stderr
index edca31b5dae..46e9e7e986c 100644
--- a/src/test/ui/coherence/coherence-impls-send.stderr
+++ b/src/test/ui/coherence/coherence-impls-send.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `std::marker::Send` for type `&[NotSync]`:
+error[E0119]: conflicting implementations of trait `std::marker::Send` for type `&[NotSync]`
   --> $DIR/coherence-impls-send.rs:25:1
    |
 LL | unsafe impl Send for &'static [NotSync] {}
diff --git a/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr b/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr
index a74ffbb3afd..8a43ad7b7f0 100644
--- a/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr
+++ b/src/test/ui/coherence/coherence-no-direct-lifetime-dispatch.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `MyTrait`:
+error[E0119]: conflicting implementations of trait `MyTrait`
   --> $DIR/coherence-no-direct-lifetime-dispatch.rs:6:1
    |
 LL | impl<T> MyTrait for T {}
diff --git a/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.stderr b/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.stderr
index 5e8bfbcc3ca..6a0880334b6 100644
--- a/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.stderr
+++ b/src/test/ui/coherence/coherence-overlap-all-t-and-tuple.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `From<(_,)>` for type `(_,)`:
+error[E0119]: conflicting implementations of trait `From<(_,)>` for type `(_,)`
   --> $DIR/coherence-overlap-all-t-and-tuple.rs:16:1
    |
 LL | impl <T> From<T> for T {
diff --git a/src/test/ui/coherence/coherence-overlap-downstream.stderr b/src/test/ui/coherence/coherence-overlap-downstream.stderr
index 6fb398562d6..9ab099489d9 100644
--- a/src/test/ui/coherence/coherence-overlap-downstream.stderr
+++ b/src/test/ui/coherence/coherence-overlap-downstream.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `Sweet`:
+error[E0119]: conflicting implementations of trait `Sweet`
   --> $DIR/coherence-overlap-downstream.rs:8:1
    |
 LL | impl<T:Sugar> Sweet for T { }
@@ -6,7 +6,7 @@ LL | impl<T:Sugar> Sweet for T { }
 LL | impl<T:Fruit> Sweet for T { }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
 
-error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32`:
+error[E0119]: conflicting implementations of trait `Foo<_>` for type `i32`
   --> $DIR/coherence-overlap-downstream.rs:14:1
    |
 LL | impl<X, T> Foo<X> for T where T: Bar<X> {}
diff --git a/src/test/ui/coherence/coherence-overlap-issue-23516.stderr b/src/test/ui/coherence/coherence-overlap-issue-23516.stderr
index fe4c5cf3490..85eb189e10e 100644
--- a/src/test/ui/coherence/coherence-overlap-issue-23516.stderr
+++ b/src/test/ui/coherence/coherence-overlap-issue-23516.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `Sweet` for type `std::boxed::Box<_>`:
+error[E0119]: conflicting implementations of trait `Sweet` for type `std::boxed::Box<_>`
   --> $DIR/coherence-overlap-issue-23516.rs:8:1
    |
 LL | impl<T:Sugar> Sweet for T { }
diff --git a/src/test/ui/coherence/coherence-overlap-messages.stderr b/src/test/ui/coherence/coherence-overlap-messages.stderr
index 28147f52fa6..5a97296eebd 100644
--- a/src/test/ui/coherence/coherence-overlap-messages.stderr
+++ b/src/test/ui/coherence/coherence-overlap-messages.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `Foo`:
+error[E0119]: conflicting implementations of trait `Foo`
   --> $DIR/coherence-overlap-messages.rs:4:1
    |
 LL | impl<T> Foo for T {}
@@ -6,7 +6,7 @@ LL | impl<T> Foo for T {}
 LL | impl<U> Foo for U {}
    | ^^^^^^^^^^^^^^^^^ conflicting implementation
 
-error[E0119]: conflicting implementations of trait `Bar` for type `(u8, u8)`:
+error[E0119]: conflicting implementations of trait `Bar` for type `(u8, u8)`
   --> $DIR/coherence-overlap-messages.rs:11:1
    |
 LL | impl<T> Bar for (T, u8) {}
@@ -14,7 +14,7 @@ LL | impl<T> Bar for (T, u8) {}
 LL | impl<T> Bar for (u8, T) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(u8, u8)`
 
-error[E0119]: conflicting implementations of trait `Baz<u8>` for type `u8`:
+error[E0119]: conflicting implementations of trait `Baz<u8>` for type `u8`
   --> $DIR/coherence-overlap-messages.rs:17:1
    |
 LL | impl<T> Baz<u8> for T {}
@@ -22,7 +22,7 @@ LL | impl<T> Baz<u8> for T {}
 LL | impl<T> Baz<T> for u8 {}
    | ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u8`
 
-error[E0119]: conflicting implementations of trait `Quux<_, _>`:
+error[E0119]: conflicting implementations of trait `Quux<_, _>`
   --> $DIR/coherence-overlap-messages.rs:23:1
    |
 LL | impl<T, U, V> Quux<U, V> for T {}
@@ -30,7 +30,7 @@ LL | impl<T, U, V> Quux<U, V> for T {}
 LL | impl<T, U> Quux<U, U> for T {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation
 
-error[E0119]: conflicting implementations of trait `Quux<_, _>`:
+error[E0119]: conflicting implementations of trait `Quux<_, _>`
   --> $DIR/coherence-overlap-messages.rs:25:1
    |
 LL | impl<T, U, V> Quux<U, V> for T {}
diff --git a/src/test/ui/coherence/coherence-overlap-upstream.stderr b/src/test/ui/coherence/coherence-overlap-upstream.stderr
index 8d3de9a243e..8272c887586 100644
--- a/src/test/ui/coherence/coherence-overlap-upstream.stderr
+++ b/src/test/ui/coherence/coherence-overlap-upstream.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `Foo` for type `i16`:
+error[E0119]: conflicting implementations of trait `Foo` for type `i16`
   --> $DIR/coherence-overlap-upstream.rs:13:1
    |
 LL | impl<T> Foo for T where T: Remote {}
diff --git a/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr b/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr
index 06a840255bd..51f6faab3c7 100644
--- a/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr
+++ b/src/test/ui/coherence/coherence-projection-conflict-orphan.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `Foo<i32>` for type `i32`:
+error[E0119]: conflicting implementations of trait `Foo<i32>` for type `i32`
   --> $DIR/coherence-projection-conflict-orphan.rs:16:1
    |
 LL | impl Foo<i32> for i32 { }
diff --git a/src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr b/src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr
index c5c9b0ac33c..85d3d358f83 100644
--- a/src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr
+++ b/src/test/ui/coherence/coherence-projection-conflict-ty-param.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `Foo<_>` for type `std::option::Option<_>`:
+error[E0119]: conflicting implementations of trait `Foo<_>` for type `std::option::Option<_>`
   --> $DIR/coherence-projection-conflict-ty-param.rs:10:1
    |
 LL | impl <P, T: Foo<P>> Foo<P> for Option<T> {}
diff --git a/src/test/ui/coherence/coherence-projection-conflict.stderr b/src/test/ui/coherence/coherence-projection-conflict.stderr
index aed6910b529..e7d1fb29346 100644
--- a/src/test/ui/coherence/coherence-projection-conflict.stderr
+++ b/src/test/ui/coherence/coherence-projection-conflict.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `Foo<i32>` for type `i32`:
+error[E0119]: conflicting implementations of trait `Foo<i32>` for type `i32`
   --> $DIR/coherence-projection-conflict.rs:11:1
    |
 LL | impl Foo<i32> for i32 { }
diff --git a/src/test/ui/coherence/coherence-subtyping.stderr b/src/test/ui/coherence/coherence-subtyping.stderr
index 7f751a24c75..6f95f0a06b5 100644
--- a/src/test/ui/coherence/coherence-subtyping.stderr
+++ b/src/test/ui/coherence/coherence-subtyping.stderr
@@ -1,4 +1,4 @@
-warning: conflicting implementations of trait `TheTrait` for type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`:
+warning: conflicting implementations of trait `TheTrait` for type `for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8`
   --> $DIR/coherence-subtyping.rs:15:1
    |
 LL | impl TheTrait for for<'a, 'b> fn(&'a u8, &'b u8) -> &'a u8 {}
diff --git a/src/test/ui/coherence/coherence-tuple-conflict.stderr b/src/test/ui/coherence/coherence-tuple-conflict.stderr
index f6c2bc32aa8..09ad5e5b224 100644
--- a/src/test/ui/coherence/coherence-tuple-conflict.stderr
+++ b/src/test/ui/coherence/coherence-tuple-conflict.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `MyTrait` for type `(_, _)`:
+error[E0119]: conflicting implementations of trait `MyTrait` for type `(_, _)`
   --> $DIR/coherence-tuple-conflict.rs:15:1
    |
 LL | impl<T> MyTrait for (T,T) {
diff --git a/src/test/ui/coherence/coherence-wasm-bindgen.stderr b/src/test/ui/coherence/coherence-wasm-bindgen.stderr
index c77483bb847..432646e5321 100644
--- a/src/test/ui/coherence/coherence-wasm-bindgen.stderr
+++ b/src/test/ui/coherence/coherence-wasm-bindgen.stderr
@@ -1,4 +1,4 @@
-error: conflicting implementations of trait `IntoWasmAbi` for type `&dyn std::ops::Fn(&_) -> _`:
+error: conflicting implementations of trait `IntoWasmAbi` for type `&dyn std::ops::Fn(&_) -> _`
   --> $DIR/coherence-wasm-bindgen.rs:28:1
    |
 LL | / impl<'a, 'b, A, R> IntoWasmAbi for &'a (dyn Fn(A) -> R + 'b)
diff --git a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.stderr b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.stderr
index cf6c6fb8c7a..db730650185 100644
--- a/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.stderr
+++ b/src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_tuple.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyFundamentalStruct<(MyType,)>`:
+error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyFundamentalStruct<(MyType,)>`
   --> $DIR/coherence_copy_like_err_fundamental_struct_tuple.rs:16:1
    |
 LL | impl<T: lib::MyCopy> MyTrait for T { }
diff --git a/src/test/ui/coherence/coherence_copy_like_err_struct.stderr b/src/test/ui/coherence/coherence_copy_like_err_struct.stderr
index cf79e851bf4..3bc3dffda5d 100644
--- a/src/test/ui/coherence/coherence_copy_like_err_struct.stderr
+++ b/src/test/ui/coherence/coherence_copy_like_err_struct.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyStruct<MyType>`:
+error[E0119]: conflicting implementations of trait `MyTrait` for type `lib::MyStruct<MyType>`
   --> $DIR/coherence_copy_like_err_struct.rs:19:1
    |
 LL | impl<T: lib::MyCopy> MyTrait for T { }
diff --git a/src/test/ui/coherence/coherence_copy_like_err_tuple.stderr b/src/test/ui/coherence/coherence_copy_like_err_tuple.stderr
index 52f66427dfa..090497ec189 100644
--- a/src/test/ui/coherence/coherence_copy_like_err_tuple.stderr
+++ b/src/test/ui/coherence/coherence_copy_like_err_tuple.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `MyTrait` for type `(MyType,)`:
+error[E0119]: conflicting implementations of trait `MyTrait` for type `(MyType,)`
   --> $DIR/coherence_copy_like_err_tuple.rs:18:1
    |
 LL | impl<T: lib::MyCopy> MyTrait for T { }
diff --git a/src/test/ui/const-generics/issues/issue-64494.min.stderr b/src/test/ui/const-generics/issues/issue-64494.min.stderr
index 936ab7f6e7e..846db0c91b6 100644
--- a/src/test/ui/const-generics/issues/issue-64494.min.stderr
+++ b/src/test/ui/const-generics/issues/issue-64494.min.stderr
@@ -16,7 +16,7 @@ LL | impl<T: Foo> MyTrait for T where Is<{T::VAL == 6}>: True {}
    = note: type parameters may not be used in const expressions
    = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions
 
-error[E0119]: conflicting implementations of trait `MyTrait`:
+error[E0119]: conflicting implementations of trait `MyTrait`
   --> $DIR/issue-64494.rs:18:1
    |
 LL | impl<T: Foo> MyTrait for T where Is<{T::VAL == 5}>: True {}
diff --git a/src/test/ui/error-codes/E0119.stderr b/src/test/ui/error-codes/E0119.stderr
index e7690aa30bd..e08a2c7fcbb 100644
--- a/src/test/ui/error-codes/E0119.stderr
+++ b/src/test/ui/error-codes/E0119.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `MyTrait` for type `Foo`:
+error[E0119]: conflicting implementations of trait `MyTrait` for type `Foo`
   --> $DIR/E0119.rs:13:1
    |
 LL | impl<T> MyTrait for T {
diff --git a/src/test/ui/error-codes/e0119/complex-impl.stderr b/src/test/ui/error-codes/e0119/complex-impl.stderr
index d617d812924..04babb06447 100644
--- a/src/test/ui/error-codes/e0119/complex-impl.stderr
+++ b/src/test/ui/error-codes/e0119/complex-impl.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `complex_impl_support::External` for type `(Q, complex_impl_support::M<'_, '_, '_, std::boxed::Box<_>, _, _>)`:
+error[E0119]: conflicting implementations of trait `complex_impl_support::External` for type `(Q, complex_impl_support::M<'_, '_, '_, std::boxed::Box<_>, _, _>)`
   --> $DIR/complex-impl.rs:9:1
    |
 LL | impl<R> External for (Q, R) {}
diff --git a/src/test/ui/error-codes/e0119/conflict-with-std.stderr b/src/test/ui/error-codes/e0119/conflict-with-std.stderr
index 68551f43775..3ff96a6a4d6 100644
--- a/src/test/ui/error-codes/e0119/conflict-with-std.stderr
+++ b/src/test/ui/error-codes/e0119/conflict-with-std.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `std::convert::AsRef<Q>` for type `std::boxed::Box<Q>`:
+error[E0119]: conflicting implementations of trait `std::convert::AsRef<Q>` for type `std::boxed::Box<Q>`
   --> $DIR/conflict-with-std.rs:5:1
    |
 LL | impl AsRef<Q> for Box<Q> {
@@ -8,7 +8,7 @@ LL | impl AsRef<Q> for Box<Q> {
            - impl<T, A> AsRef<T> for Box<T, A>
              where A: Allocator, T: ?Sized;
 
-error[E0119]: conflicting implementations of trait `std::convert::From<S>` for type `S`:
+error[E0119]: conflicting implementations of trait `std::convert::From<S>` for type `S`
   --> $DIR/conflict-with-std.rs:12:1
    |
 LL | impl From<S> for S {
@@ -17,7 +17,7 @@ LL | impl From<S> for S {
    = note: conflicting implementation in crate `core`:
            - impl<T> From<T> for T;
 
-error[E0119]: conflicting implementations of trait `std::convert::TryFrom<X>` for type `X`:
+error[E0119]: conflicting implementations of trait `std::convert::TryFrom<X>` for type `X`
   --> $DIR/conflict-with-std.rs:19:1
    |
 LL | impl TryFrom<X> for X {
diff --git a/src/test/ui/error-codes/e0119/issue-23563.stderr b/src/test/ui/error-codes/e0119/issue-23563.stderr
index 912a80fec75..f149cef587f 100644
--- a/src/test/ui/error-codes/e0119/issue-23563.stderr
+++ b/src/test/ui/error-codes/e0119/issue-23563.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `a::LolFrom<&[_]>` for type `LocalType<_>`:
+error[E0119]: conflicting implementations of trait `a::LolFrom<&[_]>` for type `LocalType<_>`
   --> $DIR/issue-23563.rs:13:1
    |
 LL | impl<'a, T> LolFrom<&'a [T]> for LocalType<T> {
diff --git a/src/test/ui/error-codes/e0119/issue-27403.stderr b/src/test/ui/error-codes/e0119/issue-27403.stderr
index ea74c9b21bd..c11a5048747 100644
--- a/src/test/ui/error-codes/e0119/issue-27403.stderr
+++ b/src/test/ui/error-codes/e0119/issue-27403.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `std::convert::Into<_>` for type `GenX<_>`:
+error[E0119]: conflicting implementations of trait `std::convert::Into<_>` for type `GenX<_>`
   --> $DIR/issue-27403.rs:5:1
    |
 LL | impl<S> Into<S> for GenX<S> {
diff --git a/src/test/ui/error-codes/e0119/issue-28981.stderr b/src/test/ui/error-codes/e0119/issue-28981.stderr
index e12dd762331..56e8e1eb540 100644
--- a/src/test/ui/error-codes/e0119/issue-28981.stderr
+++ b/src/test/ui/error-codes/e0119/issue-28981.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `std::ops::Deref` for type `&_`:
+error[E0119]: conflicting implementations of trait `std::ops::Deref` for type `&_`
   --> $DIR/issue-28981.rs:5:1
    |
 LL | impl<Foo> Deref for Foo { }
diff --git a/src/test/ui/error-codes/e0119/so-37347311.stderr b/src/test/ui/error-codes/e0119/so-37347311.stderr
index a9fbd0fee49..f1c2b0d2974 100644
--- a/src/test/ui/error-codes/e0119/so-37347311.stderr
+++ b/src/test/ui/error-codes/e0119/so-37347311.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `std::convert::From<MyError<_>>` for type `MyError<_>`:
+error[E0119]: conflicting implementations of trait `std::convert::From<MyError<_>>` for type `MyError<_>`
   --> $DIR/so-37347311.rs:11:1
    |
 LL | impl<S: Storage> From<S::Error> for MyError<S> {
diff --git a/src/test/ui/feature-gates/feature-gate-non_ascii_idents.rs b/src/test/ui/feature-gates/feature-gate-non_ascii_idents.rs
index 5cc04ad5cdf..524ad3c83fc 100644
--- a/src/test/ui/feature-gates/feature-gate-non_ascii_idents.rs
+++ b/src/test/ui/feature-gates/feature-gate-non_ascii_idents.rs
@@ -28,6 +28,7 @@ enum Bär { //~ ERROR non-ascii idents
 
 extern "C" {
     fn qüx();  //~ ERROR non-ascii idents
+    //~^ ERROR items in `extern` blocks
 }
 
 fn main() {}
diff --git a/src/test/ui/feature-gates/feature-gate-non_ascii_idents.stderr b/src/test/ui/feature-gates/feature-gate-non_ascii_idents.stderr
index e9392ace4ce..c712acee37f 100644
--- a/src/test/ui/feature-gates/feature-gate-non_ascii_idents.stderr
+++ b/src/test/ui/feature-gates/feature-gate-non_ascii_idents.stderr
@@ -1,3 +1,13 @@
+error: items in `extern` blocks cannot use non-ascii identifiers
+  --> $DIR/feature-gate-non_ascii_idents.rs:30:8
+   |
+LL | extern "C" {
+   | ---------- in this `extern` block
+LL |     fn qüx();
+   |        ^^^
+   |
+   = note: This limitation may be lifted in the future; see issue #83942 <https://github.com/rust-lang/rust/issues/83942> for more information
+
 error[E0658]: non-ascii idents are not fully supported
   --> $DIR/feature-gate-non_ascii_idents.rs:1:22
    |
@@ -115,6 +125,6 @@ LL |     fn qüx();
    = note: see issue #55467 <https://github.com/rust-lang/rust/issues/55467> for more information
    = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable
 
-error: aborting due to 13 previous errors
+error: aborting due to 14 previous errors
 
 For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gates/feature-gate-overlapping_marker_traits.stderr b/src/test/ui/feature-gates/feature-gate-overlapping_marker_traits.stderr
index 5ce4c5cccb3..0526c6dc839 100644
--- a/src/test/ui/feature-gates/feature-gate-overlapping_marker_traits.stderr
+++ b/src/test/ui/feature-gates/feature-gate-overlapping_marker_traits.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `MyMarker`:
+error[E0119]: conflicting implementations of trait `MyMarker`
   --> $DIR/feature-gate-overlapping_marker_traits.rs:6:1
    |
 LL | impl<T: Display> MyMarker for T {}
diff --git a/src/test/ui/impl-trait/auto-trait.full_tait.stderr b/src/test/ui/impl-trait/auto-trait.full_tait.stderr
index 7ac08ab4921..314617748b0 100644
--- a/src/test/ui/impl-trait/auto-trait.full_tait.stderr
+++ b/src/test/ui/impl-trait/auto-trait.full_tait.stderr
@@ -7,7 +7,7 @@ LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
    = note: `#[warn(incomplete_features)]` on by default
    = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
 
-error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>`:
+error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>`
   --> $DIR/auto-trait.rs:24:1
    |
 LL | impl<T: Send> AnotherTrait for T {}
diff --git a/src/test/ui/impl-trait/auto-trait.min_tait.stderr b/src/test/ui/impl-trait/auto-trait.min_tait.stderr
index a497dd67e9e..75a5b0cb87d 100644
--- a/src/test/ui/impl-trait/auto-trait.min_tait.stderr
+++ b/src/test/ui/impl-trait/auto-trait.min_tait.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>`:
+error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>`
   --> $DIR/auto-trait.rs:24:1
    |
 LL | impl<T: Send> AnotherTrait for T {}
diff --git a/src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.rs b/src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.rs
new file mode 100644
index 00000000000..d9d2e3929b1
--- /dev/null
+++ b/src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.rs
@@ -0,0 +1,12 @@
+struct Foo<T = impl Copy>(T);
+//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+
+type Result<T, E = impl std::error::Error> = std::result::Result<T, E>;
+//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+
+// should not cause ICE
+fn x() -> Foo {
+    Foo(0)
+}
+
+fn main() -> Result<()> {}
diff --git a/src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.stderr b/src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.stderr
new file mode 100644
index 00000000000..eef6844adfc
--- /dev/null
+++ b/src/test/ui/impl-trait/issues/issue-83929-impl-trait-in-generic-default.stderr
@@ -0,0 +1,15 @@
+error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+  --> $DIR/issue-83929-impl-trait-in-generic-default.rs:1:16
+   |
+LL | struct Foo<T = impl Copy>(T);
+   |                ^^^^^^^^^
+
+error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+  --> $DIR/issue-83929-impl-trait-in-generic-default.rs:4:20
+   |
+LL | type Result<T, E = impl std::error::Error> = std::result::Result<T, E>;
+   |                    ^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0562`.
diff --git a/src/test/ui/impl-trait/negative-reasoning.full_tait.stderr b/src/test/ui/impl-trait/negative-reasoning.full_tait.stderr
index 2611205893f..bccbc8cb36b 100644
--- a/src/test/ui/impl-trait/negative-reasoning.full_tait.stderr
+++ b/src/test/ui/impl-trait/negative-reasoning.full_tait.stderr
@@ -7,7 +7,7 @@ LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
    = note: `#[warn(incomplete_features)]` on by default
    = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
 
-error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>`:
+error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>`
   --> $DIR/negative-reasoning.rs:22:1
    |
 LL | impl<T: std::fmt::Debug> AnotherTrait for T {}
diff --git a/src/test/ui/impl-trait/negative-reasoning.min_tait.stderr b/src/test/ui/impl-trait/negative-reasoning.min_tait.stderr
index bd74b56fecc..5727a372ddb 100644
--- a/src/test/ui/impl-trait/negative-reasoning.min_tait.stderr
+++ b/src/test/ui/impl-trait/negative-reasoning.min_tait.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>`:
+error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D<impl OpaqueTrait>`
   --> $DIR/negative-reasoning.rs:22:1
    |
 LL | impl<T: std::fmt::Debug> AnotherTrait for T {}
diff --git a/src/test/ui/impl-trait/where-allowed.rs b/src/test/ui/impl-trait/where-allowed.rs
index 72b880fb92c..c3e21c81f03 100644
--- a/src/test/ui/impl-trait/where-allowed.rs
+++ b/src/test/ui/impl-trait/where-allowed.rs
@@ -56,12 +56,10 @@ fn in_impl_Fn_return_in_parameters(_: &impl Fn() -> impl Debug) { panic!() }
 fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
 //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
 //~| ERROR nested `impl Trait` is not allowed
-//~| ERROR cannot resolve opaque type
 
 // Disallowed
 fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() }
 //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
-//~| ERROR cannot resolve opaque type
 
 // Disallowed
 fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() }
@@ -120,7 +118,6 @@ trait DummyTrait {
 impl DummyTrait for () {
     type Out = impl Debug;
     //~^ ERROR `impl Trait` in type aliases is unstable
-    //~^^ ERROR could not find defining uses
 
     fn in_trait_impl_parameter(_: impl Debug) { }
     // Allowed
@@ -156,7 +153,6 @@ extern "C" fn in_extern_fn_return() -> impl Debug {
 
 type InTypeAlias<R> = impl Debug;
 //~^ ERROR `impl Trait` in type aliases is unstable
-//~^^ ERROR could not find defining uses
 
 type InReturnInTypeAlias<R> = fn() -> impl Debug;
 //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
@@ -218,6 +214,34 @@ fn in_Fn_return_in_fn_where_clause<T>()
 {
 }
 
+// Disallowed
+struct InStructGenericParamDefault<T = impl Debug>(T);
+//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+
+// Disallowed
+enum InEnumGenericParamDefault<T = impl Debug> { Variant(T) }
+//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+
+// Disallowed
+trait InTraitGenericParamDefault<T = impl Debug> {}
+//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+
+// Disallowed
+type InTypeAliasGenericParamDefault<T = impl Debug> = T;
+//~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
+
+// Disallowed
+impl <T = impl Debug> T {}
+//~^ ERROR defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+//~| WARNING this was previously accepted by the compiler but is being phased out
+//~| ERROR `impl Trait` not allowed outside of function and inherent method return types
+
+// Disallowed
+fn in_method_generic_param_default<T = impl Debug>(_: T) {}
+//~^ ERROR defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+//~| WARNING this was previously accepted by the compiler but is being phased out
+//~| ERROR `impl Trait` not allowed outside of function and inherent method return types
+
 fn main() {
     let _in_local_variable: impl Fn() = || {};
     //~^ ERROR `impl Trait` not allowed outside of function and inherent method return types
diff --git a/src/test/ui/impl-trait/where-allowed.stderr b/src/test/ui/impl-trait/where-allowed.stderr
index 3fdeddc0a86..09ec4d5b202 100644
--- a/src/test/ui/impl-trait/where-allowed.stderr
+++ b/src/test/ui/impl-trait/where-allowed.stderr
@@ -17,7 +17,7 @@ LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic
    |                                                 outer `impl Trait`
 
 error[E0658]: `impl Trait` in type aliases is unstable
-  --> $DIR/where-allowed.rs:121:16
+  --> $DIR/where-allowed.rs:119:16
    |
 LL |     type Out = impl Debug;
    |                ^^^^^^^^^^
@@ -26,7 +26,7 @@ LL |     type Out = impl Debug;
    = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
 
 error[E0658]: `impl Trait` in type aliases is unstable
-  --> $DIR/where-allowed.rs:157:23
+  --> $DIR/where-allowed.rs:154:23
    |
 LL | type InTypeAlias<R> = impl Debug;
    |                       ^^^^^^^^^^
@@ -35,7 +35,7 @@ LL | type InTypeAlias<R> = impl Debug;
    = help: add `#![feature(min_type_alias_impl_trait)]` to the crate attributes to enable
 
 error[E0658]: `impl Trait` in type aliases is unstable
-  --> $DIR/where-allowed.rs:161:39
+  --> $DIR/where-allowed.rs:157:39
    |
 LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
    |                                       ^^^^^^^^^^
@@ -110,139 +110,175 @@ LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic
    |                                                         ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:62:59
+  --> $DIR/where-allowed.rs:61:59
    |
 LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() }
    |                                                           ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:67:38
+  --> $DIR/where-allowed.rs:65:38
    |
 LL | fn in_Fn_parameter_in_generics<F: Fn(impl Debug)> (_: F) { panic!() }
    |                                      ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:71:40
+  --> $DIR/where-allowed.rs:69:40
    |
 LL | fn in_Fn_return_in_generics<F: Fn() -> impl Debug> (_: F) { panic!() }
    |                                        ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:84:32
+  --> $DIR/where-allowed.rs:82:32
    |
 LL | struct InBraceStructField { x: impl Debug }
    |                                ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:88:41
+  --> $DIR/where-allowed.rs:86:41
    |
 LL | struct InAdtInBraceStructField { x: Vec<impl Debug> }
    |                                         ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:92:27
+  --> $DIR/where-allowed.rs:90:27
    |
 LL | struct InTupleStructField(impl Debug);
    |                           ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:97:25
+  --> $DIR/where-allowed.rs:95:25
    |
 LL |     InBraceVariant { x: impl Debug },
    |                         ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:99:20
+  --> $DIR/where-allowed.rs:97:20
    |
 LL |     InTupleVariant(impl Debug),
    |                    ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:110:23
+  --> $DIR/where-allowed.rs:108:23
    |
 LL |     fn in_return() -> impl Debug;
    |                       ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:128:34
+  --> $DIR/where-allowed.rs:125:34
    |
 LL |     fn in_trait_impl_return() -> impl Debug { () }
    |                                  ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:141:33
+  --> $DIR/where-allowed.rs:138:33
    |
 LL |     fn in_foreign_parameters(_: impl Debug);
    |                                 ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:144:31
+  --> $DIR/where-allowed.rs:141:31
    |
 LL |     fn in_foreign_return() -> impl Debug;
    |                               ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:161:39
+  --> $DIR/where-allowed.rs:157:39
    |
 LL | type InReturnInTypeAlias<R> = fn() -> impl Debug;
    |                                       ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:166:16
+  --> $DIR/where-allowed.rs:162:16
    |
 LL | impl PartialEq<impl Debug> for () {
    |                ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:171:24
+  --> $DIR/where-allowed.rs:167:24
    |
 LL | impl PartialEq<()> for impl Debug {
    |                        ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:176:6
+  --> $DIR/where-allowed.rs:172:6
    |
 LL | impl impl Debug {
    |      ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:182:24
+  --> $DIR/where-allowed.rs:178:24
    |
 LL | impl InInherentImplAdt<impl Debug> {
    |                        ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:188:11
+  --> $DIR/where-allowed.rs:184:11
    |
 LL |     where impl Debug: Debug
    |           ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:195:15
+  --> $DIR/where-allowed.rs:191:15
    |
 LL |     where Vec<impl Debug>: Debug
    |               ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:202:24
+  --> $DIR/where-allowed.rs:198:24
    |
 LL |     where T: PartialEq<impl Debug>
    |                        ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:209:17
+  --> $DIR/where-allowed.rs:205:17
    |
 LL |     where T: Fn(impl Debug)
    |                 ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:216:22
+  --> $DIR/where-allowed.rs:212:22
    |
 LL |     where T: Fn() -> impl Debug
    |                      ^^^^^^^^^^
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:222:29
+  --> $DIR/where-allowed.rs:218:40
+   |
+LL | struct InStructGenericParamDefault<T = impl Debug>(T);
+   |                                        ^^^^^^^^^^
+
+error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+  --> $DIR/where-allowed.rs:222:36
+   |
+LL | enum InEnumGenericParamDefault<T = impl Debug> { Variant(T) }
+   |                                    ^^^^^^^^^^
+
+error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+  --> $DIR/where-allowed.rs:226:38
+   |
+LL | trait InTraitGenericParamDefault<T = impl Debug> {}
+   |                                      ^^^^^^^^^^
+
+error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+  --> $DIR/where-allowed.rs:230:41
+   |
+LL | type InTypeAliasGenericParamDefault<T = impl Debug> = T;
+   |                                         ^^^^^^^^^^
+
+error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+  --> $DIR/where-allowed.rs:234:11
+   |
+LL | impl <T = impl Debug> T {}
+   |           ^^^^^^^^^^
+
+error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+  --> $DIR/where-allowed.rs:240:40
+   |
+LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
+   |                                        ^^^^^^^^^^
+
+error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
+  --> $DIR/where-allowed.rs:246:29
    |
 LL |     let _in_local_variable: impl Fn() = || {};
    |                             ^^^^^^^^^
@@ -250,44 +286,31 @@ LL |     let _in_local_variable: impl Fn() = || {};
    = help: add `#![feature(impl_trait_in_bindings)]` to the crate attributes to enable
 
 error[E0562]: `impl Trait` not allowed outside of function and inherent method return types
-  --> $DIR/where-allowed.rs:224:46
+  --> $DIR/where-allowed.rs:248:46
    |
 LL |     let _in_return_in_local_variable = || -> impl Fn() { || {} };
    |                                              ^^^^^^^^^
 
-error[E0720]: cannot resolve opaque type
-  --> $DIR/where-allowed.rs:56:49
-   |
-LL | fn in_impl_Fn_parameter_in_return() -> &'static impl Fn(impl Debug) { panic!() }
-   |                                                 ^^^^^^^^^^^^^^^^^^^   -------- this returned value is of `!` type
-   |                                                 |
-   |                                                 cannot resolve opaque type
-   |
-   = help: this error will resolve once the item's body returns a concrete type
-
-error[E0720]: cannot resolve opaque type
-  --> $DIR/where-allowed.rs:62:46
+error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+  --> $DIR/where-allowed.rs:234:7
    |
-LL | fn in_impl_Fn_return_in_return() -> &'static impl Fn() -> impl Debug { panic!() }
-   |                                              ^^^^^^^^^^^^^^^^^^^^^^^   -------- this returned value is of `!` type
-   |                                              |
-   |                                              cannot resolve opaque type
+LL | impl <T = impl Debug> T {}
+   |       ^
    |
-   = help: this error will resolve once the item's body returns a concrete type
+   = note: `#[deny(invalid_type_param_default)]` on by default
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
 
-error: could not find defining uses
-  --> $DIR/where-allowed.rs:121:16
+error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
+  --> $DIR/where-allowed.rs:240:36
    |
-LL |     type Out = impl Debug;
-   |                ^^^^^^^^^^
-
-error: could not find defining uses
-  --> $DIR/where-allowed.rs:157:23
+LL | fn in_method_generic_param_default<T = impl Debug>(_: T) {}
+   |                                    ^
    |
-LL | type InTypeAlias<R> = impl Debug;
-   |                       ^^^^^^^^^^
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
 
-error: aborting due to 44 previous errors
+error: aborting due to 48 previous errors
 
-Some errors have detailed explanations: E0562, E0658, E0666, E0720.
+Some errors have detailed explanations: E0562, E0658, E0666.
 For more information about an error, try `rustc --explain E0562`.
diff --git a/src/test/ui/issues/issue-28568.stderr b/src/test/ui/issues/issue-28568.stderr
index 7729b9d240d..be3f7c62780 100644
--- a/src/test/ui/issues/issue-28568.stderr
+++ b/src/test/ui/issues/issue-28568.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `MyStruct`:
+error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `MyStruct`
   --> $DIR/issue-28568.rs:7:1
    |
 LL | impl Drop for MyStruct {
diff --git a/src/test/ui/issues/issue-41974.stderr b/src/test/ui/issues/issue-41974.stderr
index cde285f73d6..11d77857d60 100644
--- a/src/test/ui/issues/issue-41974.stderr
+++ b/src/test/ui/issues/issue-41974.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `std::boxed::Box<_, _>`:
+error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `std::boxed::Box<_, _>`
   --> $DIR/issue-41974.rs:7:1
    |
 LL | impl<T> Drop for T where T: A {
diff --git a/src/test/ui/issues/issue-43355.stderr b/src/test/ui/issues/issue-43355.stderr
index 75c69e5b3e3..23d8ed1848f 100644
--- a/src/test/ui/issues/issue-43355.stderr
+++ b/src/test/ui/issues/issue-43355.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `Trait1<std::boxed::Box<_>>` for type `A`:
+error[E0119]: conflicting implementations of trait `Trait1<std::boxed::Box<_>>` for type `A`
   --> $DIR/issue-43355.rs:13:1
    |
 LL | impl<X, T> Trait1<X> for T where T: Trait2<X> {
diff --git a/src/test/ui/issues/issue-48728.stderr b/src/test/ui/issues/issue-48728.stderr
index a0698c20798..ca2e234cee6 100644
--- a/src/test/ui/issues/issue-48728.stderr
+++ b/src/test/ui/issues/issue-48728.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `std::clone::Clone` for type `Node<[_]>`:
+error[E0119]: conflicting implementations of trait `std::clone::Clone` for type `Node<[_]>`
   --> $DIR/issue-48728.rs:4:10
    |
 LL | #[derive(Clone)]
diff --git a/src/test/ui/issues/issue-83924.fixed b/src/test/ui/issues/issue-83924.fixed
new file mode 100644
index 00000000000..aa40da12b87
--- /dev/null
+++ b/src/test/ui/issues/issue-83924.fixed
@@ -0,0 +1,20 @@
+// run-rustfix
+
+fn main() {
+    let mut values = vec![10, 11, 12];
+    let v = &mut values;
+
+    let mut max = 0;
+
+    for n in &mut *v {
+        max = std::cmp::max(max, *n);
+    }
+
+    println!("max is {}", max);
+    println!("Converting to percentages of maximum value...");
+    for n in v {
+        //~^ ERROR: use of moved value: `v` [E0382]
+        *n = 100 * (*n) / max;
+    }
+    println!("values: {:#?}", values);
+}
diff --git a/src/test/ui/issues/issue-83924.rs b/src/test/ui/issues/issue-83924.rs
new file mode 100644
index 00000000000..22b80fe2f38
--- /dev/null
+++ b/src/test/ui/issues/issue-83924.rs
@@ -0,0 +1,20 @@
+// run-rustfix
+
+fn main() {
+    let mut values = vec![10, 11, 12];
+    let v = &mut values;
+
+    let mut max = 0;
+
+    for n in v {
+        max = std::cmp::max(max, *n);
+    }
+
+    println!("max is {}", max);
+    println!("Converting to percentages of maximum value...");
+    for n in v {
+        //~^ ERROR: use of moved value: `v` [E0382]
+        *n = 100 * (*n) / max;
+    }
+    println!("values: {:#?}", values);
+}
diff --git a/src/test/ui/issues/issue-83924.stderr b/src/test/ui/issues/issue-83924.stderr
new file mode 100644
index 00000000000..682bc323cb0
--- /dev/null
+++ b/src/test/ui/issues/issue-83924.stderr
@@ -0,0 +1,25 @@
+error[E0382]: use of moved value: `v`
+  --> $DIR/issue-83924.rs:15:14
+   |
+LL |     let v = &mut values;
+   |         - move occurs because `v` has type `&mut Vec<i32>`, which does not implement the `Copy` trait
+...
+LL |     for n in v {
+   |              - `v` moved due to this implicit call to `.into_iter()`
+...
+LL |     for n in v {
+   |              ^ value used here after move
+   |
+note: this function takes ownership of the receiver `self`, which moves `v`
+  --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
+   |
+LL |     fn into_iter(self) -> Self::IntoIter;
+   |                  ^^^^
+help: consider creating a fresh reborrow of `v` here
+   |
+LL |     for n in &mut *v {
+   |              ^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0382`.
diff --git a/src/test/ui/never_type/never-from-impl-is-reserved.stderr b/src/test/ui/never_type/never-from-impl-is-reserved.stderr
index 8b8d0f4ea73..871c5120528 100644
--- a/src/test/ui/never_type/never-from-impl-is-reserved.stderr
+++ b/src/test/ui/never_type/never-from-impl-is-reserved.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `MyTrait` for type `MyFoo`:
+error[E0119]: conflicting implementations of trait `MyTrait` for type `MyFoo`
   --> $DIR/never-from-impl-is-reserved.rs:10:1
    |
 LL | impl MyTrait for MyFoo {}
diff --git a/src/test/ui/proc-macro/auxiliary/issue-83510.rs b/src/test/ui/proc-macro/auxiliary/issue-83510.rs
new file mode 100644
index 00000000000..1d6ef3914a9
--- /dev/null
+++ b/src/test/ui/proc-macro/auxiliary/issue-83510.rs
@@ -0,0 +1,19 @@
+// force-host
+// no-prefer-dynamic
+
+#![crate_type = "proc-macro"]
+
+extern crate proc_macro;
+
+use proc_macro::TokenStream;
+
+#[proc_macro]
+pub fn dance_like_you_want_to_ice(_: TokenStream) -> TokenStream {
+    r#"
+    impl Foo {
+        type Bar = Box<()> + Baz;
+    }
+    "#
+    .parse()
+    .unwrap()
+}
diff --git a/src/test/ui/proc-macro/issue-83510.rs b/src/test/ui/proc-macro/issue-83510.rs
new file mode 100644
index 00000000000..2b1aec4df0b
--- /dev/null
+++ b/src/test/ui/proc-macro/issue-83510.rs
@@ -0,0 +1,11 @@
+// aux-build: issue-83510.rs
+
+extern crate issue_83510;
+
+issue_83510::dance_like_you_want_to_ice!();
+//~^ ERROR: cannot find type `Foo` in this scope
+//~| ERROR: expected trait, found struct `Box`
+//~| ERROR: cannot find trait `Baz` in this scope
+//~| ERROR: inherent associated types are unstable
+
+fn main() {}
diff --git a/src/test/ui/proc-macro/issue-83510.stderr b/src/test/ui/proc-macro/issue-83510.stderr
new file mode 100644
index 00000000000..e0803550906
--- /dev/null
+++ b/src/test/ui/proc-macro/issue-83510.stderr
@@ -0,0 +1,38 @@
+error[E0412]: cannot find type `Foo` in this scope
+  --> $DIR/issue-83510.rs:5:1
+   |
+LL | issue_83510::dance_like_you_want_to_ice!();
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
+   |
+   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0404]: expected trait, found struct `Box`
+  --> $DIR/issue-83510.rs:5:1
+   |
+LL | issue_83510::dance_like_you_want_to_ice!();
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a trait
+   |
+   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0405]: cannot find trait `Baz` in this scope
+  --> $DIR/issue-83510.rs:5:1
+   |
+LL | issue_83510::dance_like_you_want_to_ice!();
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
+   |
+   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0658]: inherent associated types are unstable
+  --> $DIR/issue-83510.rs:5:1
+   |
+LL | issue_83510::dance_like_you_want_to_ice!();
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #8995 <https://github.com/rust-lang/rust/issues/8995> for more information
+   = help: add `#![feature(inherent_associated_types)]` to the crate attributes to enable
+   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: aborting due to 4 previous errors
+
+Some errors have detailed explanations: E0404, E0405, E0412, E0658.
+For more information about an error, try `rustc --explain E0404`.
diff --git a/src/test/ui/rfc-2457/extern_block_nonascii_forbidden.rs b/src/test/ui/rfc-2457/extern_block_nonascii_forbidden.rs
new file mode 100644
index 00000000000..c70ced731d5
--- /dev/null
+++ b/src/test/ui/rfc-2457/extern_block_nonascii_forbidden.rs
@@ -0,0 +1,10 @@
+#![feature(extern_types)]
+#![feature(non_ascii_idents)]
+
+extern "C" {
+    type 一; //~ items in `extern` blocks cannot use non-ascii identifiers
+    fn 二(); //~ items in `extern` blocks cannot use non-ascii identifiers
+    static 三: usize; //~ items in `extern` blocks cannot use non-ascii identifiers
+}
+
+fn main() {}
diff --git a/src/test/ui/rfc-2457/extern_block_nonascii_forbidden.stderr b/src/test/ui/rfc-2457/extern_block_nonascii_forbidden.stderr
new file mode 100644
index 00000000000..3b18c06ec5c
--- /dev/null
+++ b/src/test/ui/rfc-2457/extern_block_nonascii_forbidden.stderr
@@ -0,0 +1,34 @@
+error: items in `extern` blocks cannot use non-ascii identifiers
+  --> $DIR/extern_block_nonascii_forbidden.rs:5:10
+   |
+LL | extern "C" {
+   | ---------- in this `extern` block
+LL |     type 一;
+   |          ^^
+   |
+   = note: This limitation may be lifted in the future; see issue #83942 <https://github.com/rust-lang/rust/issues/83942> for more information
+
+error: items in `extern` blocks cannot use non-ascii identifiers
+  --> $DIR/extern_block_nonascii_forbidden.rs:6:8
+   |
+LL | extern "C" {
+   | ---------- in this `extern` block
+LL |     type 一;
+LL |     fn 二();
+   |        ^^
+   |
+   = note: This limitation may be lifted in the future; see issue #83942 <https://github.com/rust-lang/rust/issues/83942> for more information
+
+error: items in `extern` blocks cannot use non-ascii identifiers
+  --> $DIR/extern_block_nonascii_forbidden.rs:7:12
+   |
+LL | extern "C" {
+   | ---------- in this `extern` block
+...
+LL |     static 三: usize;
+   |            ^^
+   |
+   = note: This limitation may be lifted in the future; see issue #83942 <https://github.com/rust-lang/rust/issues/83942> for more information
+
+error: aborting due to 3 previous errors
+
diff --git a/src/test/ui/rfc-2457/mod_file_nonascii_forbidden.stderr b/src/test/ui/rfc-2457/mod_file_nonascii_forbidden.stderr
index be729836f4f..6e06ab737c2 100644
--- a/src/test/ui/rfc-2457/mod_file_nonascii_forbidden.stderr
+++ b/src/test/ui/rfc-2457/mod_file_nonascii_forbidden.stderr
@@ -6,7 +6,7 @@ LL | mod řųśť;
    |
    = help: to create the module `řųśť`, create file "$DIR/řųśť.rs"
 
-error[E0754]: trying to load file for module `řųśť` with non ascii identifer name
+error[E0754]: trying to load file for module `řųśť` with non-ascii identifier name
   --> $DIR/mod_file_nonascii_forbidden.rs:3:5
    |
 LL | mod řųśť;
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr
index 2b4fa66ecf2..99560ed0688 100644
--- a/src/test/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr
+++ b/src/test/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `std::ops::Add` for type `i32`:
+error[E0119]: conflicting implementations of trait `std::ops::Add` for type `i32`
   --> $DIR/const-and-non-const-impl.rs:6:1
    |
 LL | impl const std::ops::Add for i32 {
@@ -7,7 +7,7 @@ LL | impl const std::ops::Add for i32 {
    = note: conflicting implementation in crate `core`:
            - impl Add for i32;
 
-error[E0119]: conflicting implementations of trait `std::ops::Add` for type `Int`:
+error[E0119]: conflicting implementations of trait `std::ops::Add` for type `Int`
   --> $DIR/const-and-non-const-impl.rs:24:1
    |
 LL | impl std::ops::Add for Int {
diff --git a/src/test/ui/specialization/issue-52050.stderr b/src/test/ui/specialization/issue-52050.stderr
index 27070f8e4a1..ab3cf27d0d0 100644
--- a/src/test/ui/specialization/issue-52050.stderr
+++ b/src/test/ui/specialization/issue-52050.stderr
@@ -8,7 +8,7 @@ LL | #![feature(specialization)]
    = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
    = help: consider using `min_specialization` instead, which is more stable and complete
 
-error[E0119]: conflicting implementations of trait `IntoPyDictPointer` for type `()`:
+error[E0119]: conflicting implementations of trait `IntoPyDictPointer` for type `()`
   --> $DIR/issue-52050.rs:28:1
    |
 LL | / impl<I> IntoPyDictPointer for I
diff --git a/src/test/ui/specialization/specialization-feature-gate-overlap.stderr b/src/test/ui/specialization/specialization-feature-gate-overlap.stderr
index baaf7aa4332..9157ad0d46a 100644
--- a/src/test/ui/specialization/specialization-feature-gate-overlap.stderr
+++ b/src/test/ui/specialization/specialization-feature-gate-overlap.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `Foo` for type `u8`:
+error[E0119]: conflicting implementations of trait `Foo` for type `u8`
   --> $DIR/specialization-feature-gate-overlap.rs:13:1
    |
 LL | impl<T> Foo for T {
diff --git a/src/test/ui/specialization/specialization-overlap.stderr b/src/test/ui/specialization/specialization-overlap.stderr
index 7e5c96ac1c8..3ccbe1616e8 100644
--- a/src/test/ui/specialization/specialization-overlap.stderr
+++ b/src/test/ui/specialization/specialization-overlap.stderr
@@ -8,7 +8,7 @@ LL | #![feature(specialization)]
    = note: see issue #31844 <https://github.com/rust-lang/rust/issues/31844> for more information
    = help: consider using `min_specialization` instead, which is more stable and complete
 
-error[E0119]: conflicting implementations of trait `Foo` for type `std::vec::Vec<_>`:
+error[E0119]: conflicting implementations of trait `Foo` for type `std::vec::Vec<_>`
   --> $DIR/specialization-overlap.rs:5:1
    |
 LL | impl<T: Clone> Foo for T {}
@@ -16,7 +16,7 @@ LL | impl<T: Clone> Foo for T {}
 LL | impl<T> Foo for Vec<T> {}
    | ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `std::vec::Vec<_>`
 
-error[E0119]: conflicting implementations of trait `Bar` for type `(u8, u8)`:
+error[E0119]: conflicting implementations of trait `Bar` for type `(u8, u8)`
   --> $DIR/specialization-overlap.rs:9:1
    |
 LL | impl<T> Bar for (T, u8) {}
@@ -24,7 +24,7 @@ LL | impl<T> Bar for (T, u8) {}
 LL | impl<T> Bar for (u8, T) {}
    | ^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(u8, u8)`
 
-error[E0119]: conflicting implementations of trait `Baz<u8>` for type `u8`:
+error[E0119]: conflicting implementations of trait `Baz<u8>` for type `u8`
   --> $DIR/specialization-overlap.rs:13:1
    |
 LL | impl<T> Baz<T> for u8 {}
@@ -32,7 +32,7 @@ LL | impl<T> Baz<T> for u8 {}
 LL | impl<T> Baz<u8> for T {}
    | ^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `u8`
 
-error[E0119]: conflicting implementations of trait `Qux`:
+error[E0119]: conflicting implementations of trait `Qux`
   --> $DIR/specialization-overlap.rs:17:1
    |
 LL | impl<T: Clone> Qux for T {}
diff --git a/src/test/ui/traits/alias/issue-83613.rs b/src/test/ui/traits/alias/issue-83613.rs
new file mode 100644
index 00000000000..146920ac685
--- /dev/null
+++ b/src/test/ui/traits/alias/issue-83613.rs
@@ -0,0 +1,13 @@
+#![feature(min_type_alias_impl_trait)]
+trait OpaqueTrait {}
+impl<T> OpaqueTrait for T {}
+type OpaqueType = impl OpaqueTrait;
+fn mk_opaque() -> OpaqueType {
+    || 0
+}
+trait AnotherTrait {}
+impl<T: Send> AnotherTrait for T {}
+impl AnotherTrait for OpaqueType {}
+//~^ ERROR conflicting implementations of trait `AnotherTrait` for type `impl OpaqueTrait`
+//~| ERROR cannot implement trait on type alias impl trait
+fn main() {}
diff --git a/src/test/ui/traits/alias/issue-83613.stderr b/src/test/ui/traits/alias/issue-83613.stderr
new file mode 100644
index 00000000000..0ab39ae6672
--- /dev/null
+++ b/src/test/ui/traits/alias/issue-83613.stderr
@@ -0,0 +1,23 @@
+error[E0119]: conflicting implementations of trait `AnotherTrait` for type `impl OpaqueTrait`
+  --> $DIR/issue-83613.rs:10:1
+   |
+LL | impl<T: Send> AnotherTrait for T {}
+   | -------------------------------- first implementation here
+LL | impl AnotherTrait for OpaqueType {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `impl OpaqueTrait`
+
+error: cannot implement trait on type alias impl trait
+  --> $DIR/issue-83613.rs:10:1
+   |
+LL | impl AnotherTrait for OpaqueType {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: type alias impl trait defined here
+  --> $DIR/issue-83613.rs:4:19
+   |
+LL | type OpaqueType = impl OpaqueTrait;
+   |                   ^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0119`.
diff --git a/src/test/ui/traits/issue-33140-hack-boundaries.stderr b/src/test/ui/traits/issue-33140-hack-boundaries.stderr
index ae65701ecb5..c87f1ff1f3f 100644
--- a/src/test/ui/traits/issue-33140-hack-boundaries.stderr
+++ b/src/test/ui/traits/issue-33140-hack-boundaries.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `Trait1` for type `(dyn std::marker::Send + 'static)`:
+error[E0119]: conflicting implementations of trait `Trait1` for type `(dyn std::marker::Send + 'static)`
   --> $DIR/issue-33140-hack-boundaries.rs:18:1
    |
 LL | impl Trait1 for dyn Send {}
@@ -14,7 +14,7 @@ LL | impl Trait2 for dyn Send {}
 LL | impl !Trait2 for dyn Send {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here
 
-error[E0119]: conflicting implementations of trait `Trait3<(dyn std::marker::Sync + 'static)>` for type `(dyn std::marker::Send + 'static)`:
+error[E0119]: conflicting implementations of trait `Trait3<(dyn std::marker::Sync + 'static)>` for type `(dyn std::marker::Send + 'static)`
   --> $DIR/issue-33140-hack-boundaries.rs:32:1
    |
 LL | impl Trait3<dyn Sync> for dyn Send {}
@@ -22,7 +22,7 @@ LL | impl Trait3<dyn Sync> for dyn Send {}
 LL | impl Trait3<dyn Sync> for dyn Send {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)`
 
-error[E0119]: conflicting implementations of trait `Trait4a` for type `(dyn std::marker::Send + 'static)`:
+error[E0119]: conflicting implementations of trait `Trait4a` for type `(dyn std::marker::Send + 'static)`
   --> $DIR/issue-33140-hack-boundaries.rs:39:1
    |
 LL | impl<T: ?Sized> Trait4a for T {}
@@ -30,7 +30,7 @@ LL | impl<T: ?Sized> Trait4a for T {}
 LL | impl Trait4a for dyn Send {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + 'static)`
 
-error[E0119]: conflicting implementations of trait `Trait4b` for type `()`:
+error[E0119]: conflicting implementations of trait `Trait4b` for type `()`
   --> $DIR/issue-33140-hack-boundaries.rs:46:1
    |
 LL | impl Trait4b for () {}
@@ -38,7 +38,7 @@ LL | impl Trait4b for () {}
 LL | impl Trait4b for () {}
    | ^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()`
 
-error[E0119]: conflicting implementations of trait `Trait4c` for type `(dyn Trait1 + std::marker::Send + 'static)`:
+error[E0119]: conflicting implementations of trait `Trait4c` for type `(dyn Trait1 + std::marker::Send + 'static)`
   --> $DIR/issue-33140-hack-boundaries.rs:53:1
    |
 LL | impl Trait4c for dyn Trait1 + Send {}
@@ -46,7 +46,7 @@ LL | impl Trait4c for dyn Trait1 + Send {}
 LL | impl Trait4c for dyn Trait1 + Send {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Trait1 + std::marker::Send + 'static)`
 
-error[E0119]: conflicting implementations of trait `Trait4d` for type `dyn std::marker::Send`:
+error[E0119]: conflicting implementations of trait `Trait4d` for type `dyn std::marker::Send`
   --> $DIR/issue-33140-hack-boundaries.rs:60:1
    |
 LL | impl<'a> Trait4d for dyn Send + 'a {}
@@ -54,7 +54,7 @@ LL | impl<'a> Trait4d for dyn Send + 'a {}
 LL | impl<'a> Trait4d for dyn Send + 'a {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn std::marker::Send`
 
-error[E0119]: conflicting implementations of trait `Trait5` for type `(dyn std::marker::Send + 'static)`:
+error[E0119]: conflicting implementations of trait `Trait5` for type `(dyn std::marker::Send + 'static)`
   --> $DIR/issue-33140-hack-boundaries.rs:67:1
    |
 LL | impl Trait5 for dyn Send {}
diff --git a/src/test/ui/traits/issue-33140.stderr b/src/test/ui/traits/issue-33140.stderr
index 9a900d2fc94..392c56a282d 100644
--- a/src/test/ui/traits/issue-33140.stderr
+++ b/src/test/ui/traits/issue-33140.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`:
+error[E0119]: conflicting implementations of trait `Trait` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`
   --> $DIR/issue-33140.rs:9:1
    |
 LL | impl Trait for dyn Send + Sync {
@@ -7,7 +7,7 @@ LL | impl Trait for dyn Send + Sync {
 LL | impl Trait for dyn Sync + Send {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn std::marker::Send + std::marker::Sync + 'static)`
 
-error[E0119]: conflicting implementations of trait `Trait2` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`:
+error[E0119]: conflicting implementations of trait `Trait2` for type `(dyn std::marker::Send + std::marker::Sync + 'static)`
   --> $DIR/issue-33140.rs:22:1
    |
 LL | impl Trait2 for dyn Send + Sync {
diff --git a/src/test/ui/traits/negative-impls/rely-on-negative-impl-in-coherence.stderr b/src/test/ui/traits/negative-impls/rely-on-negative-impl-in-coherence.stderr
index 7cce45d2c8f..b970ad76208 100644
--- a/src/test/ui/traits/negative-impls/rely-on-negative-impl-in-coherence.stderr
+++ b/src/test/ui/traits/negative-impls/rely-on-negative-impl-in-coherence.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `LocalTrait` for type `std::string::String`:
+error[E0119]: conflicting implementations of trait `LocalTrait` for type `std::string::String`
   --> $DIR/rely-on-negative-impl-in-coherence.rs:19:1
    |
 LL | impl<T: ForeignTrait> LocalTrait for T { }
diff --git a/src/test/ui/traits/overlap-not-permitted-for-builtin-trait.stderr b/src/test/ui/traits/overlap-not-permitted-for-builtin-trait.stderr
index 94a0c287f4a..910c5e29dac 100644
--- a/src/test/ui/traits/overlap-not-permitted-for-builtin-trait.stderr
+++ b/src/test/ui/traits/overlap-not-permitted-for-builtin-trait.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `std::marker::Send` for type `MyStruct`:
+error[E0119]: conflicting implementations of trait `std::marker::Send` for type `MyStruct`
   --> $DIR/overlap-not-permitted-for-builtin-trait.rs:7:1
    |
 LL | impl !Send for MyStruct {}
diff --git a/src/test/ui/traits/reservation-impl/coherence-conflict.stderr b/src/test/ui/traits/reservation-impl/coherence-conflict.stderr
index 1a227a85c06..a811d7e3201 100644
--- a/src/test/ui/traits/reservation-impl/coherence-conflict.stderr
+++ b/src/test/ui/traits/reservation-impl/coherence-conflict.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `OtherTrait` for type `()`:
+error[E0119]: conflicting implementations of trait `OtherTrait` for type `()`
   --> $DIR/coherence-conflict.rs:11:1
    |
 LL | impl OtherTrait for () {}
diff --git a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.full_tait.stderr b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.full_tait.stderr
index 30521b8bf7d..6d1a59aafed 100644
--- a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.full_tait.stderr
+++ b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.full_tait.stderr
@@ -7,7 +7,7 @@ LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
    = note: `#[warn(incomplete_features)]` on by default
    = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
 
-error[E0119]: conflicting implementations of trait `std::ops::FnOnce<()>` for type `&_`:
+error[E0119]: conflicting implementations of trait `std::ops::FnOnce<()>` for type `&_`
   --> $DIR/incoherent-assoc-imp-trait.rs:13:1
    |
 LL | impl<F> FnOnce<()> for &F {
diff --git a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.min_tait.stderr b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.min_tait.stderr
index a0427624ec3..5c02b602d52 100644
--- a/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.min_tait.stderr
+++ b/src/test/ui/type-alias-impl-trait/incoherent-assoc-imp-trait.min_tait.stderr
@@ -1,4 +1,4 @@
-error[E0119]: conflicting implementations of trait `std::ops::FnOnce<()>` for type `&_`:
+error[E0119]: conflicting implementations of trait `std::ops::FnOnce<()>` for type `&_`
   --> $DIR/incoherent-assoc-imp-trait.rs:13:1
    |
 LL | impl<F> FnOnce<()> for &F {
diff --git a/src/test/ui/unused/unused-doc-comments-for-macros.rs b/src/test/ui/unused/unused-doc-comments-for-macros.rs
new file mode 100644
index 00000000000..05828ebb2c3
--- /dev/null
+++ b/src/test/ui/unused/unused-doc-comments-for-macros.rs
@@ -0,0 +1,17 @@
+#![deny(unused_doc_comments)]
+#![feature(rustc_attrs)]
+
+macro_rules! foo { () => {}; }
+
+fn main() {
+    /// line1 //~ ERROR: unused doc comment
+    /// line2
+    /// line3
+    foo!();
+
+    // Ensure we still detect another doc-comment block.
+    /// line1 //~ ERROR: unused doc comment
+    /// line2
+    /// line3
+    foo!();
+}
diff --git a/src/test/ui/unused/unused-doc-comments-for-macros.stderr b/src/test/ui/unused/unused-doc-comments-for-macros.stderr
new file mode 100644
index 00000000000..f4f5bb71e55
--- /dev/null
+++ b/src/test/ui/unused/unused-doc-comments-for-macros.stderr
@@ -0,0 +1,31 @@
+error: unused doc comment
+  --> $DIR/unused-doc-comments-for-macros.rs:7:5
+   |
+LL | /     /// line1
+LL | |     /// line2
+LL | |     /// line3
+   | |_____--------^
+   |       |
+   |       rustdoc does not generate documentation for macro invocations
+   |
+note: the lint level is defined here
+  --> $DIR/unused-doc-comments-for-macros.rs:1:9
+   |
+LL | #![deny(unused_doc_comments)]
+   |         ^^^^^^^^^^^^^^^^^^^
+   = help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion
+
+error: unused doc comment
+  --> $DIR/unused-doc-comments-for-macros.rs:13:5
+   |
+LL | /     /// line1
+LL | |     /// line2
+LL | |     /// line3
+   | |_____--------^
+   |       |
+   |       rustdoc does not generate documentation for macro invocations
+   |
+   = help: to document an item produced by a macro, the macro must produce the documentation as part of its expansion
+
+error: aborting due to 2 previous errors
+
diff --git a/src/test/ui/useless-comment.rs b/src/test/ui/unused/useless-comment.rs
index 7d2e5ab6f2b..7d2e5ab6f2b 100644
--- a/src/test/ui/useless-comment.rs
+++ b/src/test/ui/unused/useless-comment.rs
diff --git a/src/test/ui/useless-comment.stderr b/src/test/ui/unused/useless-comment.stderr
index 5a0af8db7c5..5a0af8db7c5 100644
--- a/src/test/ui/useless-comment.stderr
+++ b/src/test/ui/unused/useless-comment.stderr
diff --git a/src/tools/clippy/clippy_lints/src/loops/never_loop.rs b/src/tools/clippy/clippy_lints/src/loops/never_loop.rs
index f63a3761a0d..01a7627fc7f 100644
--- a/src/tools/clippy/clippy_lints/src/loops/never_loop.rs
+++ b/src/tools/clippy/clippy_lints/src/loops/never_loop.rs
@@ -142,12 +142,12 @@ fn never_loop_expr(expr: &Expr<'_>, main_loop_id: HirId) -> NeverLoopResult {
             .map(|(o, _)| match o {
                 InlineAsmOperand::In { expr, .. }
                 | InlineAsmOperand::InOut { expr, .. }
-                | InlineAsmOperand::Const { expr }
                 | InlineAsmOperand::Sym { expr } => never_loop_expr(expr, main_loop_id),
                 InlineAsmOperand::Out { expr, .. } => never_loop_expr_all(&mut expr.iter(), main_loop_id),
                 InlineAsmOperand::SplitInOut { in_expr, out_expr, .. } => {
                     never_loop_expr_all(&mut once(in_expr).chain(out_expr.iter()), main_loop_id)
                 },
+                InlineAsmOperand::Const { .. } => NeverLoopResult::Otherwise,
             })
             .fold(NeverLoopResult::Otherwise, combine_both),
         ExprKind::Struct(_, _, None)
diff --git a/src/tools/clippy/clippy_lints/src/utils/inspector.rs b/src/tools/clippy/clippy_lints/src/utils/inspector.rs
index 6fd3c9d7dec..b3fe66ed428 100644
--- a/src/tools/clippy/clippy_lints/src/utils/inspector.rs
+++ b/src/tools/clippy/clippy_lints/src/utils/inspector.rs
@@ -306,7 +306,6 @@ fn print_expr(cx: &LateContext<'_>, expr: &hir::Expr<'_>, indent: usize) {
                 match op {
                     hir::InlineAsmOperand::In { expr, .. }
                     | hir::InlineAsmOperand::InOut { expr, .. }
-                    | hir::InlineAsmOperand::Const { expr }
                     | hir::InlineAsmOperand::Sym { expr } => print_expr(cx, expr, indent + 1),
                     hir::InlineAsmOperand::Out { expr, .. } => {
                         if let Some(expr) = expr {
@@ -319,6 +318,10 @@ fn print_expr(cx: &LateContext<'_>, expr: &hir::Expr<'_>, indent: usize) {
                             print_expr(cx, out_expr, indent + 1);
                         }
                     },
+                    hir::InlineAsmOperand::Const { anon_const } => {
+                        println!("{}anon_const:", ind);
+                        print_expr(cx, &cx.tcx.hir().body(anon_const.body).value, indent + 1);
+                    }
                 }
             }
         },
diff --git a/src/tools/clippy/clippy_utils/src/hir_utils.rs b/src/tools/clippy/clippy_utils/src/hir_utils.rs
index 618d33545a4..b30c0b79881 100644
--- a/src/tools/clippy/clippy_utils/src/hir_utils.rs
+++ b/src/tools/clippy/clippy_utils/src/hir_utils.rs
@@ -663,7 +663,8 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
                                 self.hash_expr(out_expr);
                             }
                         },
-                        InlineAsmOperand::Const { expr } | InlineAsmOperand::Sym { expr } => self.hash_expr(expr),
+                        InlineAsmOperand::Const { anon_const } => self.hash_body(anon_const.body),
+                        InlineAsmOperand::Sym { expr } => self.hash_expr(expr),
                     }
                 }
             },