Rollup merge of #140506 - tshepang:patch-1, r=jieyouxu

unstable-book: fix capitalization
diff --git a/bootstrap.example.toml b/bootstrap.example.toml
index b8f863b..1371fd6 100644
--- a/bootstrap.example.toml
+++ b/bootstrap.example.toml
@@ -570,6 +570,12 @@
 # Defaults to rust.debug-assertions value
 #debug-assertions-std = rust.debug-assertions (boolean)
 
+# Whether or not debug assertions are enabled for the tools built by bootstrap.
+# Overrides the `debug-assertions` option, if defined.
+#
+# Defaults to rust.debug-assertions value
+#debug-assertions-tools = rust.debug-assertions (boolean)
+
 # Whether or not to leave debug! and trace! calls in the rust binary.
 #
 # Defaults to rust.debug-assertions value
diff --git a/compiler/rustc_ast/src/mut_visit.rs b/compiler/rustc_ast/src/mut_visit.rs
index bef04dc..e498867 100644
--- a/compiler/rustc_ast/src/mut_visit.rs
+++ b/compiler/rustc_ast/src/mut_visit.rs
@@ -9,7 +9,6 @@
 
 use std::ops::DerefMut;
 use std::panic;
-use std::sync::Arc;
 
 use rustc_data_structures::flat_map_in_place::FlatMapInPlace;
 use rustc_data_structures::stack::ensure_sufficient_stack;
@@ -20,7 +19,6 @@
 
 use crate::ast::*;
 use crate::ptr::P;
-use crate::token::{self, Token};
 use crate::tokenstream::*;
 use crate::visit::{AssocCtxt, BoundKind, FnCtxt};
 
@@ -48,11 +46,6 @@ fn walk(
 }
 
 pub trait MutVisitor: Sized {
-    /// Mutable token visiting only exists for the `macro_rules` token marker and should not be
-    /// used otherwise. Token visitor would be entirely separate from the regular visitor if
-    /// the marker didn't have to visit AST fragments in nonterminal tokens.
-    const VISIT_TOKENS: bool = false;
-
     // Methods in this trait have one of three forms:
     //
     //   fn visit_t(&mut self, t: &mut T);                      // common
@@ -360,6 +353,8 @@ fn visit_id(&mut self, _id: &mut NodeId) {
         // Do nothing.
     }
 
+    // Span visiting is no longer used, but we keep it for now,
+    // in case it's needed for something like #127241.
     fn visit_span(&mut self, _sp: &mut Span) {
         // Do nothing.
     }
@@ -473,12 +468,8 @@ fn visit_attr_args<T: MutVisitor>(vis: &mut T, args: &mut AttrArgs) {
 
 // No `noop_` prefix because there isn't a corresponding method in `MutVisitor`.
 fn visit_delim_args<T: MutVisitor>(vis: &mut T, args: &mut DelimArgs) {
-    let DelimArgs { dspan, delim: _, tokens } = args;
-    visit_tts(vis, tokens);
-    visit_delim_span(vis, dspan);
-}
-
-pub fn visit_delim_span<T: MutVisitor>(vis: &mut T, DelimSpan { open, close }: &mut DelimSpan) {
+    let DelimArgs { dspan, delim: _, tokens: _ } = args;
+    let DelimSpan { open, close } = dspan;
     vis.visit_span(open);
     vis.visit_span(close);
 }
@@ -552,7 +543,7 @@ fn walk_assoc_item_constraint<T: MutVisitor>(
 }
 
 pub fn walk_ty<T: MutVisitor>(vis: &mut T, ty: &mut P<Ty>) {
-    let Ty { id, kind, span, tokens } = ty.deref_mut();
+    let Ty { id, kind, span, tokens: _ } = ty.deref_mut();
     vis.visit_id(id);
     match kind {
         TyKind::Err(_guar) => {}
@@ -600,12 +591,11 @@ pub fn walk_ty<T: MutVisitor>(vis: &mut T, ty: &mut P<Ty>) {
         }
         TyKind::MacCall(mac) => vis.visit_mac_call(mac),
     }
-    visit_lazy_tts(vis, tokens);
     vis.visit_span(span);
 }
 
 pub fn walk_ty_pat<T: MutVisitor>(vis: &mut T, ty: &mut P<TyPat>) {
-    let TyPat { id, kind, span, tokens } = ty.deref_mut();
+    let TyPat { id, kind, span, tokens: _ } = ty.deref_mut();
     vis.visit_id(id);
     match kind {
         TyPatKind::Range(start, end, _include_end) => {
@@ -615,7 +605,6 @@ pub fn walk_ty_pat<T: MutVisitor>(vis: &mut T, ty: &mut P<TyPat>) {
         TyPatKind::Or(variants) => visit_thin_vec(variants, |p| vis.visit_ty_pat(p)),
         TyPatKind::Err(_) => {}
     }
-    visit_lazy_tts(vis, tokens);
     vis.visit_span(span);
 }
 
@@ -655,11 +644,10 @@ fn walk_path_segment<T: MutVisitor>(vis: &mut T, segment: &mut PathSegment) {
     visit_opt(args, |args| vis.visit_generic_args(args));
 }
 
-fn walk_path<T: MutVisitor>(vis: &mut T, Path { segments, span, tokens }: &mut Path) {
+fn walk_path<T: MutVisitor>(vis: &mut T, Path { segments, span, tokens: _ }: &mut Path) {
     for segment in segments {
         vis.visit_path_segment(segment);
     }
-    visit_lazy_tts(vis, tokens);
     vis.visit_span(span);
 }
 
@@ -705,7 +693,7 @@ fn walk_parenthesized_parameter_data<T: MutVisitor>(vis: &mut T, args: &mut Pare
 }
 
 fn walk_local<T: MutVisitor>(vis: &mut T, local: &mut P<Local>) {
-    let Local { id, super_, pat, ty, kind, span, colon_sp, attrs, tokens } = local.deref_mut();
+    let Local { id, super_, pat, ty, kind, span, colon_sp, attrs, tokens: _ } = local.deref_mut();
     visit_opt(super_, |sp| vis.visit_span(sp));
     vis.visit_id(id);
     visit_attrs(vis, attrs);
@@ -721,7 +709,6 @@ fn walk_local<T: MutVisitor>(vis: &mut T, local: &mut P<Local>) {
             vis.visit_block(els);
         }
     }
-    visit_lazy_tts(vis, tokens);
     visit_opt(colon_sp, |sp| vis.visit_span(sp));
     vis.visit_span(span);
 }
@@ -730,14 +717,10 @@ fn walk_attribute<T: MutVisitor>(vis: &mut T, attr: &mut Attribute) {
     let Attribute { kind, id: _, style: _, span } = attr;
     match kind {
         AttrKind::Normal(normal) => {
-            let NormalAttr {
-                item: AttrItem { unsafety: _, path, args, tokens },
-                tokens: attr_tokens,
-            } = &mut **normal;
+            let NormalAttr { item: AttrItem { unsafety: _, path, args, tokens: _ }, tokens: _ } =
+                &mut **normal;
             vis.visit_path(path);
             visit_attr_args(vis, args);
-            visit_lazy_tts(vis, tokens);
-            visit_lazy_tts(vis, attr_tokens);
         }
         AttrKind::DocComment(_kind, _sym) => {}
     }
@@ -787,90 +770,6 @@ pub fn walk_param<T: MutVisitor>(vis: &mut T, param: &mut Param) {
 }
 
 // No `noop_` prefix because there isn't a corresponding method in `MutVisitor`.
-fn visit_attr_tt<T: MutVisitor>(vis: &mut T, tt: &mut AttrTokenTree) {
-    match tt {
-        AttrTokenTree::Token(token, _spacing) => {
-            visit_token(vis, token);
-        }
-        AttrTokenTree::Delimited(dspan, _spacing, _delim, tts) => {
-            visit_attr_tts(vis, tts);
-            visit_delim_span(vis, dspan);
-        }
-        AttrTokenTree::AttrsTarget(AttrsTarget { attrs, tokens }) => {
-            visit_attrs(vis, attrs);
-            visit_lazy_tts_opt_mut(vis, Some(tokens));
-        }
-    }
-}
-
-// No `noop_` prefix because there isn't a corresponding method in `MutVisitor`.
-fn visit_tt<T: MutVisitor>(vis: &mut T, tt: &mut TokenTree) {
-    match tt {
-        TokenTree::Token(token, _spacing) => {
-            visit_token(vis, token);
-        }
-        TokenTree::Delimited(dspan, _spacing, _delim, tts) => {
-            visit_tts(vis, tts);
-            visit_delim_span(vis, dspan);
-        }
-    }
-}
-
-// No `noop_` prefix because there isn't a corresponding method in `MutVisitor`.
-fn visit_tts<T: MutVisitor>(vis: &mut T, TokenStream(tts): &mut TokenStream) {
-    if T::VISIT_TOKENS && !tts.is_empty() {
-        let tts = Arc::make_mut(tts);
-        visit_vec(tts, |tree| visit_tt(vis, tree));
-    }
-}
-
-fn visit_attr_tts<T: MutVisitor>(vis: &mut T, AttrTokenStream(tts): &mut AttrTokenStream) {
-    if T::VISIT_TOKENS && !tts.is_empty() {
-        let tts = Arc::make_mut(tts);
-        visit_vec(tts, |tree| visit_attr_tt(vis, tree));
-    }
-}
-
-fn visit_lazy_tts_opt_mut<T: MutVisitor>(vis: &mut T, lazy_tts: Option<&mut LazyAttrTokenStream>) {
-    if T::VISIT_TOKENS {
-        if let Some(lazy_tts) = lazy_tts {
-            let mut tts = lazy_tts.to_attr_token_stream();
-            visit_attr_tts(vis, &mut tts);
-            *lazy_tts = LazyAttrTokenStream::new_direct(tts);
-        }
-    }
-}
-
-fn visit_lazy_tts<T: MutVisitor>(vis: &mut T, lazy_tts: &mut Option<LazyAttrTokenStream>) {
-    visit_lazy_tts_opt_mut(vis, lazy_tts.as_mut());
-}
-
-/// Applies ident visitor if it's an ident. In practice this is not actually
-/// used by specific visitors right now, but there's a test below checking that
-/// it works.
-// No `noop_` prefix because there isn't a corresponding method in `MutVisitor`.
-pub fn visit_token<T: MutVisitor>(vis: &mut T, t: &mut Token) {
-    let Token { kind, span } = t;
-    match kind {
-        token::Ident(name, _is_raw) | token::Lifetime(name, _is_raw) => {
-            let mut ident = Ident::new(*name, *span);
-            vis.visit_ident(&mut ident);
-            *name = ident.name;
-            *span = ident.span;
-            return; // Avoid visiting the span for the second time.
-        }
-        token::NtIdent(ident, _is_raw) => {
-            vis.visit_ident(ident);
-        }
-        token::NtLifetime(ident, _is_raw) => {
-            vis.visit_ident(ident);
-        }
-        _ => {}
-    }
-    vis.visit_span(span);
-}
-
-// No `noop_` prefix because there isn't a corresponding method in `MutVisitor`.
 fn visit_defaultness<T: MutVisitor>(vis: &mut T, defaultness: &mut Defaultness) {
     match defaultness {
         Defaultness::Default(span) => vis.visit_span(span),
@@ -1188,10 +1087,9 @@ fn walk_mt<T: MutVisitor>(vis: &mut T, MutTy { ty, mutbl: _ }: &mut MutTy) {
 }
 
 pub fn walk_block<T: MutVisitor>(vis: &mut T, block: &mut P<Block>) {
-    let Block { id, stmts, rules: _, span, tokens } = block.deref_mut();
+    let Block { id, stmts, rules: _, span, tokens: _ } = block.deref_mut();
     vis.visit_id(id);
     stmts.flat_map_in_place(|stmt| vis.flat_map_stmt(stmt));
-    visit_lazy_tts(vis, tokens);
     vis.visit_span(span);
 }
 
@@ -1472,12 +1370,11 @@ fn walk_item_ctxt<K: WalkItemKind>(
     item: &mut P<Item<K>>,
     ctxt: K::Ctxt,
 ) {
-    let Item { attrs, id, kind, vis, span, tokens } = item.deref_mut();
+    let Item { attrs, id, kind, vis, span, tokens: _ } = item.deref_mut();
     visitor.visit_id(id);
     visit_attrs(visitor, attrs);
     visitor.visit_vis(vis);
     kind.walk(*span, *id, vis, ctxt, visitor);
-    visit_lazy_tts(visitor, tokens);
     visitor.visit_span(span);
 }
 
@@ -1551,7 +1448,7 @@ fn walk(
 }
 
 pub fn walk_pat<T: MutVisitor>(vis: &mut T, pat: &mut P<Pat>) {
-    let Pat { id, kind, span, tokens } = pat.deref_mut();
+    let Pat { id, kind, span, tokens: _ } = pat.deref_mut();
     vis.visit_id(id);
     match kind {
         PatKind::Err(_guar) => {}
@@ -1593,7 +1490,6 @@ pub fn walk_pat<T: MutVisitor>(vis: &mut T, pat: &mut P<Pat>) {
         PatKind::Paren(inner) => vis.visit_pat(inner),
         PatKind::MacCall(mac) => vis.visit_mac_call(mac),
     }
-    visit_lazy_tts(vis, tokens);
     vis.visit_span(span);
 }
 
@@ -1657,7 +1553,7 @@ fn walk_format_args<T: MutVisitor>(vis: &mut T, fmt: &mut FormatArgs) {
     vis.visit_span(span);
 }
 
-pub fn walk_expr<T: MutVisitor>(vis: &mut T, Expr { kind, id, span, attrs, tokens }: &mut Expr) {
+pub fn walk_expr<T: MutVisitor>(vis: &mut T, Expr { kind, id, span, attrs, tokens: _ }: &mut Expr) {
     vis.visit_id(id);
     visit_attrs(vis, attrs);
     match kind {
@@ -1848,7 +1744,6 @@ pub fn walk_expr<T: MutVisitor>(vis: &mut T, Expr { kind, id, span, attrs, token
         ExprKind::Err(_guar) => {}
         ExprKind::Dummy => {}
     }
-    visit_lazy_tts(vis, tokens);
     vis.visit_span(span);
 }
 
@@ -1890,17 +1785,16 @@ pub fn walk_flat_map_stmt<T: MutVisitor>(
         StmtKind::Semi(expr) => vis.filter_map_expr(expr).into_iter().map(StmtKind::Semi).collect(),
         StmtKind::Empty => smallvec![StmtKind::Empty],
         StmtKind::MacCall(mut mac) => {
-            let MacCallStmt { mac: mac_, style: _, attrs, tokens } = mac.deref_mut();
+            let MacCallStmt { mac: mac_, style: _, attrs, tokens: _ } = mac.deref_mut();
             visit_attrs(vis, attrs);
             vis.visit_mac_call(mac_);
-            visit_lazy_tts(vis, tokens);
             smallvec![StmtKind::MacCall(mac)]
         }
     }
 }
 
 fn walk_vis<T: MutVisitor>(vis: &mut T, visibility: &mut Visibility) {
-    let Visibility { kind, span, tokens } = visibility;
+    let Visibility { kind, span, tokens: _ } = visibility;
     match kind {
         VisibilityKind::Public | VisibilityKind::Inherited => {}
         VisibilityKind::Restricted { path, id, shorthand: _ } => {
@@ -1908,7 +1802,6 @@ fn walk_vis<T: MutVisitor>(vis: &mut T, visibility: &mut Visibility) {
             vis.visit_path(path);
         }
     }
-    visit_lazy_tts(vis, tokens);
     vis.visit_span(span);
 }
 
diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs
index 80c315c..b5925fa 100644
--- a/compiler/rustc_ast_pretty/src/pprust/state.rs
+++ b/compiler/rustc_ast_pretty/src/pprust/state.rs
@@ -634,6 +634,7 @@ fn print_attr_item(&mut self, item: &ast::AttrItem, span: Span) {
                 false,
                 None,
                 *delim,
+                None,
                 tokens,
                 true,
                 span,
@@ -679,6 +680,7 @@ fn print_tt(&mut self, tt: &TokenTree, convert_dollar_crate: bool) -> Spacing {
                     false,
                     None,
                     *delim,
+                    Some(spacing.open),
                     tts,
                     convert_dollar_crate,
                     dspan.entire(),
@@ -735,6 +737,7 @@ fn print_mac_common(
         has_bang: bool,
         ident: Option<Ident>,
         delim: Delimiter,
+        open_spacing: Option<Spacing>,
         tts: &TokenStream,
         convert_dollar_crate: bool,
         span: Span,
@@ -758,16 +761,26 @@ fn print_mac_common(
                     self.nbsp();
                 }
                 self.word("{");
-                if !tts.is_empty() {
+
+                // Respect `Alone`, if provided, and print a space. Unless the list is empty.
+                let open_space = (open_spacing == None || open_spacing == Some(Spacing::Alone))
+                    && !tts.is_empty();
+                if open_space {
                     self.space();
                 }
                 let ib = self.ibox(0);
                 self.print_tts(tts, convert_dollar_crate);
                 self.end(ib);
-                let empty = tts.is_empty();
-                self.bclose(span, empty, cb.unwrap());
+
+                // Use `open_space` for the spacing *before* the closing delim.
+                // Because spacing on delimiters is lost when going through
+                // proc macros, and otherwise we can end up with ugly cases
+                // like `{ x}`. Symmetry is better.
+                self.bclose(span, !open_space, cb.unwrap());
             }
             delim => {
+                // `open_spacing` is ignored. We never print spaces after
+                // non-brace opening delims or before non-brace closing delims.
                 let token_str = self.token_kind_to_string(&delim.as_open_token_kind());
                 self.word(token_str);
                 let ib = self.ibox(0);
@@ -797,6 +810,7 @@ fn print_mac_def(
             has_bang,
             Some(*ident),
             macro_def.body.delim,
+            None,
             &macro_def.body.tokens,
             true,
             sp,
@@ -844,9 +858,9 @@ fn bopen(&mut self, ib: BoxMarker) {
         self.end(ib);
     }
 
-    fn bclose_maybe_open(&mut self, span: rustc_span::Span, empty: bool, cb: Option<BoxMarker>) {
+    fn bclose_maybe_open(&mut self, span: rustc_span::Span, no_space: bool, cb: Option<BoxMarker>) {
         let has_comment = self.maybe_print_comment(span.hi());
-        if !empty || has_comment {
+        if !no_space || has_comment {
             self.break_offset_if_not_bol(1, -INDENT_UNIT);
         }
         self.word("}");
@@ -855,9 +869,9 @@ fn bclose_maybe_open(&mut self, span: rustc_span::Span, empty: bool, cb: Option<
         }
     }
 
-    fn bclose(&mut self, span: rustc_span::Span, empty: bool, cb: BoxMarker) {
+    fn bclose(&mut self, span: rustc_span::Span, no_space: bool, cb: BoxMarker) {
         let cb = Some(cb);
-        self.bclose_maybe_open(span, empty, cb)
+        self.bclose_maybe_open(span, no_space, cb)
     }
 
     fn break_offset_if_not_bol(&mut self, n: usize, off: isize) {
@@ -1434,8 +1448,8 @@ fn print_block_maybe_unclosed(
             }
         }
 
-        let empty = !has_attrs && blk.stmts.is_empty();
-        self.bclose_maybe_open(blk.span, empty, cb);
+        let no_space = !has_attrs && blk.stmts.is_empty();
+        self.bclose_maybe_open(blk.span, no_space, cb);
         self.ann.post(self, AnnNode::Block(blk))
     }
 
@@ -1482,6 +1496,7 @@ fn print_mac(&mut self, m: &ast::MacCall) {
             true,
             None,
             m.args.delim,
+            None,
             &m.args.tokens,
             true,
             m.span(),
diff --git a/compiler/rustc_builtin_macros/src/autodiff.rs b/compiler/rustc_builtin_macros/src/autodiff.rs
index 6d97dfa..8c5c20c 100644
--- a/compiler/rustc_builtin_macros/src/autodiff.rs
+++ b/compiler/rustc_builtin_macros/src/autodiff.rs
@@ -323,9 +323,9 @@ pub(crate) fn expand(
             Spacing::Joint,
         )];
         let never_arg = ast::DelimArgs {
-            dspan: ast::tokenstream::DelimSpan::from_single(span),
+            dspan: DelimSpan::from_single(span),
             delim: ast::token::Delimiter::Parenthesis,
-            tokens: ast::tokenstream::TokenStream::from_iter(ts2),
+            tokens: TokenStream::from_iter(ts2),
         };
         let inline_item = ast::AttrItem {
             unsafety: ast::Safety::Default,
diff --git a/compiler/rustc_codegen_cranelift/src/base.rs b/compiler/rustc_codegen_cranelift/src/base.rs
index e9c7186..524e0d9 100644
--- a/compiler/rustc_codegen_cranelift/src/base.rs
+++ b/compiler/rustc_codegen_cranelift/src/base.rs
@@ -8,8 +8,6 @@
 use rustc_codegen_ssa::base::is_call_from_compiler_builtins_to_upstream_monomorphization;
 use rustc_data_structures::profiling::SelfProfilerRef;
 use rustc_index::IndexVec;
-use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
-use rustc_middle::mir::InlineAsmMacro;
 use rustc_middle::ty::TypeVisitableExt;
 use rustc_middle::ty::adjustment::PointerCoercion;
 use rustc_middle::ty::layout::{FnAbiOf, HasTypingEnv};
@@ -18,7 +16,6 @@
 use crate::constant::ConstantCx;
 use crate::debuginfo::{FunctionDebugContext, TypeDebugContext};
 use crate::enable_verifier;
-use crate::inline_asm::codegen_naked_asm;
 use crate::prelude::*;
 use crate::pretty_clif::CommentWriter;
 
@@ -37,7 +34,7 @@ pub(crate) fn codegen_fn<'tcx>(
     cached_func: Function,
     module: &mut dyn Module,
     instance: Instance<'tcx>,
-) -> Option<CodegenedFunction> {
+) -> CodegenedFunction {
     debug_assert!(!instance.args.has_infer());
 
     let symbol_name = tcx.symbol_name(instance).name.to_string();
@@ -54,38 +51,6 @@ pub(crate) fn codegen_fn<'tcx>(
         String::from_utf8_lossy(&buf).into_owned()
     });
 
-    if tcx.codegen_fn_attrs(instance.def_id()).flags.contains(CodegenFnAttrFlags::NAKED) {
-        assert_eq!(mir.basic_blocks.len(), 1);
-        assert!(mir.basic_blocks[START_BLOCK].statements.is_empty());
-
-        match &mir.basic_blocks[START_BLOCK].terminator().kind {
-            TerminatorKind::InlineAsm {
-                asm_macro: InlineAsmMacro::NakedAsm,
-                template,
-                operands,
-                options,
-                line_spans: _,
-                targets: _,
-                unwind: _,
-            } => {
-                codegen_naked_asm(
-                    tcx,
-                    cx,
-                    module,
-                    instance,
-                    mir.basic_blocks[START_BLOCK].terminator().source_info.span,
-                    &symbol_name,
-                    template,
-                    operands,
-                    *options,
-                );
-            }
-            _ => unreachable!(),
-        }
-
-        return None;
-    }
-
     // Declare function
     let sig = get_function_sig(tcx, module.target_config().default_call_conv, instance);
     let func_id = module.declare_function(&symbol_name, Linkage::Local, &sig).unwrap();
@@ -166,7 +131,7 @@ pub(crate) fn codegen_fn<'tcx>(
     // Verify function
     verify_func(tcx, &clif_comments, &func);
 
-    Some(CodegenedFunction { symbol_name, func_id, func, clif_comments, func_debug_cx })
+    CodegenedFunction { symbol_name, func_id, func, clif_comments, func_debug_cx }
 }
 
 pub(crate) fn compile_fn(
diff --git a/compiler/rustc_codegen_cranelift/src/driver/aot.rs b/compiler/rustc_codegen_cranelift/src/driver/aot.rs
index 00136ac..5d07c94 100644
--- a/compiler/rustc_codegen_cranelift/src/driver/aot.rs
+++ b/compiler/rustc_codegen_cranelift/src/driver/aot.rs
@@ -22,7 +22,10 @@
 use rustc_metadata::EncodedMetadata;
 use rustc_metadata::fs::copy_to_stdout;
 use rustc_middle::dep_graph::{WorkProduct, WorkProductId};
-use rustc_middle::mir::mono::{CodegenUnit, MonoItem};
+use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
+use rustc_middle::mir::mono::{
+    CodegenUnit, Linkage as RLinkage, MonoItem, MonoItemData, Visibility,
+};
 use rustc_session::Session;
 use rustc_session::config::{DebugInfo, OutFileName, OutputFilenames, OutputType};
 
@@ -30,7 +33,7 @@
 use crate::base::CodegenedFunction;
 use crate::concurrency_limiter::{ConcurrencyLimiter, ConcurrencyLimiterToken};
 use crate::debuginfo::TypeDebugContext;
-use crate::global_asm::GlobalAsmConfig;
+use crate::global_asm::{GlobalAsmConfig, GlobalAsmContext};
 use crate::prelude::*;
 use crate::unwind_module::UnwindModule;
 
@@ -530,19 +533,35 @@ fn codegen_cgu_content(
     let mut type_dbg = TypeDebugContext::default();
     super::predefine_mono_items(tcx, module, &mono_items);
     let mut codegened_functions = vec![];
-    for (mono_item, _) in mono_items {
+    for (mono_item, item_data) in mono_items {
         match mono_item {
-            MonoItem::Fn(inst) => {
-                if let Some(codegened_function) = crate::base::codegen_fn(
+            MonoItem::Fn(instance) => {
+                if tcx.codegen_fn_attrs(instance.def_id()).flags.contains(CodegenFnAttrFlags::NAKED)
+                {
+                    rustc_codegen_ssa::mir::naked_asm::codegen_naked_asm(
+                        &mut GlobalAsmContext { tcx, global_asm: &mut cx.global_asm },
+                        instance,
+                        MonoItemData {
+                            linkage: RLinkage::External,
+                            visibility: if item_data.linkage == RLinkage::Internal {
+                                Visibility::Hidden
+                            } else {
+                                item_data.visibility
+                            },
+                            ..item_data
+                        },
+                    );
+                    continue;
+                }
+                let codegened_function = crate::base::codegen_fn(
                     tcx,
                     &mut cx,
                     &mut type_dbg,
                     Function::new(),
                     module,
-                    inst,
-                ) {
-                    codegened_functions.push(codegened_function);
-                }
+                    instance,
+                );
+                codegened_functions.push(codegened_function);
             }
             MonoItem::Static(def_id) => {
                 let data_id = crate::constant::codegen_static(tcx, module, def_id);
@@ -551,7 +570,10 @@ fn codegen_cgu_content(
                 }
             }
             MonoItem::GlobalAsm(item_id) => {
-                crate::global_asm::codegen_global_asm_item(tcx, &mut cx.global_asm, item_id);
+                rustc_codegen_ssa::base::codegen_global_asm(
+                    &mut GlobalAsmContext { tcx, global_asm: &mut cx.global_asm },
+                    item_id,
+                );
             }
         }
     }
diff --git a/compiler/rustc_codegen_cranelift/src/driver/jit.rs b/compiler/rustc_codegen_cranelift/src/driver/jit.rs
index 41f8bb9..e368cf4 100644
--- a/compiler/rustc_codegen_cranelift/src/driver/jit.rs
+++ b/compiler/rustc_codegen_cranelift/src/driver/jit.rs
@@ -126,6 +126,11 @@ pub(crate) fn codegen_and_compile_fn<'tcx>(
     module: &mut dyn Module,
     instance: Instance<'tcx>,
 ) {
+    if tcx.codegen_fn_attrs(instance.def_id()).flags.contains(CodegenFnAttrFlags::NAKED) {
+        tcx.dcx()
+            .span_fatal(tcx.def_span(instance.def_id()), "Naked asm is not supported in JIT mode");
+    }
+
     cranelift_codegen::timing::set_thread_profiler(Box::new(super::MeasuremeProfiler(
         tcx.prof.clone(),
     )));
@@ -135,16 +140,15 @@ pub(crate) fn codegen_and_compile_fn<'tcx>(
             crate::PrintOnPanic(|| format!("{:?} {}", instance, tcx.symbol_name(instance).name));
 
         let cached_func = std::mem::replace(&mut cached_context.func, Function::new());
-        if let Some(codegened_func) = crate::base::codegen_fn(
+        let codegened_func = crate::base::codegen_fn(
             tcx,
             cx,
             &mut TypeDebugContext::default(),
             cached_func,
             module,
             instance,
-        ) {
-            crate::base::compile_fn(cx, &tcx.prof, cached_context, module, codegened_func);
-        }
+        );
+        crate::base::compile_fn(cx, &tcx.prof, cached_context, module, codegened_func);
     });
 }
 
diff --git a/compiler/rustc_codegen_cranelift/src/global_asm.rs b/compiler/rustc_codegen_cranelift/src/global_asm.rs
index 79cefb0..203b443 100644
--- a/compiler/rustc_codegen_cranelift/src/global_asm.rs
+++ b/compiler/rustc_codegen_cranelift/src/global_asm.rs
@@ -7,102 +7,139 @@
 use std::sync::Arc;
 
 use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
-use rustc_hir::{InlineAsmOperand, ItemId};
-use rustc_middle::mir::interpret::ErrorHandled;
+use rustc_codegen_ssa::traits::{AsmCodegenMethods, GlobalAsmOperandRef};
+use rustc_middle::ty::TyCtxt;
+use rustc_middle::ty::layout::{
+    FnAbiError, FnAbiOfHelpers, FnAbiRequest, HasTyCtxt, HasTypingEnv, LayoutError, LayoutOfHelpers,
+};
 use rustc_session::config::{OutputFilenames, OutputType};
 use rustc_target::asm::InlineAsmArch;
 
 use crate::prelude::*;
 
-pub(crate) fn codegen_global_asm_item(tcx: TyCtxt<'_>, global_asm: &mut String, item_id: ItemId) {
-    let item = tcx.hir_item(item_id);
-    if let rustc_hir::ItemKind::GlobalAsm { asm, .. } = item.kind {
-        let is_x86 =
-            matches!(tcx.sess.asm_arch.unwrap(), InlineAsmArch::X86 | InlineAsmArch::X86_64);
+pub(crate) struct GlobalAsmContext<'a, 'tcx> {
+    pub tcx: TyCtxt<'tcx>,
+    pub global_asm: &'a mut String,
+}
 
-        if is_x86 {
-            if !asm.options.contains(InlineAsmOptions::ATT_SYNTAX) {
-                global_asm.push_str("\n.intel_syntax noprefix\n");
-            } else {
-                global_asm.push_str("\n.att_syntax\n");
-            }
+impl<'tcx> AsmCodegenMethods<'tcx> for GlobalAsmContext<'_, 'tcx> {
+    fn codegen_global_asm(
+        &mut self,
+        template: &[InlineAsmTemplatePiece],
+        operands: &[GlobalAsmOperandRef<'tcx>],
+        options: InlineAsmOptions,
+        _line_spans: &[Span],
+    ) {
+        codegen_global_asm_inner(self.tcx, self.global_asm, template, operands, options);
+    }
+
+    fn mangled_name(&self, instance: Instance<'tcx>) -> String {
+        let symbol_name = self.tcx.symbol_name(instance).name.to_owned();
+        if self.tcx.sess.target.is_like_darwin { format!("_{symbol_name}") } else { symbol_name }
+    }
+}
+
+impl<'tcx> LayoutOfHelpers<'tcx> for GlobalAsmContext<'_, 'tcx> {
+    #[inline]
+    fn handle_layout_err(&self, err: LayoutError<'tcx>, span: Span, ty: Ty<'tcx>) -> ! {
+        if let LayoutError::SizeOverflow(_) | LayoutError::ReferencesError(_) = err {
+            self.tcx.sess.dcx().span_fatal(span, err.to_string())
+        } else {
+            self.tcx
+                .sess
+                .dcx()
+                .span_fatal(span, format!("failed to get layout for `{}`: {}", ty, err))
         }
-        for piece in asm.template {
-            match *piece {
-                InlineAsmTemplatePiece::String(ref s) => global_asm.push_str(s),
-                InlineAsmTemplatePiece::Placeholder { operand_idx, modifier: _, span: op_sp } => {
-                    match asm.operands[operand_idx].0 {
-                        InlineAsmOperand::Const { ref anon_const } => {
-                            match tcx.const_eval_poly(anon_const.def_id.to_def_id()) {
-                                Ok(const_value) => {
-                                    let ty = tcx
-                                        .typeck_body(anon_const.body)
-                                        .node_type(anon_const.hir_id);
-                                    let string = rustc_codegen_ssa::common::asm_const_to_str(
-                                        tcx,
-                                        op_sp,
-                                        const_value,
-                                        FullyMonomorphizedLayoutCx(tcx).layout_of(ty),
-                                    );
-                                    global_asm.push_str(&string);
-                                }
-                                Err(ErrorHandled::Reported { .. }) => {
-                                    // An error has already been reported and compilation is
-                                    // guaranteed to fail if execution hits this path.
-                                }
-                                Err(ErrorHandled::TooGeneric(_)) => {
-                                    span_bug!(op_sp, "asm const cannot be resolved; too generic");
-                                }
-                            }
-                        }
-                        InlineAsmOperand::SymFn { expr } => {
-                            if cfg!(not(feature = "inline_asm_sym")) {
-                                tcx.dcx().span_err(
-                                    item.span,
-                                    "asm! and global_asm! sym operands are not yet supported",
-                                );
-                            }
+    }
+}
 
-                            let ty = tcx.typeck(item_id.owner_id).expr_ty(expr);
-                            let instance = match ty.kind() {
-                                &ty::FnDef(def_id, args) => Instance::new(def_id, args),
-                                _ => span_bug!(op_sp, "asm sym is not a function"),
-                            };
-                            let symbol = tcx.symbol_name(instance);
-                            // FIXME handle the case where the function was made private to the
-                            // current codegen unit
-                            global_asm.push_str(symbol.name);
-                        }
-                        InlineAsmOperand::SymStatic { path: _, def_id } => {
-                            if cfg!(not(feature = "inline_asm_sym")) {
-                                tcx.dcx().span_err(
-                                    item.span,
-                                    "asm! and global_asm! sym operands are not yet supported",
-                                );
-                            }
+impl<'tcx> FnAbiOfHelpers<'tcx> for GlobalAsmContext<'_, 'tcx> {
+    #[inline]
+    fn handle_fn_abi_err(
+        &self,
+        err: FnAbiError<'tcx>,
+        span: Span,
+        fn_abi_request: FnAbiRequest<'tcx>,
+    ) -> ! {
+        FullyMonomorphizedLayoutCx(self.tcx).handle_fn_abi_err(err, span, fn_abi_request)
+    }
+}
 
-                            let instance = Instance::mono(tcx, def_id);
-                            let symbol = tcx.symbol_name(instance);
-                            global_asm.push_str(symbol.name);
+impl<'tcx> HasTyCtxt<'tcx> for GlobalAsmContext<'_, 'tcx> {
+    fn tcx<'b>(&'b self) -> TyCtxt<'tcx> {
+        self.tcx
+    }
+}
+
+impl<'tcx> rustc_abi::HasDataLayout for GlobalAsmContext<'_, 'tcx> {
+    fn data_layout(&self) -> &rustc_abi::TargetDataLayout {
+        &self.tcx.data_layout
+    }
+}
+
+impl<'tcx> HasTypingEnv<'tcx> for GlobalAsmContext<'_, 'tcx> {
+    fn typing_env(&self) -> ty::TypingEnv<'tcx> {
+        ty::TypingEnv::fully_monomorphized()
+    }
+}
+
+fn codegen_global_asm_inner<'tcx>(
+    tcx: TyCtxt<'tcx>,
+    global_asm: &mut String,
+    template: &[InlineAsmTemplatePiece],
+    operands: &[GlobalAsmOperandRef<'tcx>],
+    options: InlineAsmOptions,
+) {
+    let is_x86 = matches!(tcx.sess.asm_arch.unwrap(), InlineAsmArch::X86 | InlineAsmArch::X86_64);
+
+    if is_x86 {
+        if !options.contains(InlineAsmOptions::ATT_SYNTAX) {
+            global_asm.push_str("\n.intel_syntax noprefix\n");
+        } else {
+            global_asm.push_str("\n.att_syntax\n");
+        }
+    }
+    for piece in template {
+        match *piece {
+            InlineAsmTemplatePiece::String(ref s) => global_asm.push_str(s),
+            InlineAsmTemplatePiece::Placeholder { operand_idx, modifier: _, span } => {
+                match operands[operand_idx] {
+                    GlobalAsmOperandRef::Const { ref string } => {
+                        global_asm.push_str(string);
+                    }
+                    GlobalAsmOperandRef::SymFn { instance } => {
+                        if cfg!(not(feature = "inline_asm_sym")) {
+                            tcx.dcx().span_err(
+                                span,
+                                "asm! and global_asm! sym operands are not yet supported",
+                            );
                         }
-                        InlineAsmOperand::In { .. }
-                        | InlineAsmOperand::Out { .. }
-                        | InlineAsmOperand::InOut { .. }
-                        | InlineAsmOperand::SplitInOut { .. }
-                        | InlineAsmOperand::Label { .. } => {
-                            span_bug!(op_sp, "invalid operand type for global_asm!")
+
+                        let symbol = tcx.symbol_name(instance);
+                        // FIXME handle the case where the function was made private to the
+                        // current codegen unit
+                        global_asm.push_str(symbol.name);
+                    }
+                    GlobalAsmOperandRef::SymStatic { def_id } => {
+                        if cfg!(not(feature = "inline_asm_sym")) {
+                            tcx.dcx().span_err(
+                                span,
+                                "asm! and global_asm! sym operands are not yet supported",
+                            );
                         }
+
+                        let instance = Instance::mono(tcx, def_id);
+                        let symbol = tcx.symbol_name(instance);
+                        global_asm.push_str(symbol.name);
                     }
                 }
             }
         }
+    }
 
-        global_asm.push('\n');
-        if is_x86 {
-            global_asm.push_str(".att_syntax\n\n");
-        }
-    } else {
-        bug!("Expected GlobalAsm found {:?}", item);
+    global_asm.push('\n');
+    if is_x86 {
+        global_asm.push_str(".att_syntax\n\n");
     }
 }
 
diff --git a/compiler/rustc_codegen_cranelift/src/inline_asm.rs b/compiler/rustc_codegen_cranelift/src/inline_asm.rs
index fbc33a6..afee509 100644
--- a/compiler/rustc_codegen_cranelift/src/inline_asm.rs
+++ b/compiler/rustc_codegen_cranelift/src/inline_asm.rs
@@ -161,7 +161,6 @@ pub(crate) fn codegen_inline_asm_inner<'tcx>(
         stack_slots_input: Vec::new(),
         stack_slots_output: Vec::new(),
         stack_slot_size: Size::from_bytes(0),
-        is_naked: false,
     };
     asm_gen.allocate_registers();
     asm_gen.allocate_stack_slots();
@@ -201,114 +200,6 @@ pub(crate) fn codegen_inline_asm_inner<'tcx>(
     call_inline_asm(fx, &asm_name, asm_gen.stack_slot_size, inputs, outputs);
 }
 
-pub(crate) fn codegen_naked_asm<'tcx>(
-    tcx: TyCtxt<'tcx>,
-    cx: &mut crate::CodegenCx,
-    module: &mut dyn Module,
-    instance: Instance<'tcx>,
-    span: Span,
-    symbol_name: &str,
-    template: &[InlineAsmTemplatePiece],
-    operands: &[InlineAsmOperand<'tcx>],
-    options: InlineAsmOptions,
-) {
-    // FIXME add .eh_frame unwind info directives
-
-    let operands = operands
-        .iter()
-        .map(|operand| match *operand {
-            InlineAsmOperand::In { .. }
-            | InlineAsmOperand::Out { .. }
-            | InlineAsmOperand::InOut { .. } => {
-                span_bug!(span, "invalid operand type for naked asm")
-            }
-            InlineAsmOperand::Const { ref value } => {
-                let cv = instance.instantiate_mir_and_normalize_erasing_regions(
-                    tcx,
-                    ty::TypingEnv::fully_monomorphized(),
-                    ty::EarlyBinder::bind(value.const_),
-                );
-                let const_value = cv
-                    .eval(tcx, ty::TypingEnv::fully_monomorphized(), value.span)
-                    .expect("erroneous constant missed by mono item collection");
-
-                let value = rustc_codegen_ssa::common::asm_const_to_str(
-                    tcx,
-                    span,
-                    const_value,
-                    FullyMonomorphizedLayoutCx(tcx).layout_of(cv.ty()),
-                );
-                CInlineAsmOperand::Const { value }
-            }
-            InlineAsmOperand::SymFn { ref value } => {
-                if cfg!(not(feature = "inline_asm_sym")) {
-                    tcx.dcx()
-                        .span_err(span, "asm! and global_asm! sym operands are not yet supported");
-                }
-
-                let const_ = instance.instantiate_mir_and_normalize_erasing_regions(
-                    tcx,
-                    ty::TypingEnv::fully_monomorphized(),
-                    ty::EarlyBinder::bind(value.const_),
-                );
-                if let ty::FnDef(def_id, args) = *const_.ty().kind() {
-                    let instance = ty::Instance::resolve_for_fn_ptr(
-                        tcx,
-                        ty::TypingEnv::fully_monomorphized(),
-                        def_id,
-                        args,
-                    )
-                    .unwrap();
-                    let symbol = tcx.symbol_name(instance);
-
-                    // Pass a wrapper rather than the function itself as the function itself may not
-                    // be exported from the main codegen unit and may thus be unreachable from the
-                    // object file created by an external assembler.
-                    let wrapper_name = format!(
-                        "__inline_asm_{}_wrapper_n{}",
-                        cx.cgu_name.as_str().replace('.', "__").replace('-', "_"),
-                        cx.inline_asm_index
-                    );
-                    cx.inline_asm_index += 1;
-                    let sig =
-                        get_function_sig(tcx, module.target_config().default_call_conv, instance);
-                    create_wrapper_function(module, sig, &wrapper_name, symbol.name);
-
-                    CInlineAsmOperand::Symbol { symbol: wrapper_name }
-                } else {
-                    span_bug!(span, "invalid type for asm sym (fn)");
-                }
-            }
-            InlineAsmOperand::SymStatic { def_id } => {
-                assert!(tcx.is_static(def_id));
-                let instance = Instance::mono(tcx, def_id);
-                CInlineAsmOperand::Symbol { symbol: tcx.symbol_name(instance).name.to_owned() }
-            }
-            InlineAsmOperand::Label { .. } => {
-                span_bug!(span, "asm! label operands are not yet supported");
-            }
-        })
-        .collect::<Vec<_>>();
-
-    let asm_gen = InlineAssemblyGenerator {
-        tcx,
-        arch: tcx.sess.asm_arch.unwrap(),
-        enclosing_def_id: instance.def_id(),
-        template,
-        operands: &operands,
-        options,
-        registers: Vec::new(),
-        stack_slots_clobber: Vec::new(),
-        stack_slots_input: Vec::new(),
-        stack_slots_output: Vec::new(),
-        stack_slot_size: Size::from_bytes(0),
-        is_naked: true,
-    };
-
-    let generated_asm = asm_gen.generate_asm_wrapper(symbol_name);
-    cx.global_asm.push_str(&generated_asm);
-}
-
 struct InlineAssemblyGenerator<'a, 'tcx> {
     tcx: TyCtxt<'tcx>,
     arch: InlineAsmArch,
@@ -321,13 +212,10 @@ struct InlineAssemblyGenerator<'a, 'tcx> {
     stack_slots_input: Vec<Option<Size>>,
     stack_slots_output: Vec<Option<Size>>,
     stack_slot_size: Size,
-    is_naked: bool,
 }
 
 impl<'tcx> InlineAssemblyGenerator<'_, 'tcx> {
     fn allocate_registers(&mut self) {
-        assert!(!self.is_naked);
-
         let sess = self.tcx.sess;
         let map = allocatable_registers(
             self.arch,
@@ -451,8 +339,6 @@ fn allocate_registers(&mut self) {
     }
 
     fn allocate_stack_slots(&mut self) {
-        assert!(!self.is_naked);
-
         let mut slot_size = Size::from_bytes(0);
         let mut slots_clobber = vec![None; self.operands.len()];
         let mut slots_input = vec![None; self.operands.len()];
@@ -582,32 +468,31 @@ fn generate_asm_wrapper(&self, asm_name: &str) -> String {
         if is_x86 {
             generated_asm.push_str(".intel_syntax noprefix\n");
         }
-        if !self.is_naked {
-            Self::prologue(&mut generated_asm, self.arch);
 
-            // Save clobbered registers
-            if !self.options.contains(InlineAsmOptions::NORETURN) {
-                for (reg, slot) in self
-                    .registers
-                    .iter()
-                    .zip(self.stack_slots_clobber.iter().copied())
-                    .filter_map(|(r, s)| r.zip(s))
-                {
-                    Self::save_register(&mut generated_asm, self.arch, reg, slot);
-                }
-            }
+        Self::prologue(&mut generated_asm, self.arch);
 
-            // Write input registers
+        // Save clobbered registers
+        if !self.options.contains(InlineAsmOptions::NORETURN) {
             for (reg, slot) in self
                 .registers
                 .iter()
-                .zip(self.stack_slots_input.iter().copied())
+                .zip(self.stack_slots_clobber.iter().copied())
                 .filter_map(|(r, s)| r.zip(s))
             {
-                Self::restore_register(&mut generated_asm, self.arch, reg, slot);
+                Self::save_register(&mut generated_asm, self.arch, reg, slot);
             }
         }
 
+        // Write input registers
+        for (reg, slot) in self
+            .registers
+            .iter()
+            .zip(self.stack_slots_input.iter().copied())
+            .filter_map(|(r, s)| r.zip(s))
+        {
+            Self::restore_register(&mut generated_asm, self.arch, reg, slot);
+        }
+
         if is_x86 && self.options.contains(InlineAsmOptions::ATT_SYNTAX) {
             generated_asm.push_str(".att_syntax\n");
         }
@@ -701,32 +586,30 @@ fn generate_asm_wrapper(&self, asm_name: &str) -> String {
             generated_asm.push_str(".intel_syntax noprefix\n");
         }
 
-        if !self.is_naked {
-            if !self.options.contains(InlineAsmOptions::NORETURN) {
-                // Read output registers
-                for (reg, slot) in self
-                    .registers
-                    .iter()
-                    .zip(self.stack_slots_output.iter().copied())
-                    .filter_map(|(r, s)| r.zip(s))
-                {
-                    Self::save_register(&mut generated_asm, self.arch, reg, slot);
-                }
-
-                // Restore clobbered registers
-                for (reg, slot) in self
-                    .registers
-                    .iter()
-                    .zip(self.stack_slots_clobber.iter().copied())
-                    .filter_map(|(r, s)| r.zip(s))
-                {
-                    Self::restore_register(&mut generated_asm, self.arch, reg, slot);
-                }
-
-                Self::epilogue(&mut generated_asm, self.arch);
-            } else {
-                Self::epilogue_noreturn(&mut generated_asm, self.arch);
+        if !self.options.contains(InlineAsmOptions::NORETURN) {
+            // Read output registers
+            for (reg, slot) in self
+                .registers
+                .iter()
+                .zip(self.stack_slots_output.iter().copied())
+                .filter_map(|(r, s)| r.zip(s))
+            {
+                Self::save_register(&mut generated_asm, self.arch, reg, slot);
             }
+
+            // Restore clobbered registers
+            for (reg, slot) in self
+                .registers
+                .iter()
+                .zip(self.stack_slots_clobber.iter().copied())
+                .filter_map(|(r, s)| r.zip(s))
+            {
+                Self::restore_register(&mut generated_asm, self.arch, reg, slot);
+            }
+
+            Self::epilogue(&mut generated_asm, self.arch);
+        } else {
+            Self::epilogue_noreturn(&mut generated_asm, self.arch);
         }
 
         if is_x86 {
diff --git a/compiler/rustc_codegen_gcc/src/asm.rs b/compiler/rustc_codegen_gcc/src/asm.rs
index 396c6d5..c35337a 100644
--- a/compiler/rustc_codegen_gcc/src/asm.rs
+++ b/compiler/rustc_codegen_gcc/src/asm.rs
@@ -829,7 +829,7 @@ fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegCl
 
 impl<'gcc, 'tcx> AsmCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
     fn codegen_global_asm(
-        &self,
+        &mut self,
         template: &[InlineAsmTemplatePiece],
         operands: &[GlobalAsmOperandRef<'tcx>],
         options: InlineAsmOptions,
diff --git a/compiler/rustc_codegen_gcc/src/base.rs b/compiler/rustc_codegen_gcc/src/base.rs
index 9b49517..a9d7808 100644
--- a/compiler/rustc_codegen_gcc/src/base.rs
+++ b/compiler/rustc_codegen_gcc/src/base.rs
@@ -206,7 +206,7 @@ fn module_codegen(
             let f128_type_supported = target_info.supports_target_dependent_type(CType::Float128);
             let u128_type_supported = target_info.supports_target_dependent_type(CType::UInt128t);
             // TODO: improve this to avoid passing that many arguments.
-            let cx = CodegenCx::new(
+            let mut cx = CodegenCx::new(
                 &context,
                 cgu,
                 tcx,
@@ -223,8 +223,8 @@ fn module_codegen(
             }
 
             // ... and now that we have everything pre-defined, fill out those definitions.
-            for &(mono_item, _) in &mono_items {
-                mono_item.define::<Builder<'_, '_, '_>>(&cx);
+            for &(mono_item, item_data) in &mono_items {
+                mono_item.define::<Builder<'_, '_, '_>>(&mut cx, item_data);
             }
 
             // If this codegen unit contains the main function, also create the
diff --git a/compiler/rustc_codegen_gcc/src/builder.rs b/compiler/rustc_codegen_gcc/src/builder.rs
index 5c70f4a..6720f61 100644
--- a/compiler/rustc_codegen_gcc/src/builder.rs
+++ b/compiler/rustc_codegen_gcc/src/builder.rs
@@ -45,7 +45,7 @@ enum ExtremumOperation {
     Min,
 }
 
-pub struct Builder<'a: 'gcc, 'gcc, 'tcx> {
+pub struct Builder<'a, 'gcc, 'tcx> {
     pub cx: &'a CodegenCx<'gcc, 'tcx>,
     pub block: Block<'gcc>,
     pub location: Option<Location<'gcc>>,
diff --git a/compiler/rustc_codegen_llvm/src/asm.rs b/compiler/rustc_codegen_llvm/src/asm.rs
index 88daa02..e481b99 100644
--- a/compiler/rustc_codegen_llvm/src/asm.rs
+++ b/compiler/rustc_codegen_llvm/src/asm.rs
@@ -376,7 +376,7 @@ fn codegen_inline_asm(
 
 impl<'tcx> AsmCodegenMethods<'tcx> for CodegenCx<'_, 'tcx> {
     fn codegen_global_asm(
-        &self,
+        &mut self,
         template: &[InlineAsmTemplatePiece],
         operands: &[GlobalAsmOperandRef<'tcx>],
         options: InlineAsmOptions,
diff --git a/compiler/rustc_codegen_llvm/src/base.rs b/compiler/rustc_codegen_llvm/src/base.rs
index 6bd2791..e4fac35 100644
--- a/compiler/rustc_codegen_llvm/src/base.rs
+++ b/compiler/rustc_codegen_llvm/src/base.rs
@@ -83,15 +83,15 @@ fn module_codegen(tcx: TyCtxt<'_>, cgu_name: Symbol) -> ModuleCodegen<ModuleLlvm
         // Instantiate monomorphizations without filling out definitions yet...
         let llvm_module = ModuleLlvm::new(tcx, cgu_name.as_str());
         {
-            let cx = CodegenCx::new(tcx, cgu, &llvm_module);
+            let mut cx = CodegenCx::new(tcx, cgu, &llvm_module);
             let mono_items = cx.codegen_unit.items_in_deterministic_order(cx.tcx);
             for &(mono_item, data) in &mono_items {
                 mono_item.predefine::<Builder<'_, '_, '_>>(&cx, data.linkage, data.visibility);
             }
 
             // ... and now that we have everything pre-defined, fill out those definitions.
-            for &(mono_item, _) in &mono_items {
-                mono_item.define::<Builder<'_, '_, '_>>(&cx);
+            for &(mono_item, item_data) in &mono_items {
+                mono_item.define::<Builder<'_, '_, '_>>(&mut cx, item_data);
             }
 
             // If this codegen unit contains the main function, also create the
diff --git a/compiler/rustc_codegen_ssa/src/base.rs b/compiler/rustc_codegen_ssa/src/base.rs
index 12b7a48..f5480da 100644
--- a/compiler/rustc_codegen_ssa/src/base.rs
+++ b/compiler/rustc_codegen_ssa/src/base.rs
@@ -12,19 +12,21 @@
 use rustc_data_structures::profiling::{get_resident_set_size, print_time_passes_entry};
 use rustc_data_structures::sync::{IntoDynSyncSend, par_map};
 use rustc_data_structures::unord::UnordMap;
+use rustc_hir::ItemId;
 use rustc_hir::def_id::{DefId, LOCAL_CRATE};
 use rustc_hir::lang_items::LangItem;
 use rustc_metadata::EncodedMetadata;
-use rustc_middle::bug;
 use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs;
 use rustc_middle::middle::debugger_visualizer::{DebuggerVisualizerFile, DebuggerVisualizerType};
 use rustc_middle::middle::exported_symbols::SymbolExportKind;
 use rustc_middle::middle::{exported_symbols, lang_items};
 use rustc_middle::mir::BinOp;
+use rustc_middle::mir::interpret::ErrorHandled;
 use rustc_middle::mir::mono::{CodegenUnit, CodegenUnitNameBuilder, MonoItem, MonoItemPartitions};
 use rustc_middle::query::Providers;
 use rustc_middle::ty::layout::{HasTyCtxt, HasTypingEnv, LayoutOf, TyAndLayout};
 use rustc_middle::ty::{self, Instance, Ty, TyCtxt};
+use rustc_middle::{bug, span_bug};
 use rustc_session::Session;
 use rustc_session::config::{self, CrateType, EntryFnType, OutputType};
 use rustc_span::{DUMMY_SP, Symbol, sym};
@@ -417,6 +419,69 @@ pub(crate) fn codegen_instance<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
     mir::codegen_mir::<Bx>(cx, instance);
 }
 
+pub fn codegen_global_asm<'tcx, Cx>(cx: &mut Cx, item_id: ItemId)
+where
+    Cx: LayoutOf<'tcx, LayoutOfResult = TyAndLayout<'tcx>> + AsmCodegenMethods<'tcx>,
+{
+    let item = cx.tcx().hir_item(item_id);
+    if let rustc_hir::ItemKind::GlobalAsm { asm, .. } = item.kind {
+        let operands: Vec<_> = asm
+            .operands
+            .iter()
+            .map(|(op, op_sp)| match *op {
+                rustc_hir::InlineAsmOperand::Const { ref anon_const } => {
+                    match cx.tcx().const_eval_poly(anon_const.def_id.to_def_id()) {
+                        Ok(const_value) => {
+                            let ty =
+                                cx.tcx().typeck_body(anon_const.body).node_type(anon_const.hir_id);
+                            let string = common::asm_const_to_str(
+                                cx.tcx(),
+                                *op_sp,
+                                const_value,
+                                cx.layout_of(ty),
+                            );
+                            GlobalAsmOperandRef::Const { string }
+                        }
+                        Err(ErrorHandled::Reported { .. }) => {
+                            // An error has already been reported and
+                            // compilation is guaranteed to fail if execution
+                            // hits this path. So an empty string instead of
+                            // a stringified constant value will suffice.
+                            GlobalAsmOperandRef::Const { string: String::new() }
+                        }
+                        Err(ErrorHandled::TooGeneric(_)) => {
+                            span_bug!(*op_sp, "asm const cannot be resolved; too generic")
+                        }
+                    }
+                }
+                rustc_hir::InlineAsmOperand::SymFn { expr } => {
+                    let ty = cx.tcx().typeck(item_id.owner_id).expr_ty(expr);
+                    let instance = match ty.kind() {
+                        &ty::FnDef(def_id, args) => Instance::new(def_id, args),
+                        _ => span_bug!(*op_sp, "asm sym is not a function"),
+                    };
+
+                    GlobalAsmOperandRef::SymFn { instance }
+                }
+                rustc_hir::InlineAsmOperand::SymStatic { path: _, def_id } => {
+                    GlobalAsmOperandRef::SymStatic { def_id }
+                }
+                rustc_hir::InlineAsmOperand::In { .. }
+                | rustc_hir::InlineAsmOperand::Out { .. }
+                | rustc_hir::InlineAsmOperand::InOut { .. }
+                | rustc_hir::InlineAsmOperand::SplitInOut { .. }
+                | rustc_hir::InlineAsmOperand::Label { .. } => {
+                    span_bug!(*op_sp, "invalid operand type for global_asm!")
+                }
+            })
+            .collect();
+
+        cx.codegen_global_asm(asm.template, &operands, asm.options, asm.line_spans);
+    } else {
+        span_bug!(item.span, "Mismatch between hir::Item type and MonoItem type")
+    }
+}
+
 /// Creates the `main` function which will initialize the rust runtime and call
 /// users main function.
 pub fn maybe_create_entry_wrapper<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
diff --git a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
index b0c53ec..5d09e62 100644
--- a/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
+++ b/compiler/rustc_codegen_ssa/src/codegen_attrs.rs
@@ -87,6 +87,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
     let mut link_ordinal_span = None;
     let mut no_sanitize_span = None;
     let mut mixed_export_name_no_mangle_lint_state = MixedExportNameAndNoMangleState::default();
+    let mut no_mangle_span = None;
 
     for attr in attrs.iter() {
         // In some cases, attribute are only valid on functions, but it's the `check_attr`
@@ -139,6 +140,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
             }
             sym::naked => codegen_fn_attrs.flags |= CodegenFnAttrFlags::NAKED,
             sym::no_mangle => {
+                no_mangle_span = Some(attr.span());
                 if tcx.opt_item_name(did.to_def_id()).is_some() {
                     codegen_fn_attrs.flags |= CodegenFnAttrFlags::NO_MANGLE;
                     mixed_export_name_no_mangle_lint_state.track_no_mangle(
@@ -621,6 +623,34 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
     }
     check_link_name_xor_ordinal(tcx, &codegen_fn_attrs, link_ordinal_span);
 
+    if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL)
+        && codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::NO_MANGLE)
+    {
+        let lang_item =
+            lang_items::extract(attrs).map_or(None, |(name, _span)| LangItem::from_name(name));
+        let mut err = tcx
+            .dcx()
+            .struct_span_err(
+                no_mangle_span.unwrap_or_default(),
+                "`#[no_mangle]` cannot be used on internal language items",
+            )
+            .with_note("Rustc requires this item to have a specific mangled name.")
+            .with_span_label(tcx.def_span(did), "should be the internal language item");
+        if let Some(lang_item) = lang_item {
+            if let Some(link_name) = lang_item.link_name() {
+                err = err
+                    .with_note("If you are trying to prevent mangling to ease debugging, many")
+                    .with_note(format!(
+                        "debuggers support a command such as `rbreak {link_name}` to"
+                    ))
+                    .with_note(format!(
+                        "match `.*{link_name}.*` instead of `break {link_name}` on a specific name"
+                    ))
+            }
+        }
+        err.emit();
+    }
+
     // Any linkage to LLVM intrinsics for now forcibly marks them all as never
     // unwinds since LLVM sometimes can't handle codegen which `invoke`s
     // intrinsic functions.
diff --git a/compiler/rustc_codegen_ssa/src/mir/mod.rs b/compiler/rustc_codegen_ssa/src/mir/mod.rs
index 6a37889..96a0447 100644
--- a/compiler/rustc_codegen_ssa/src/mir/mod.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/mod.rs
@@ -20,7 +20,7 @@
 pub mod debuginfo;
 mod intrinsic;
 mod locals;
-mod naked_asm;
+pub mod naked_asm;
 pub mod operand;
 pub mod place;
 mod rvalue;
@@ -178,11 +178,6 @@ pub fn codegen_mir<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
     let fn_abi = cx.fn_abi_of_instance(instance, ty::List::empty());
     debug!("fn_abi: {:?}", fn_abi);
 
-    if tcx.codegen_fn_attrs(instance.def_id()).flags.contains(CodegenFnAttrFlags::NAKED) {
-        crate::mir::naked_asm::codegen_naked_asm::<Bx>(cx, &mir, instance);
-        return;
-    }
-
     if tcx.features().ergonomic_clones() {
         let monomorphized_mir = instance.instantiate_mir_and_normalize_erasing_regions(
             tcx,
diff --git a/compiler/rustc_codegen_ssa/src/mir/naked_asm.rs b/compiler/rustc_codegen_ssa/src/mir/naked_asm.rs
index 3a6b1f8..0301ef4 100644
--- a/compiler/rustc_codegen_ssa/src/mir/naked_asm.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/naked_asm.rs
@@ -1,23 +1,33 @@
 use rustc_abi::{BackendRepr, Float, Integer, Primitive, RegKind};
 use rustc_attr_parsing::InstructionSetAttr;
 use rustc_hir::def_id::DefId;
-use rustc_middle::mir::mono::{Linkage, MonoItem, MonoItemData, Visibility};
-use rustc_middle::mir::{Body, InlineAsmOperand};
-use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, HasTypingEnv, LayoutOf};
-use rustc_middle::ty::{Instance, Ty, TyCtxt};
+use rustc_middle::mir::mono::{Linkage, MonoItemData, Visibility};
+use rustc_middle::mir::{InlineAsmOperand, START_BLOCK};
+use rustc_middle::ty::layout::{FnAbiOf, LayoutOf, TyAndLayout};
+use rustc_middle::ty::{Instance, Ty, TyCtxt, TypeVisitableExt};
 use rustc_middle::{bug, span_bug, ty};
 use rustc_span::sym;
 use rustc_target::callconv::{ArgAbi, FnAbi, PassMode};
 use rustc_target::spec::{BinaryFormat, WasmCAbi};
 
 use crate::common;
-use crate::traits::{AsmCodegenMethods, BuilderMethods, GlobalAsmOperandRef, MiscCodegenMethods};
+use crate::mir::AsmCodegenMethods;
+use crate::traits::GlobalAsmOperandRef;
 
-pub(crate) fn codegen_naked_asm<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
-    cx: &'a Bx::CodegenCx,
-    mir: &Body<'tcx>,
+pub fn codegen_naked_asm<
+    'a,
+    'tcx,
+    Cx: LayoutOf<'tcx, LayoutOfResult = TyAndLayout<'tcx>>
+        + FnAbiOf<'tcx, FnAbiOfResult = &'tcx FnAbi<'tcx, Ty<'tcx>>>
+        + AsmCodegenMethods<'tcx>,
+>(
+    cx: &'a mut Cx,
     instance: Instance<'tcx>,
+    item_data: MonoItemData,
 ) {
+    assert!(!instance.args.has_infer());
+    let mir = cx.tcx().instance_mir(instance.def);
+
     let rustc_middle::mir::TerminatorKind::InlineAsm {
         asm_macro: _,
         template,
@@ -26,15 +36,14 @@ pub(crate) fn codegen_naked_asm<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
         line_spans,
         targets: _,
         unwind: _,
-    } = mir.basic_blocks.iter().next().unwrap().terminator().kind
+    } = mir.basic_blocks[START_BLOCK].terminator().kind
     else {
         bug!("#[naked] functions should always terminate with an asm! block")
     };
 
     let operands: Vec<_> =
-        operands.iter().map(|op| inline_to_global_operand::<Bx>(cx, instance, op)).collect();
+        operands.iter().map(|op| inline_to_global_operand::<Cx>(cx, instance, op)).collect();
 
-    let item_data = cx.codegen_unit().items().get(&MonoItem::Fn(instance)).unwrap();
     let name = cx.mangled_name(instance);
     let fn_abi = cx.fn_abi_of_instance(instance, ty::List::empty());
     let (begin, end) = prefix_and_suffix(cx.tcx(), instance, &name, item_data, fn_abi);
@@ -47,8 +56,8 @@ pub(crate) fn codegen_naked_asm<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
     cx.codegen_global_asm(&template_vec, &operands, options, line_spans);
 }
 
-fn inline_to_global_operand<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
-    cx: &'a Bx::CodegenCx,
+fn inline_to_global_operand<'a, 'tcx, Cx: LayoutOf<'tcx, LayoutOfResult = TyAndLayout<'tcx>>>(
+    cx: &'a Cx,
     instance: Instance<'tcx>,
     op: &InlineAsmOperand<'tcx>,
 ) -> GlobalAsmOperandRef<'tcx> {
@@ -108,7 +117,7 @@ fn prefix_and_suffix<'tcx>(
     tcx: TyCtxt<'tcx>,
     instance: Instance<'tcx>,
     asm_name: &str,
-    item_data: &MonoItemData,
+    item_data: MonoItemData,
     fn_abi: &FnAbi<'tcx, Ty<'tcx>>,
 ) -> (String, String) {
     use std::fmt::Write;
@@ -210,8 +219,10 @@ fn prefix_and_suffix<'tcx>(
             writeln!(begin, ".pushsection {section},\"ax\", {progbits}").unwrap();
             writeln!(begin, ".balign {align_bytes}").unwrap();
             write_linkage(&mut begin).unwrap();
-            if let Visibility::Hidden = item_data.visibility {
-                writeln!(begin, ".hidden {asm_name}").unwrap();
+            match item_data.visibility {
+                Visibility::Default => {}
+                Visibility::Protected => writeln!(begin, ".protected {asm_name}").unwrap(),
+                Visibility::Hidden => writeln!(begin, ".hidden {asm_name}").unwrap(),
             }
             writeln!(begin, ".type {asm_name}, {function}").unwrap();
             if !arch_prefix.is_empty() {
@@ -231,8 +242,9 @@ fn prefix_and_suffix<'tcx>(
             writeln!(begin, ".pushsection {},regular,pure_instructions", section).unwrap();
             writeln!(begin, ".balign {align_bytes}").unwrap();
             write_linkage(&mut begin).unwrap();
-            if let Visibility::Hidden = item_data.visibility {
-                writeln!(begin, ".private_extern {asm_name}").unwrap();
+            match item_data.visibility {
+                Visibility::Default | Visibility::Protected => {}
+                Visibility::Hidden => writeln!(begin, ".private_extern {asm_name}").unwrap(),
             }
             writeln!(begin, "{asm_name}:").unwrap();
 
diff --git a/compiler/rustc_codegen_ssa/src/mono_item.rs b/compiler/rustc_codegen_ssa/src/mono_item.rs
index f6af889..c2067e5 100644
--- a/compiler/rustc_codegen_ssa/src/mono_item.rs
+++ b/compiler/rustc_codegen_ssa/src/mono_item.rs
@@ -1,17 +1,18 @@
-use rustc_hir as hir;
 use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
-use rustc_middle::mir::interpret::ErrorHandled;
-use rustc_middle::mir::mono::{Linkage, MonoItem, Visibility};
-use rustc_middle::ty::Instance;
-use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf};
-use rustc_middle::{span_bug, ty};
+use rustc_middle::mir::mono::{Linkage, MonoItem, MonoItemData, Visibility};
+use rustc_middle::ty::layout::HasTyCtxt;
 use tracing::debug;
 
+use crate::base;
+use crate::mir::naked_asm;
 use crate::traits::*;
-use crate::{base, common};
 
 pub trait MonoItemExt<'a, 'tcx> {
-    fn define<Bx: BuilderMethods<'a, 'tcx>>(&self, cx: &'a Bx::CodegenCx);
+    fn define<Bx: BuilderMethods<'a, 'tcx>>(
+        &self,
+        cx: &'a mut Bx::CodegenCx,
+        item_data: MonoItemData,
+    );
     fn predefine<Bx: BuilderMethods<'a, 'tcx>>(
         &self,
         cx: &'a Bx::CodegenCx,
@@ -22,7 +23,11 @@ fn predefine<Bx: BuilderMethods<'a, 'tcx>>(
 }
 
 impl<'a, 'tcx: 'a> MonoItemExt<'a, 'tcx> for MonoItem<'tcx> {
-    fn define<Bx: BuilderMethods<'a, 'tcx>>(&self, cx: &'a Bx::CodegenCx) {
+    fn define<Bx: BuilderMethods<'a, 'tcx>>(
+        &self,
+        cx: &'a mut Bx::CodegenCx,
+        item_data: MonoItemData,
+    ) {
         debug!(
             "BEGIN IMPLEMENTING '{} ({})' in cgu {}",
             self,
@@ -35,71 +40,19 @@ fn define<Bx: BuilderMethods<'a, 'tcx>>(&self, cx: &'a Bx::CodegenCx) {
                 cx.codegen_static(def_id);
             }
             MonoItem::GlobalAsm(item_id) => {
-                let item = cx.tcx().hir_item(item_id);
-                if let hir::ItemKind::GlobalAsm { asm, .. } = item.kind {
-                    let operands: Vec<_> = asm
-                        .operands
-                        .iter()
-                        .map(|(op, op_sp)| match *op {
-                            hir::InlineAsmOperand::Const { ref anon_const } => {
-                                match cx.tcx().const_eval_poly(anon_const.def_id.to_def_id()) {
-                                    Ok(const_value) => {
-                                        let ty = cx
-                                            .tcx()
-                                            .typeck_body(anon_const.body)
-                                            .node_type(anon_const.hir_id);
-                                        let string = common::asm_const_to_str(
-                                            cx.tcx(),
-                                            *op_sp,
-                                            const_value,
-                                            cx.layout_of(ty),
-                                        );
-                                        GlobalAsmOperandRef::Const { string }
-                                    }
-                                    Err(ErrorHandled::Reported { .. }) => {
-                                        // An error has already been reported and
-                                        // compilation is guaranteed to fail if execution
-                                        // hits this path. So an empty string instead of
-                                        // a stringified constant value will suffice.
-                                        GlobalAsmOperandRef::Const { string: String::new() }
-                                    }
-                                    Err(ErrorHandled::TooGeneric(_)) => {
-                                        span_bug!(
-                                            *op_sp,
-                                            "asm const cannot be resolved; too generic"
-                                        )
-                                    }
-                                }
-                            }
-                            hir::InlineAsmOperand::SymFn { expr } => {
-                                let ty = cx.tcx().typeck(item_id.owner_id).expr_ty(expr);
-                                let instance = match ty.kind() {
-                                    &ty::FnDef(def_id, args) => Instance::new(def_id, args),
-                                    _ => span_bug!(*op_sp, "asm sym is not a function"),
-                                };
-
-                                GlobalAsmOperandRef::SymFn { instance }
-                            }
-                            hir::InlineAsmOperand::SymStatic { path: _, def_id } => {
-                                GlobalAsmOperandRef::SymStatic { def_id }
-                            }
-                            hir::InlineAsmOperand::In { .. }
-                            | hir::InlineAsmOperand::Out { .. }
-                            | hir::InlineAsmOperand::InOut { .. }
-                            | hir::InlineAsmOperand::SplitInOut { .. }
-                            | hir::InlineAsmOperand::Label { .. } => {
-                                span_bug!(*op_sp, "invalid operand type for global_asm!")
-                            }
-                        })
-                        .collect();
-
-                    cx.codegen_global_asm(asm.template, &operands, asm.options, asm.line_spans);
-                } else {
-                    span_bug!(item.span, "Mismatch between hir::Item type and MonoItem type")
-                }
+                base::codegen_global_asm(cx, item_id);
             }
             MonoItem::Fn(instance) => {
-                base::codegen_instance::<Bx>(cx, instance);
+                if cx
+                    .tcx()
+                    .codegen_fn_attrs(instance.def_id())
+                    .flags
+                    .contains(CodegenFnAttrFlags::NAKED)
+                {
+                    naked_asm::codegen_naked_asm::<Bx::CodegenCx>(cx, instance, item_data);
+                } else {
+                    base::codegen_instance::<Bx>(cx, instance);
+                }
             }
         }
 
diff --git a/compiler/rustc_codegen_ssa/src/traits/asm.rs b/compiler/rustc_codegen_ssa/src/traits/asm.rs
index 7767bff..cc7a6a3 100644
--- a/compiler/rustc_codegen_ssa/src/traits/asm.rs
+++ b/compiler/rustc_codegen_ssa/src/traits/asm.rs
@@ -62,7 +62,7 @@ fn codegen_inline_asm(
 
 pub trait AsmCodegenMethods<'tcx> {
     fn codegen_global_asm(
-        &self,
+        &mut self,
         template: &[InlineAsmTemplatePiece],
         operands: &[GlobalAsmOperandRef<'tcx>],
         options: InlineAsmOptions,
diff --git a/compiler/rustc_const_eval/src/interpret/intrinsics.rs b/compiler/rustc_const_eval/src/interpret/intrinsics.rs
index 97d066f..d67b547 100644
--- a/compiler/rustc_const_eval/src/interpret/intrinsics.rs
+++ b/compiler/rustc_const_eval/src/interpret/intrinsics.rs
@@ -183,8 +183,7 @@ pub fn eval_intrinsic(
 
                 let res = self.binary_op(op, &a, &b)?;
                 // `binary_op` already called `generate_nan` if needed.
-
-                // FIXME: Miri should add some non-determinism to the result here to catch any dependences on exact computations. This has previously been done, but the behaviour was removed as part of constification.
+                let res = M::apply_float_nondet(self, res)?;
                 self.write_immediate(*res, dest)?;
             }
 
diff --git a/compiler/rustc_const_eval/src/interpret/machine.rs b/compiler/rustc_const_eval/src/interpret/machine.rs
index e5026ef..a1386b4 100644
--- a/compiler/rustc_const_eval/src/interpret/machine.rs
+++ b/compiler/rustc_const_eval/src/interpret/machine.rs
@@ -276,6 +276,14 @@ fn generate_nan<F1: Float + FloatConvert<F2>, F2: Float>(
         F2::NAN
     }
 
+    /// Apply non-determinism to float operations that do not return a precise result.
+    fn apply_float_nondet(
+        _ecx: &mut InterpCx<'tcx, Self>,
+        val: ImmTy<'tcx, Self::Provenance>,
+    ) -> InterpResult<'tcx, ImmTy<'tcx, Self::Provenance>> {
+        interp_ok(val)
+    }
+
     /// Determines the result of `min`/`max` on floats when the arguments are equal.
     fn equal_float_min_max<F: Float>(_ecx: &InterpCx<'tcx, Self>, a: F, _b: F) -> F {
         // By default, we pick the left argument.
diff --git a/compiler/rustc_expand/src/build.rs b/compiler/rustc_expand/src/build.rs
index 6d616cf..14b8cc9 100644
--- a/compiler/rustc_expand/src/build.rs
+++ b/compiler/rustc_expand/src/build.rs
@@ -1,8 +1,10 @@
 use rustc_ast::ptr::P;
+use rustc_ast::token::Delimiter;
+use rustc_ast::tokenstream::TokenStream;
 use rustc_ast::util::literal;
 use rustc_ast::{
     self as ast, AnonConst, AttrVec, BlockCheckMode, Expr, LocalKind, MatchKind, PatKind, UnOp,
-    attr, token,
+    attr, token, tokenstream,
 };
 use rustc_span::source_map::Spanned;
 use rustc_span::{DUMMY_SP, Ident, Span, Symbol, kw, sym};
@@ -55,13 +57,13 @@ pub fn macro_call(
         &self,
         span: Span,
         path: ast::Path,
-        delim: ast::token::Delimiter,
-        tokens: ast::tokenstream::TokenStream,
+        delim: Delimiter,
+        tokens: TokenStream,
     ) -> P<ast::MacCall> {
         P(ast::MacCall {
             path,
             args: P(ast::DelimArgs {
-                dspan: ast::tokenstream::DelimSpan { open: span, close: span },
+                dspan: tokenstream::DelimSpan { open: span, close: span },
                 delim,
                 tokens,
             }),
@@ -480,8 +482,8 @@ pub fn expr_unreachable(&self, span: Span) -> P<ast::Expr> {
                     span,
                     [sym::std, sym::unreachable].map(|s| Ident::new(s, span)).to_vec(),
                 ),
-                ast::token::Delimiter::Parenthesis,
-                ast::tokenstream::TokenStream::default(),
+                Delimiter::Parenthesis,
+                TokenStream::default(),
             ),
         )
     }
diff --git a/compiler/rustc_expand/src/mbe/transcribe.rs b/compiler/rustc_expand/src/mbe/transcribe.rs
index 3918631..2d3fd77 100644
--- a/compiler/rustc_expand/src/mbe/transcribe.rs
+++ b/compiler/rustc_expand/src/mbe/transcribe.rs
@@ -1,6 +1,5 @@
 use std::mem;
 
-use rustc_ast::mut_visit::{self, MutVisitor};
 use rustc_ast::token::{
     self, Delimiter, IdentIsRaw, InvisibleOrigin, Lit, LitKind, MetaVarKind, Token, TokenKind,
 };
@@ -29,10 +28,8 @@
 // A Marker adds the given mark to the syntax context.
 struct Marker(LocalExpnId, Transparency, FxHashMap<SyntaxContext, SyntaxContext>);
 
-impl MutVisitor for Marker {
-    const VISIT_TOKENS: bool = true;
-
-    fn visit_span(&mut self, span: &mut Span) {
+impl Marker {
+    fn mark_span(&mut self, span: &mut Span) {
         // `apply_mark` is a relatively expensive operation, both due to taking hygiene lock, and
         // by itself. All tokens in a macro body typically have the same syntactic context, unless
         // it's some advanced case with macro-generated macros. So if we cache the marked version
@@ -292,7 +289,7 @@ pub(super) fn transcribe<'a>(
 
                         // Emit as a token stream within `Delimiter::Invisible` to maintain
                         // parsing priorities.
-                        marker.visit_span(&mut sp);
+                        marker.mark_span(&mut sp);
                         with_metavar_spans(|mspans| mspans.insert(mk_span, sp));
                         // Both the open delim and close delim get the same span, which covers the
                         // `$foo` in the decl macro RHS.
@@ -312,13 +309,13 @@ pub(super) fn transcribe<'a>(
                             maybe_use_metavar_location(psess, &stack, sp, tt, &mut marker)
                         }
                         MatchedSingle(ParseNtResult::Ident(ident, is_raw)) => {
-                            marker.visit_span(&mut sp);
+                            marker.mark_span(&mut sp);
                             with_metavar_spans(|mspans| mspans.insert(ident.span, sp));
                             let kind = token::NtIdent(*ident, *is_raw);
                             TokenTree::token_alone(kind, sp)
                         }
                         MatchedSingle(ParseNtResult::Lifetime(ident, is_raw)) => {
-                            marker.visit_span(&mut sp);
+                            marker.mark_span(&mut sp);
                             with_metavar_spans(|mspans| mspans.insert(ident.span, sp));
                             let kind = token::NtLifetime(*ident, *is_raw);
                             TokenTree::token_alone(kind, sp)
@@ -400,8 +397,8 @@ pub(super) fn transcribe<'a>(
                 } else {
                     // If we aren't able to match the meta-var, we push it back into the result but
                     // with modified syntax context. (I believe this supports nested macros).
-                    marker.visit_span(&mut sp);
-                    marker.visit_ident(&mut original_ident);
+                    marker.mark_span(&mut sp);
+                    marker.mark_span(&mut original_ident.span);
                     result.push(TokenTree::token_joint_hidden(token::Dollar, sp));
                     result.push(TokenTree::Token(
                         Token::from_ast_ident(original_ident),
@@ -430,16 +427,19 @@ pub(super) fn transcribe<'a>(
             // jump back out of the Delimited, pop the result_stack and add the new results back to
             // the previous results (from outside the Delimited).
             &mbe::TokenTree::Delimited(mut span, ref spacing, ref delimited) => {
-                mut_visit::visit_delim_span(&mut marker, &mut span);
+                marker.mark_span(&mut span.open);
+                marker.mark_span(&mut span.close);
                 stack.push(Frame::new_delimited(delimited, span, *spacing));
                 result_stack.push(mem::take(&mut result));
             }
 
             // Nothing much to do here. Just push the token to the result, being careful to
             // preserve syntax context.
-            mbe::TokenTree::Token(token) => {
-                let mut token = *token;
-                mut_visit::visit_token(&mut marker, &mut token);
+            &mbe::TokenTree::Token(mut token) => {
+                marker.mark_span(&mut token.span);
+                if let token::NtIdent(ident, _) | token::NtLifetime(ident, _) = &mut token.kind {
+                    marker.mark_span(&mut ident.span);
+                }
                 let tt = TokenTree::Token(token, Spacing::Alone);
                 result.push(tt);
             }
@@ -504,7 +504,7 @@ fn maybe_use_metavar_location(
         return orig_tt.clone();
     }
 
-    marker.visit_span(&mut metavar_span);
+    marker.mark_span(&mut metavar_span);
     let no_collision = match orig_tt {
         TokenTree::Token(token, ..) => {
             with_metavar_spans(|mspans| mspans.insert(token.span, metavar_span))
@@ -774,7 +774,7 @@ fn transcribe_metavar_expr<'a>(
 ) -> PResult<'a, ()> {
     let mut visited_span = || {
         let mut span = sp.entire();
-        marker.visit_span(&mut span);
+        marker.mark_span(&mut span);
         span
     };
     match *expr {
diff --git a/compiler/rustc_hir_pretty/src/lib.rs b/compiler/rustc_hir_pretty/src/lib.rs
index 2f8e6c0..15e997a 100644
--- a/compiler/rustc_hir_pretty/src/lib.rs
+++ b/compiler/rustc_hir_pretty/src/lib.rs
@@ -146,6 +146,7 @@ fn print_attr_item(&mut self, item: &hir::AttrItem, span: Span) {
                     false,
                     None,
                     *delim,
+                    None,
                     &tokens,
                     true,
                     span,
diff --git a/compiler/rustc_hir_typeck/src/callee.rs b/compiler/rustc_hir_typeck/src/callee.rs
index 5f5e9e4..f555d11 100644
--- a/compiler/rustc_hir_typeck/src/callee.rs
+++ b/compiler/rustc_hir_typeck/src/callee.rs
@@ -14,7 +14,7 @@
 use rustc_middle::ty::{self, GenericArgsRef, Ty, TyCtxt, TypeVisitableExt};
 use rustc_middle::{bug, span_bug};
 use rustc_span::def_id::LocalDefId;
-use rustc_span::{Ident, Span, sym};
+use rustc_span::{Span, sym};
 use rustc_trait_selection::error_reporting::traits::DefIdOrName;
 use rustc_trait_selection::infer::InferCtxtExt as _;
 use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _;
@@ -87,14 +87,29 @@ pub(crate) fn check_expr_call(
 
         let output = match result {
             None => {
-                // this will report an error since original_callee_ty is not a fn
-                self.confirm_builtin_call(
-                    call_expr,
-                    callee_expr,
-                    original_callee_ty,
-                    arg_exprs,
-                    expected,
-                )
+                // Check all of the arg expressions, but with no expectations
+                // since we don't have a signature to compare them to.
+                for arg in arg_exprs {
+                    self.check_expr(arg);
+                }
+
+                if let hir::ExprKind::Path(hir::QPath::Resolved(_, path)) = &callee_expr.kind
+                    && let [segment] = path.segments
+                {
+                    self.dcx().try_steal_modify_and_emit_err(
+                        segment.ident.span,
+                        StashKey::CallIntoMethod,
+                        |err| {
+                            // Try suggesting `foo(a)` -> `a.foo()` if possible.
+                            self.suggest_call_as_method(
+                                err, segment, arg_exprs, call_expr, expected,
+                            );
+                        },
+                    );
+                }
+
+                let guar = self.report_invalid_callee(call_expr, callee_expr, expr_ty, arg_exprs);
+                Ty::new_error(self.tcx, guar)
             }
 
             Some(CallStep::Builtin(callee_ty)) => {
@@ -296,9 +311,9 @@ fn try_overloaded_call_traits(
                 Ty::new_tup_from_iter(self.tcx, arg_exprs.iter().map(|e| self.next_ty_var(e.span)))
             });
 
-            if let Some(ok) = self.lookup_method_in_trait(
+            if let Some(ok) = self.lookup_method_for_operator(
                 self.misc(call_expr.span),
-                Ident::with_dummy_span(method_name),
+                method_name,
                 trait_def_id,
                 adjusted_ty,
                 opt_input_type,
@@ -461,32 +476,11 @@ fn confirm_builtin_call(
                 }
                 (fn_sig, Some(def_id))
             }
+
             // FIXME(const_trait_impl): these arms should error because we can't enforce them
             ty::FnPtr(sig_tys, hdr) => (sig_tys.with(hdr), None),
-            _ => {
-                for arg in arg_exprs {
-                    self.check_expr(arg);
-                }
 
-                if let hir::ExprKind::Path(hir::QPath::Resolved(_, path)) = &callee_expr.kind
-                    && let [segment] = path.segments
-                {
-                    self.dcx().try_steal_modify_and_emit_err(
-                        segment.ident.span,
-                        StashKey::CallIntoMethod,
-                        |err| {
-                            // Try suggesting `foo(a)` -> `a.foo()` if possible.
-                            self.suggest_call_as_method(
-                                err, segment, arg_exprs, call_expr, expected,
-                            );
-                        },
-                    );
-                }
-
-                let err = self.report_invalid_callee(call_expr, callee_expr, callee_ty, arg_exprs);
-
-                return Ty::new_error(self.tcx, err);
-            }
+            _ => unreachable!(),
         };
 
         // Replace any late-bound regions that appear in the function
@@ -908,19 +902,23 @@ fn confirm_overloaded_call(
         call_expr: &'tcx hir::Expr<'tcx>,
         arg_exprs: &'tcx [hir::Expr<'tcx>],
         expected: Expectation<'tcx>,
-        method_callee: MethodCallee<'tcx>,
+        method: MethodCallee<'tcx>,
     ) -> Ty<'tcx> {
-        let output_type = self.check_method_argument_types(
+        self.check_argument_types(
             call_expr.span,
             call_expr,
-            Ok(method_callee),
-            arg_exprs,
-            TupleArgumentsFlag::TupleArguments,
+            &method.sig.inputs()[1..],
+            method.sig.output(),
             expected,
+            arg_exprs,
+            method.sig.c_variadic,
+            TupleArgumentsFlag::TupleArguments,
+            Some(method.def_id),
         );
 
-        self.write_method_call_and_enforce_effects(call_expr.hir_id, call_expr.span, method_callee);
-        output_type
+        self.write_method_call_and_enforce_effects(call_expr.hir_id, call_expr.span, method);
+
+        method.sig.output()
     }
 }
 
diff --git a/compiler/rustc_hir_typeck/src/expr.rs b/compiler/rustc_hir_typeck/src/expr.rs
index 9c6d4ee..db2650e 100644
--- a/compiler/rustc_hir_typeck/src/expr.rs
+++ b/compiler/rustc_hir_typeck/src/expr.rs
@@ -40,7 +40,6 @@
 use {rustc_ast as ast, rustc_hir as hir};
 
 use crate::Expectation::{self, ExpectCastableToType, ExpectHasType, NoExpectation};
-use crate::TupleArgumentsFlag::DontTupleArguments;
 use crate::coercion::{CoerceMany, DynamicCoerceMany};
 use crate::errors::{
     AddressOfTemporaryTaken, BaseExpressionDoubleDot, BaseExpressionDoubleDotAddExpr,
@@ -51,8 +50,8 @@
     YieldExprOutsideOfCoroutine,
 };
 use crate::{
-    BreakableCtxt, CoroutineTypes, Diverges, FnCtxt, Needs, cast, fatally_break_rust,
-    report_unexpected_variant_res, type_error_struct,
+    BreakableCtxt, CoroutineTypes, Diverges, FnCtxt, Needs, TupleArgumentsFlag, cast,
+    fatally_break_rust, report_unexpected_variant_res, type_error_struct,
 };
 
 impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
@@ -1591,28 +1590,45 @@ fn check_expr_method_call(
         // no need to check for bot/err -- callee does that
         let rcvr_t = self.structurally_resolve_type(rcvr.span, rcvr_t);
 
-        let method = match self.lookup_method(rcvr_t, segment, segment.ident.span, expr, rcvr, args)
-        {
+        match self.lookup_method(rcvr_t, segment, segment.ident.span, expr, rcvr, args) {
             Ok(method) => {
-                // We could add a "consider `foo::<params>`" suggestion here, but I wasn't able to
-                // trigger this codepath causing `structurally_resolve_type` to emit an error.
                 self.write_method_call_and_enforce_effects(expr.hir_id, expr.span, method);
-                Ok(method)
+
+                self.check_argument_types(
+                    segment.ident.span,
+                    expr,
+                    &method.sig.inputs()[1..],
+                    method.sig.output(),
+                    expected,
+                    args,
+                    method.sig.c_variadic,
+                    TupleArgumentsFlag::DontTupleArguments,
+                    Some(method.def_id),
+                );
+
+                method.sig.output()
             }
             Err(error) => {
-                Err(self.report_method_error(expr.hir_id, rcvr_t, error, expected, false))
-            }
-        };
+                let guar = self.report_method_error(expr.hir_id, rcvr_t, error, expected, false);
 
-        // Call the generic checker.
-        self.check_method_argument_types(
-            segment.ident.span,
-            expr,
-            method,
-            args,
-            DontTupleArguments,
-            expected,
-        )
+                let err_inputs = self.err_args(args.len(), guar);
+                let err_output = Ty::new_error(self.tcx, guar);
+
+                self.check_argument_types(
+                    segment.ident.span,
+                    expr,
+                    &err_inputs,
+                    err_output,
+                    NoExpectation,
+                    args,
+                    false,
+                    TupleArgumentsFlag::DontTupleArguments,
+                    None,
+                );
+
+                err_output
+            }
+        }
     }
 
     /// Checks use `x.use`.
diff --git a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
index e70aa1a..c804dc5 100644
--- a/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
+++ b/compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs
@@ -33,7 +33,6 @@
 use crate::fn_ctxt::infer::FnCall;
 use crate::gather_locals::Declaration;
 use crate::inline_asm::InlineAsmCtxt;
-use crate::method::MethodCallee;
 use crate::method::probe::IsSuggestion;
 use crate::method::probe::Mode::MethodCall;
 use crate::method::probe::ProbeScope::TraitsInScope;
@@ -127,61 +126,6 @@ pub(in super::super) fn check_repeat_exprs(&self) {
         }
     }
 
-    pub(in super::super) fn check_method_argument_types(
-        &self,
-        sp: Span,
-        expr: &'tcx hir::Expr<'tcx>,
-        method: Result<MethodCallee<'tcx>, ErrorGuaranteed>,
-        args_no_rcvr: &'tcx [hir::Expr<'tcx>],
-        tuple_arguments: TupleArgumentsFlag,
-        expected: Expectation<'tcx>,
-    ) -> Ty<'tcx> {
-        let has_error = match method {
-            Ok(method) => method.args.error_reported().and(method.sig.error_reported()),
-            Err(guar) => Err(guar),
-        };
-        if let Err(guar) = has_error {
-            let err_inputs = self.err_args(
-                method.map_or(args_no_rcvr.len(), |method| method.sig.inputs().len() - 1),
-                guar,
-            );
-            let err_output = Ty::new_error(self.tcx, guar);
-
-            let err_inputs = match tuple_arguments {
-                DontTupleArguments => err_inputs,
-                TupleArguments => vec![Ty::new_tup(self.tcx, &err_inputs)],
-            };
-
-            self.check_argument_types(
-                sp,
-                expr,
-                &err_inputs,
-                err_output,
-                NoExpectation,
-                args_no_rcvr,
-                false,
-                tuple_arguments,
-                method.ok().map(|method| method.def_id),
-            );
-            return err_output;
-        }
-
-        let method = method.unwrap();
-        self.check_argument_types(
-            sp,
-            expr,
-            &method.sig.inputs()[1..],
-            method.sig.output(),
-            expected,
-            args_no_rcvr,
-            method.sig.c_variadic,
-            tuple_arguments,
-            Some(method.def_id),
-        );
-
-        method.sig.output()
-    }
-
     /// Generic function that factors out common logic from function calls,
     /// method calls and overloaded operators.
     pub(in super::super) fn check_argument_types(
diff --git a/compiler/rustc_hir_typeck/src/method/mod.rs b/compiler/rustc_hir_typeck/src/method/mod.rs
index 1b67e23..34bbb7d 100644
--- a/compiler/rustc_hir_typeck/src/method/mod.rs
+++ b/compiler/rustc_hir_typeck/src/method/mod.rs
@@ -19,7 +19,7 @@
     self, GenericArgs, GenericArgsRef, GenericParamDefKind, Ty, TypeVisitableExt,
 };
 use rustc_middle::{bug, span_bug};
-use rustc_span::{ErrorGuaranteed, Ident, Span};
+use rustc_span::{ErrorGuaranteed, Ident, Span, Symbol};
 use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt;
 use rustc_trait_selection::traits::{self, NormalizeExt};
 use tracing::{debug, instrument};
@@ -329,10 +329,10 @@ pub(crate) fn lookup_probe_for_diagnostic(
     /// an obligation for a particular trait with the given self type and checks
     /// whether that trait is implemented.
     #[instrument(level = "debug", skip(self))]
-    pub(super) fn lookup_method_in_trait(
+    pub(super) fn lookup_method_for_operator(
         &self,
         cause: ObligationCause<'tcx>,
-        m_name: Ident,
+        method_name: Symbol,
         trait_def_id: DefId,
         self_ty: Ty<'tcx>,
         opt_rhs_ty: Option<Ty<'tcx>>,
@@ -374,13 +374,20 @@ pub(super) fn lookup_method_in_trait(
         // Trait must have a method named `m_name` and it should not have
         // type parameters or early-bound regions.
         let tcx = self.tcx;
-        let Some(method_item) = self.associated_value(trait_def_id, m_name) else {
+        // We use `Ident::with_dummy_span` since no built-in operator methods have
+        // any macro-specific hygeine, so the span's context doesn't really matter.
+        let Some(method_item) =
+            self.associated_value(trait_def_id, Ident::with_dummy_span(method_name))
+        else {
             bug!("expected associated item for operator trait")
         };
 
         let def_id = method_item.def_id;
         if !method_item.is_fn() {
-            span_bug!(tcx.def_span(def_id), "expected `{m_name}` to be an associated function");
+            span_bug!(
+                tcx.def_span(def_id),
+                "expected `{method_name}` to be an associated function"
+            );
         }
 
         debug!("lookup_in_trait_adjusted: method_item={:?}", method_item);
diff --git a/compiler/rustc_hir_typeck/src/method/probe.rs b/compiler/rustc_hir_typeck/src/method/probe.rs
index 1d3a081..bda051f 100644
--- a/compiler/rustc_hir_typeck/src/method/probe.rs
+++ b/compiler/rustc_hir_typeck/src/method/probe.rs
@@ -1213,7 +1213,7 @@ fn pick_all_method<'b>(
                 debug!("pick_all_method: step={:?}", step);
                 // skip types that are from a type error or that would require dereferencing
                 // a raw pointer
-                !step.self_ty.references_error() && !step.from_unsafe_deref
+                !step.self_ty.value.references_error() && !step.from_unsafe_deref
             })
             .find_map(|step| {
                 let InferOk { value: self_ty, obligations: _ } = self
diff --git a/compiler/rustc_hir_typeck/src/op.rs b/compiler/rustc_hir_typeck/src/op.rs
index b86991f..7f7921b 100644
--- a/compiler/rustc_hir_typeck/src/op.rs
+++ b/compiler/rustc_hir_typeck/src/op.rs
@@ -12,7 +12,7 @@
 use rustc_middle::ty::{self, IsSuggestable, Ty, TyCtxt, TypeVisitableExt};
 use rustc_session::errors::ExprParenthesesNeeded;
 use rustc_span::source_map::Spanned;
-use rustc_span::{Ident, Span, Symbol, sym};
+use rustc_span::{Span, Symbol, sym};
 use rustc_trait_selection::infer::InferCtxtExt;
 use rustc_trait_selection::traits::{FulfillmentError, Obligation, ObligationCtxt};
 use tracing::debug;
@@ -975,7 +975,6 @@ fn lookup_op_method(
             lhs_ty, opname, trait_did
         );
 
-        let opname = Ident::with_dummy_span(opname);
         let (opt_rhs_expr, opt_rhs_ty) = opt_rhs.unzip();
         let cause = self.cause(
             span,
@@ -990,7 +989,7 @@ fn lookup_op_method(
         );
 
         let method =
-            self.lookup_method_in_trait(cause.clone(), opname, trait_did, lhs_ty, opt_rhs_ty);
+            self.lookup_method_for_operator(cause.clone(), opname, trait_did, lhs_ty, opt_rhs_ty);
         match method {
             Some(ok) => {
                 let method = self.register_infer_ok_obligations(ok);
diff --git a/compiler/rustc_hir_typeck/src/place_op.rs b/compiler/rustc_hir_typeck/src/place_op.rs
index 4fc903c..fedc75a 100644
--- a/compiler/rustc_hir_typeck/src/place_op.rs
+++ b/compiler/rustc_hir_typeck/src/place_op.rs
@@ -8,7 +8,7 @@
     PointerCoercion,
 };
 use rustc_middle::ty::{self, Ty};
-use rustc_span::{Ident, Span, sym};
+use rustc_span::{Span, sym};
 use tracing::debug;
 use {rustc_ast as ast, rustc_hir as hir};
 
@@ -211,13 +211,7 @@ pub(super) fn try_overloaded_place_op(
             return None;
         };
 
-        self.lookup_method_in_trait(
-            self.misc(span),
-            Ident::with_dummy_span(imm_op),
-            imm_tr,
-            base_ty,
-            opt_rhs_ty,
-        )
+        self.lookup_method_for_operator(self.misc(span), imm_op, imm_tr, base_ty, opt_rhs_ty)
     }
 
     fn try_mutable_overloaded_place_op(
@@ -237,13 +231,7 @@ fn try_mutable_overloaded_place_op(
             return None;
         };
 
-        self.lookup_method_in_trait(
-            self.misc(span),
-            Ident::with_dummy_span(mut_op),
-            mut_tr,
-            base_ty,
-            opt_rhs_ty,
-        )
+        self.lookup_method_for_operator(self.misc(span), mut_op, mut_tr, base_ty, opt_rhs_ty)
     }
 
     /// Convert auto-derefs, indices, etc of an expression from `Deref` and `Index`
diff --git a/compiler/rustc_hir_typeck/src/writeback.rs b/compiler/rustc_hir_typeck/src/writeback.rs
index c500017..807d625 100644
--- a/compiler/rustc_hir_typeck/src/writeback.rs
+++ b/compiler/rustc_hir_typeck/src/writeback.rs
@@ -9,7 +9,6 @@
 use rustc_hir::intravisit::{self, InferKind, Visitor};
 use rustc_hir::{self as hir, AmbigArg, HirId};
 use rustc_infer::traits::solve::Goal;
-use rustc_middle::span_bug;
 use rustc_middle::traits::ObligationCause;
 use rustc_middle::ty::adjustment::{Adjust, Adjustment, PointerCoercion};
 use rustc_middle::ty::{
@@ -513,15 +512,6 @@ fn visit_user_provided_tys(&mut self) {
         self.typeck_results.user_provided_types_mut().extend(
             fcx_typeck_results.user_provided_types().items().map(|(local_id, c_ty)| {
                 let hir_id = HirId { owner: common_hir_owner, local_id };
-
-                if cfg!(debug_assertions) && c_ty.has_infer() {
-                    span_bug!(
-                        hir_id.to_span(self.fcx.tcx),
-                        "writeback: `{:?}` has inference variables",
-                        c_ty
-                    );
-                };
-
                 (hir_id, *c_ty)
             }),
         );
@@ -532,17 +522,7 @@ fn visit_user_provided_sigs(&mut self) {
         assert_eq!(fcx_typeck_results.hir_owner, self.typeck_results.hir_owner);
 
         self.typeck_results.user_provided_sigs.extend_unord(
-            fcx_typeck_results.user_provided_sigs.items().map(|(&def_id, c_sig)| {
-                if cfg!(debug_assertions) && c_sig.has_infer() {
-                    span_bug!(
-                        self.fcx.tcx.def_span(def_id),
-                        "writeback: `{:?}` has inference variables",
-                        c_sig
-                    );
-                };
-
-                (def_id, *c_sig)
-            }),
+            fcx_typeck_results.user_provided_sigs.items().map(|(def_id, c_sig)| (*def_id, *c_sig)),
         );
     }
 
diff --git a/compiler/rustc_lint/src/nonstandard_style.rs b/compiler/rustc_lint/src/nonstandard_style.rs
index a3e7c84..d1138e8 100644
--- a/compiler/rustc_lint/src/nonstandard_style.rs
+++ b/compiler/rustc_lint/src/nonstandard_style.rs
@@ -422,6 +422,16 @@ fn check_item(&mut self, cx: &LateContext<'_>, it: &hir::Item<'_>) {
         }
     }
 
+    fn check_ty(&mut self, cx: &LateContext<'_>, ty: &hir::Ty<'_, hir::AmbigArg>) {
+        if let hir::TyKind::BareFn(hir::BareFnTy { param_idents, .. }) = &ty.kind {
+            for param_ident in *param_idents {
+                if let Some(param_ident) = param_ident {
+                    self.check_snake_case(cx, "variable", param_ident);
+                }
+            }
+        }
+    }
+
     fn check_trait_item(&mut self, cx: &LateContext<'_>, item: &hir::TraitItem<'_>) {
         if let hir::TraitItemKind::Fn(_, hir::TraitFn::Required(param_idents)) = item.kind {
             self.check_snake_case(cx, "trait method", &item.ident);
diff --git a/compiler/rustc_lint/src/types.rs b/compiler/rustc_lint/src/types.rs
index 39664b8..f1c06df 100644
--- a/compiler/rustc_lint/src/types.rs
+++ b/compiler/rustc_lint/src/types.rs
@@ -755,10 +755,10 @@ fn diag_item_cmpop(diag_item: Symbol) -> Option<ComparisonOp> {
     /// *subsequent* fields of the associated structs to use an alignment value
     /// where the floating-point type is aligned on a 4-byte boundary.
     ///
-    /// The power alignment rule for structs needed for C compatibility is
-    /// unimplementable within `repr(C)` in the compiler without building in
-    /// handling of references to packed fields and infectious nested layouts,
-    /// so a warning is produced in these situations.
+    /// Effectively, subsequent floating-point fields act as-if they are `repr(packed(4))`. This
+    /// would be unsound to do in a `repr(C)` type without all the restrictions that come with
+    /// `repr(packed)`. Rust instead chooses a layout that maintains soundness of Rust code, at the
+    /// expense of incompatibility with C code.
     ///
     /// ### Example
     ///
@@ -790,8 +790,10 @@ fn diag_item_cmpop(diag_item: Symbol) -> Option<ComparisonOp> {
     ///  - offset_of!(Floats, a) == 0
     ///  - offset_of!(Floats, b) == 8
     ///  - offset_of!(Floats, c) == 12
-    /// However, rust currently aligns `c` at offset_of!(Floats, c) == 16.
-    /// Thus, a warning should be produced for the above struct in this case.
+    ///
+    /// However, Rust currently aligns `c` at `offset_of!(Floats, c) == 16`.
+    /// Using offset 12 would be unsound since `f64` generally must be 8-aligned on this target.
+    /// Thus, a warning is produced for the above struct.
     USES_POWER_ALIGNMENT,
     Warn,
     "Structs do not follow the power alignment rule under repr(C)"
@@ -1655,15 +1657,13 @@ fn check_arg_for_power_alignment<'tcx>(
         cx: &LateContext<'tcx>,
         ty: Ty<'tcx>,
     ) -> bool {
+        assert!(cx.tcx.sess.target.os == "aix");
         // Structs (under repr(C)) follow the power alignment rule if:
         //   - the first field of the struct is a floating-point type that
         //     is greater than 4-bytes, or
         //   - the first field of the struct is an aggregate whose
         //     recursively first field is a floating-point type greater than
         //     4 bytes.
-        if cx.tcx.sess.target.os != "aix" {
-            return false;
-        }
         if ty.is_floating_point() && ty.primitive_size(cx.tcx).bytes() > 4 {
             return true;
         } else if let Adt(adt_def, _) = ty.kind()
@@ -1701,21 +1701,14 @@ fn check_struct_for_power_alignment<'tcx>(
             && !adt_def.all_fields().next().is_none()
         {
             let struct_variant_data = item.expect_struct().1;
-            for (index, ..) in struct_variant_data.fields().iter().enumerate() {
+            for field_def in struct_variant_data.fields().iter().skip(1) {
                 // Struct fields (after the first field) are checked for the
                 // power alignment rule, as fields after the first are likely
                 // to be the fields that are misaligned.
-                if index != 0 {
-                    let first_field_def = struct_variant_data.fields()[index];
-                    let def_id = first_field_def.def_id;
-                    let ty = cx.tcx.type_of(def_id).instantiate_identity();
-                    if self.check_arg_for_power_alignment(cx, ty) {
-                        cx.emit_span_lint(
-                            USES_POWER_ALIGNMENT,
-                            first_field_def.span,
-                            UsesPowerAlignment,
-                        );
-                    }
+                let def_id = field_def.def_id;
+                let ty = cx.tcx.type_of(def_id).instantiate_identity();
+                if self.check_arg_for_power_alignment(cx, ty) {
+                    cx.emit_span_lint(USES_POWER_ALIGNMENT, field_def.span, UsesPowerAlignment);
                 }
             }
         }
diff --git a/compiler/rustc_macros/src/query.rs b/compiler/rustc_macros/src/query.rs
index 62bf34ad..33fb13e 100644
--- a/compiler/rustc_macros/src/query.rs
+++ b/compiler/rustc_macros/src/query.rs
@@ -407,11 +407,23 @@ macro_rules! passthrough {
     }
 
     TokenStream::from(quote! {
+        /// Higher-order macro that invokes the specified macro with a prepared
+        /// list of all query signatures (including modifiers).
+        ///
+        /// This allows multiple simpler macros to each have access to the list
+        /// of queries.
         #[macro_export]
-        macro_rules! rustc_query_append {
-            ($macro:ident! $( [$($other:tt)*] )?) => {
+        macro_rules! rustc_with_all_queries {
+            (
+                // The macro to invoke once, on all queries (plus extras).
+                $macro:ident!
+
+                // Within [], an optional list of extra "query" signatures to
+                // pass to the given macro, in addition to the actual queries.
+                $( [$($extra_fake_queries:tt)*] )?
+            ) => {
                 $macro! {
-                    $( $($other)* )?
+                    $( $($extra_fake_queries)* )?
                     #query_stream
                 }
             }
diff --git a/compiler/rustc_middle/src/dep_graph/dep_node.rs b/compiler/rustc_middle/src/dep_graph/dep_node.rs
index 644cdac..0c998a2 100644
--- a/compiler/rustc_middle/src/dep_graph/dep_node.rs
+++ b/compiler/rustc_middle/src/dep_graph/dep_node.rs
@@ -13,8 +13,11 @@
 
 macro_rules! define_dep_nodes {
     (
-     $($(#[$attr:meta])*
-        [$($modifiers:tt)*] fn $variant:ident($($K:tt)*) -> $V:ty,)*) => {
+        $(
+            $(#[$attr:meta])*
+            [$($modifiers:tt)*] fn $variant:ident($($K:tt)*) -> $V:ty,
+        )*
+    ) => {
 
         #[macro_export]
         macro_rules! make_dep_kind_array {
@@ -83,7 +86,9 @@ pub mod label_strs {
     };
 }
 
-rustc_query_append!(define_dep_nodes![
+// Create various data structures for each query, and also for a few things
+// that aren't queries.
+rustc_with_all_queries!(define_dep_nodes![
     /// We use this for most things when incr. comp. is turned off.
     [] fn Null() -> (),
     /// We use this to create a forever-red node.
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs
index b55e4d7..88f4c4a 100644
--- a/compiler/rustc_middle/src/query/mod.rs
+++ b/compiler/rustc_middle/src/query/mod.rs
@@ -2578,5 +2578,5 @@
     }
 }
 
-rustc_query_append! { define_callbacks! }
+rustc_with_all_queries! { define_callbacks! }
 rustc_feedable_queries! { define_feedable! }
diff --git a/compiler/rustc_middle/src/query/plumbing.rs b/compiler/rustc_middle/src/query/plumbing.rs
index 69b6f88..769df1f 100644
--- a/compiler/rustc_middle/src/query/plumbing.rs
+++ b/compiler/rustc_middle/src/query/plumbing.rs
@@ -313,8 +313,11 @@ macro_rules! separate_provide_extern_default {
 
 macro_rules! define_callbacks {
     (
-     $($(#[$attr:meta])*
-        [$($modifiers:tt)*] fn $name:ident($($K:tt)*) -> $V:ty,)*) => {
+        $(
+            $(#[$attr:meta])*
+            [$($modifiers:tt)*] fn $name:ident($($K:tt)*) -> $V:ty,
+        )*
+    ) => {
 
         #[allow(unused_lifetimes)]
         pub mod queries {
diff --git a/compiler/rustc_middle/src/ty/structural_impls.rs b/compiler/rustc_middle/src/ty/structural_impls.rs
index 2fcb2a1..58f7bc7 100644
--- a/compiler/rustc_middle/src/ty/structural_impls.rs
+++ b/compiler/rustc_middle/src/ty/structural_impls.rs
@@ -13,7 +13,6 @@
 
 use super::print::PrettyPrinter;
 use super::{GenericArg, GenericArgKind, Pattern, Region};
-use crate::infer::canonical::CanonicalVarInfos;
 use crate::mir::PlaceElem;
 use crate::ty::print::{FmtPrinter, Printer, with_no_trimmed_paths};
 use crate::ty::{
@@ -780,5 +779,4 @@ fn fold_with<F: TypeFolder<TyCtxt<'tcx>>>(
     &'tcx ty::List<ty::PolyExistentialPredicate<'tcx>> : mk_poly_existential_predicates,
     &'tcx ty::List<PlaceElem<'tcx>> : mk_place_elems,
     &'tcx ty::List<ty::Pattern<'tcx>> : mk_patterns,
-    CanonicalVarInfos<'tcx> : mk_canonical_var_infos,
 }
diff --git a/compiler/rustc_middle/src/ty/typeck_results.rs b/compiler/rustc_middle/src/ty/typeck_results.rs
index 8c5827d..c6a45f8 100644
--- a/compiler/rustc_middle/src/ty/typeck_results.rs
+++ b/compiler/rustc_middle/src/ty/typeck_results.rs
@@ -716,6 +716,8 @@ pub struct UserTypeAnnotationIndex {
 
 #[derive(Clone, Debug, TyEncodable, TyDecodable, HashStable, TypeFoldable, TypeVisitable)]
 pub struct CanonicalUserTypeAnnotation<'tcx> {
+    #[type_foldable(identity)]
+    #[type_visitable(ignore)]
     pub user_ty: Box<CanonicalUserType<'tcx>>,
     pub span: Span,
     pub inferred_ty: Ty<'tcx>,
diff --git a/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs b/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs
index 035bfff..b16f74c 100644
--- a/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs
+++ b/compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs
@@ -724,6 +724,9 @@ pub(in crate::solve) fn const_conditions_for_destruct<I: Interner>(
     let destruct_def_id = cx.require_lang_item(TraitSolverLangItem::Destruct);
 
     match self_ty.kind() {
+        // `ManuallyDrop` is trivially `~const Destruct` as we do not run any drop glue on it.
+        ty::Adt(adt_def, _) if adt_def.is_manually_drop() => Ok(vec![]),
+
         // An ADT is `~const Destruct` only if all of the fields are,
         // *and* if there is a `Drop` impl, that `Drop` impl is also `~const`.
         ty::Adt(adt_def, args) => {
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index 5500fba..1c542eb 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -56,10 +56,6 @@
 mod tokenstream {
     mod tests;
 }
-#[cfg(test)]
-mod mut_visit {
-    mod tests;
-}
 
 bitflags::bitflags! {
     #[derive(Clone, Copy, Debug)]
diff --git a/compiler/rustc_parse/src/parser/mut_visit/tests.rs b/compiler/rustc_parse/src/parser/mut_visit/tests.rs
deleted file mode 100644
index 46c678c..0000000
--- a/compiler/rustc_parse/src/parser/mut_visit/tests.rs
+++ /dev/null
@@ -1,65 +0,0 @@
-use rustc_ast as ast;
-use rustc_ast::mut_visit::MutVisitor;
-use rustc_ast_pretty::pprust;
-use rustc_span::{Ident, create_default_session_globals_then};
-
-use crate::parser::tests::{matches_codepattern, string_to_crate};
-
-// This version doesn't care about getting comments or doc-strings in.
-fn print_crate_items(krate: &ast::Crate) -> String {
-    krate.items.iter().map(|i| pprust::item_to_string(i)).collect::<Vec<_>>().join(" ")
-}
-
-// Change every identifier to "zz".
-struct ToZzIdentMutVisitor;
-
-impl MutVisitor for ToZzIdentMutVisitor {
-    const VISIT_TOKENS: bool = true;
-
-    fn visit_ident(&mut self, ident: &mut Ident) {
-        *ident = Ident::from_str("zz");
-    }
-}
-
-macro_rules! assert_matches_codepattern {
-    ($a:expr , $b:expr) => {{
-        let a_val = $a;
-        let b_val = $b;
-        if !matches_codepattern(&a_val, &b_val) {
-            panic!("expected args satisfying `matches_codepattern`, got {} and {}", a_val, b_val);
-        }
-    }};
-}
-
-// Make sure idents get transformed everywhere.
-#[test]
-fn ident_transformation() {
-    create_default_session_globals_then(|| {
-        let mut zz_visitor = ToZzIdentMutVisitor;
-        let mut krate =
-            string_to_crate("#[a] mod b {fn c (d : e, f : g) {h!(i,j,k);l;m}}".to_string());
-        zz_visitor.visit_crate(&mut krate);
-        assert_matches_codepattern!(
-            print_crate_items(&krate),
-            "#[zz]mod zz{fn zz(zz:zz,zz:zz){zz!(zz,zz,zz);zz;zz}}".to_string()
-        );
-    })
-}
-
-// Make sure idents get transformed even inside macro defs.
-#[test]
-fn ident_transformation_in_defs() {
-    create_default_session_globals_then(|| {
-        let mut zz_visitor = ToZzIdentMutVisitor;
-        let mut krate = string_to_crate(
-            "macro_rules! a {(b $c:expr $(d $e:token)f+ => \
-            (g $(d $d $e)+))} "
-                .to_string(),
-        );
-        zz_visitor.visit_crate(&mut krate);
-        assert_matches_codepattern!(
-            print_crate_items(&krate),
-            "macro_rules! zz{(zz$zz:zz$(zz $zz:zz)zz+=>(zz$(zz$zz$zz)+))}".to_string()
-        );
-    })
-}
diff --git a/compiler/rustc_parse/src/parser/tests.rs b/compiler/rustc_parse/src/parser/tests.rs
index 8285070..2a44c90 100644
--- a/compiler/rustc_parse/src/parser/tests.rs
+++ b/compiler/rustc_parse/src/parser/tests.rs
@@ -95,12 +95,6 @@ pub(crate) fn string_to_stream(source_str: String) -> TokenStream {
     ))
 }
 
-/// Parses a string, returns a crate.
-pub(crate) fn string_to_crate(source_str: String) -> ast::Crate {
-    let psess = psess();
-    with_error_checking_parse(source_str, &psess, |p| p.parse_crate_mod())
-}
-
 /// Does the given string match the pattern? whitespace in the first string
 /// may be deleted or replaced with other whitespace to match the pattern.
 /// This function is relatively Unicode-ignorant; fortunately, the careful design
diff --git a/compiler/rustc_query_impl/src/lib.rs b/compiler/rustc_query_impl/src/lib.rs
index 3c329dd..b7d8af2 100644
--- a/compiler/rustc_query_impl/src/lib.rs
+++ b/compiler/rustc_query_impl/src/lib.rs
@@ -234,7 +234,7 @@ pub fn query_system<'a>(
     }
 }
 
-rustc_middle::rustc_query_append! { define_queries! }
+rustc_middle::rustc_with_all_queries! { define_queries! }
 
 pub fn provide(providers: &mut rustc_middle::util::Providers) {
     providers.hooks.alloc_self_profile_query_strings = alloc_self_profile_query_strings;
diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs
index 19ccc55..d11fa8b 100644
--- a/compiler/rustc_query_impl/src/plumbing.rs
+++ b/compiler/rustc_query_impl/src/plumbing.rs
@@ -575,11 +575,14 @@ pub(crate) fn __rust_begin_short_backtrace<F, T>(f: F) -> T
 }
 
 // NOTE: `$V` isn't used here, but we still need to match on it so it can be passed to other macros
-// invoked by `rustc_query_append`.
+// invoked by `rustc_with_all_queries`.
 macro_rules! define_queries {
     (
-     $($(#[$attr:meta])*
-        [$($modifiers:tt)*] fn $name:ident($($K:tt)*) -> $V:ty,)*) => {
+        $(
+            $(#[$attr:meta])*
+            [$($modifiers:tt)*] fn $name:ident($($K:tt)*) -> $V:ty,
+        )*
+    ) => {
 
         pub(crate) mod query_impl { $(pub(crate) mod $name {
             use super::super::*;
diff --git a/compiler/rustc_trait_selection/src/traits/effects.rs b/compiler/rustc_trait_selection/src/traits/effects.rs
index defbafa..1b5dcef 100644
--- a/compiler/rustc_trait_selection/src/traits/effects.rs
+++ b/compiler/rustc_trait_selection/src/traits/effects.rs
@@ -252,6 +252,9 @@ fn evaluate_host_effect_for_destruct_goal<'tcx>(
     let self_ty = obligation.predicate.self_ty();
 
     let const_conditions = match *self_ty.kind() {
+        // `ManuallyDrop` is trivially `~const Destruct` as we do not run any drop glue on it.
+        ty::Adt(adt_def, _) if adt_def.is_manually_drop() => thin_vec![],
+
         // An ADT is `~const Destruct` only if all of the fields are,
         // *and* if there is a `Drop` impl, that `Drop` impl is also `~const`.
         ty::Adt(adt_def, args) => {
diff --git a/compiler/rustc_transmute/Cargo.toml b/compiler/rustc_transmute/Cargo.toml
index 0250cc0e..246b66d 100644
--- a/compiler/rustc_transmute/Cargo.toml
+++ b/compiler/rustc_transmute/Cargo.toml
@@ -5,7 +5,6 @@
 
 [dependencies]
 # tidy-alphabetical-start
-itertools = "0.12"
 rustc_abi = { path = "../rustc_abi", optional = true }
 rustc_data_structures = { path = "../rustc_data_structures" }
 rustc_hir = { path = "../rustc_hir", optional = true }
@@ -15,6 +14,11 @@
 tracing = "0.1"
 # tidy-alphabetical-end
 
+[dev-dependencies]
+# tidy-alphabetical-start
+itertools = "0.12"
+# tidy-alphabetical-end
+
 [features]
 rustc = [
     "dep:rustc_abi",
diff --git a/compiler/rustc_transmute/src/layout/dfa.rs b/compiler/rustc_transmute/src/layout/dfa.rs
index d1f5815..05afa28 100644
--- a/compiler/rustc_transmute/src/layout/dfa.rs
+++ b/compiler/rustc_transmute/src/layout/dfa.rs
@@ -1,5 +1,5 @@
 use std::fmt;
-use std::ops::RangeInclusive;
+use std::iter::Peekable;
 use std::sync::atomic::{AtomicU32, Ordering};
 
 use super::{Byte, Ref, Tree, Uninhabited};
@@ -211,15 +211,15 @@ fn enqueue(&mut self, a_state: Option<State>, b_state: Option<State>) {
             let b_transitions =
                 b_src.and_then(|b_src| b.transitions.get(&b_src)).unwrap_or(&empty_transitions);
 
-            let byte_transitions =
-                a_transitions.byte_transitions.union(&b_transitions.byte_transitions);
+            let byte_transitions = a_transitions.byte_transitions.union(
+                &b_transitions.byte_transitions,
+                |a_dst, b_dst| {
+                    assert!(a_dst.is_some() || b_dst.is_some());
 
-            let byte_transitions = byte_transitions.map_states(|(a_dst, b_dst)| {
-                assert!(a_dst.is_some() || b_dst.is_some());
-
-                queue.enqueue(a_dst, b_dst);
-                mapped((a_dst, b_dst))
-            });
+                    queue.enqueue(a_dst, b_dst);
+                    mapped((a_dst, b_dst))
+                },
+            );
 
             let ref_transitions =
                 a_transitions.ref_transitions.keys().chain(b_transitions.ref_transitions.keys());
@@ -245,18 +245,6 @@ fn enqueue(&mut self, a_state: Option<State>, b_state: Option<State>) {
         Self { transitions, start, accept }
     }
 
-    pub(crate) fn states_from(
-        &self,
-        state: State,
-        src_validity: RangeInclusive<u8>,
-    ) -> impl Iterator<Item = (Byte, State)> {
-        self.transitions
-            .get(&state)
-            .map(move |t| t.byte_transitions.states_from(src_validity))
-            .into_iter()
-            .flatten()
-    }
-
     pub(crate) fn get_uninit_edge_dst(&self, state: State) -> Option<State> {
         let transitions = self.transitions.get(&state)?;
         transitions.byte_transitions.get_uninit_edge_dst()
@@ -334,95 +322,31 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
 
 use edge_set::EdgeSet;
 mod edge_set {
-    use std::cmp;
-
-    use run::*;
-    use smallvec::{SmallVec, smallvec};
+    use smallvec::SmallVec;
 
     use super::*;
-    mod run {
-        use std::ops::{Range, RangeInclusive};
 
-        use super::*;
-        use crate::layout::Byte;
-
-        /// A logical set of edges.
-        ///
-        /// A `Run` encodes one edge for every byte value in `start..=end`
-        /// pointing to `dst`.
-        #[derive(Eq, PartialEq, Copy, Clone, Debug)]
-        pub(super) struct Run<S> {
-            // `start` and `end` are both inclusive (ie, closed) bounds, as this
-            // is required in order to be able to store 0..=255. We provide
-            // setters and getters which operate on closed/open ranges, which
-            // are more intuitive and easier for performing offset math.
-            start: u8,
-            end: u8,
-            pub(super) dst: S,
-        }
-
-        impl<S> Run<S> {
-            pub(super) fn new(range: RangeInclusive<u8>, dst: S) -> Self {
-                Self { start: *range.start(), end: *range.end(), dst }
-            }
-
-            pub(super) fn from_inclusive_exclusive(range: Range<u16>, dst: S) -> Self {
-                Self {
-                    start: range.start.try_into().unwrap(),
-                    end: (range.end - 1).try_into().unwrap(),
-                    dst,
-                }
-            }
-
-            pub(super) fn contains(&self, idx: u16) -> bool {
-                idx >= u16::from(self.start) && idx <= u16::from(self.end)
-            }
-
-            pub(super) fn as_inclusive_exclusive(&self) -> (u16, u16) {
-                (u16::from(self.start), u16::from(self.end) + 1)
-            }
-
-            pub(super) fn as_byte(&self) -> Byte {
-                Byte::new(self.start..=self.end)
-            }
-
-            pub(super) fn map_state<SS>(self, f: impl FnOnce(S) -> SS) -> Run<SS> {
-                let Run { start, end, dst } = self;
-                Run { start, end, dst: f(dst) }
-            }
-
-            /// Produces a new `Run` whose lower bound is the greater of
-            /// `self`'s existing lower bound and `lower_bound`.
-            pub(super) fn clamp_lower(self, lower_bound: u8) -> Self {
-                let Run { start, end, dst } = self;
-                Run { start: cmp::max(start, lower_bound), end, dst }
-            }
-        }
-    }
-
-    /// The set of outbound byte edges associated with a DFA node (not including
-    /// reference edges).
+    /// The set of outbound byte edges associated with a DFA node.
     #[derive(Eq, PartialEq, Clone, Debug)]
     pub(super) struct EdgeSet<S = State> {
-        // A sequence of runs stored in ascending order. Since the graph is a
-        // DFA, these must be non-overlapping with one another.
-        runs: SmallVec<[Run<S>; 1]>,
-        // The edge labeled with the uninit byte, if any.
+        // A sequence of byte edges with contiguous byte values and a common
+        // destination is stored as a single run.
         //
-        // FIXME(@joshlf): Make `State` a `NonZero` so that this is NPO'd.
-        uninit: Option<S>,
+        // Runs are non-empty, non-overlapping, and stored in ascending order.
+        runs: SmallVec<[(Byte, S); 1]>,
     }
 
     impl<S> EdgeSet<S> {
-        pub(crate) fn new(byte: Byte, dst: S) -> Self {
-            match byte.range() {
-                Some(range) => Self { runs: smallvec![Run::new(range, dst)], uninit: None },
-                None => Self { runs: SmallVec::new(), uninit: Some(dst) },
+        pub(crate) fn new(range: Byte, dst: S) -> Self {
+            let mut this = Self { runs: SmallVec::new() };
+            if !range.is_empty() {
+                this.runs.push((range, dst));
             }
+            this
         }
 
         pub(crate) fn empty() -> Self {
-            Self { runs: SmallVec::new(), uninit: None }
+            Self { runs: SmallVec::new() }
         }
 
         #[cfg(test)]
@@ -431,43 +355,23 @@ pub(crate) fn from_edges(mut edges: Vec<(Byte, S)>) -> Self
             S: Ord,
         {
             edges.sort();
-            Self {
-                runs: edges
-                    .into_iter()
-                    .map(|(byte, state)| Run::new(byte.range().unwrap(), state))
-                    .collect(),
-                uninit: None,
-            }
+            Self { runs: edges.into() }
         }
 
         pub(crate) fn iter(&self) -> impl Iterator<Item = (Byte, S)>
         where
             S: Copy,
         {
-            self.uninit
-                .map(|dst| (Byte::uninit(), dst))
-                .into_iter()
-                .chain(self.runs.iter().map(|run| (run.as_byte(), run.dst)))
-        }
-
-        pub(crate) fn states_from(
-            &self,
-            byte: RangeInclusive<u8>,
-        ) -> impl Iterator<Item = (Byte, S)>
-        where
-            S: Copy,
-        {
-            // FIXME(@joshlf): Optimize this. A manual scan over `self.runs` may
-            // permit us to more efficiently discard runs which will not be
-            // produced by this iterator.
-            self.iter().filter(move |(o, _)| Byte::new(byte.clone()).transmutable_into(&o))
+            self.runs.iter().copied()
         }
 
         pub(crate) fn get_uninit_edge_dst(&self) -> Option<S>
         where
             S: Copy,
         {
-            self.uninit
+            // Uninit is ordered last.
+            let &(range, dst) = self.runs.last()?;
+            if range.contains_uninit() { Some(dst) } else { None }
         }
 
         pub(crate) fn map_states<SS>(self, mut f: impl FnMut(S) -> SS) -> EdgeSet<SS> {
@@ -478,95 +382,106 @@ pub(crate) fn map_states<SS>(self, mut f: impl FnMut(S) -> SS) -> EdgeSet<SS> {
                 // allocates the correct number of elements once up-front [1].
                 //
                 // [1] https://doc.rust-lang.org/1.85.0/src/alloc/vec/spec_from_iter_nested.rs.html#47
-                runs: self.runs.into_iter().map(|run| run.map_state(&mut f)).collect(),
-                uninit: self.uninit.map(f),
+                runs: self.runs.into_iter().map(|(b, s)| (b, f(s))).collect(),
             }
         }
 
         /// Unions two edge sets together.
         ///
         /// If `u = a.union(b)`, then for each byte value, `u` will have an edge
-        /// with that byte value and with the destination `(Some(_), None)`,
-        /// `(None, Some(_))`, or `(Some(_), Some(_))` depending on whether `a`,
+        /// with that byte value and with the destination `join(Some(_), None)`,
+        /// `join(None, Some(_))`, or `join(Some(_), Some(_))` depending on whether `a`,
         /// `b`, or both have an edge with that byte value.
         ///
         /// If neither `a` nor `b` have an edge with a particular byte value,
         /// then no edge with that value will be present in `u`.
-        pub(crate) fn union(&self, other: &Self) -> EdgeSet<(Option<S>, Option<S>)>
+        pub(crate) fn union(
+            &self,
+            other: &Self,
+            mut join: impl FnMut(Option<S>, Option<S>) -> S,
+        ) -> EdgeSet<S>
         where
             S: Copy,
         {
-            let uninit = match (self.uninit, other.uninit) {
-                (None, None) => None,
-                (s, o) => Some((s, o)),
-            };
-
-            let mut runs = SmallVec::new();
-
-            // Iterate over `self.runs` and `other.runs` simultaneously,
-            // advancing `idx` as we go. At each step, we advance `idx` as far
-            // as we can without crossing a run boundary in either `self.runs`
-            // or `other.runs`.
-
-            // INVARIANT: `idx < s[0].end && idx < o[0].end`.
-            let (mut s, mut o) = (self.runs.as_slice(), other.runs.as_slice());
-            let mut idx = 0u16;
-            while let (Some((s_run, s_rest)), Some((o_run, o_rest))) =
-                (s.split_first(), o.split_first())
-            {
-                let (s_start, s_end) = s_run.as_inclusive_exclusive();
-                let (o_start, o_end) = o_run.as_inclusive_exclusive();
-
-                // Compute `end` as the end of the current run (which starts
-                // with `idx`).
-                let (end, dst) = match (s_run.contains(idx), o_run.contains(idx)) {
-                    // `idx` is in an existing run in both `s` and `o`, so `end`
-                    // is equal to the smallest of the two ends of those runs.
-                    (true, true) => (cmp::min(s_end, o_end), (Some(s_run.dst), Some(o_run.dst))),
-                    // `idx` is in an existing run in `s`, but not in any run in
-                    // `o`. `end` is either the end of the `s` run or the
-                    // beginning of the next `o` run, whichever comes first.
-                    (true, false) => (cmp::min(s_end, o_start), (Some(s_run.dst), None)),
-                    // The inverse of the previous case.
-                    (false, true) => (cmp::min(s_start, o_end), (None, Some(o_run.dst))),
-                    // `idx` is not in a run in either `s` or `o`, so advance it
-                    // to the beginning of the next run.
-                    (false, false) => {
-                        idx = cmp::min(s_start, o_start);
-                        continue;
-                    }
-                };
-
-                // FIXME(@joshlf): If this is contiguous with the previous run
-                // and has the same `dst`, just merge it into that run rather
-                // than adding a new one.
-                runs.push(Run::from_inclusive_exclusive(idx..end, dst));
-                idx = end;
-
-                if idx >= s_end {
-                    s = s_rest;
-                }
-                if idx >= o_end {
-                    o = o_rest;
-                }
-            }
-
-            // At this point, either `s` or `o` have been exhausted, so the
-            // remaining elements in the other slice are guaranteed to be
-            // non-overlapping. We can add all remaining runs to `runs` with no
-            // further processing.
-            if let Ok(idx) = u8::try_from(idx) {
-                let (slc, map) = if !s.is_empty() {
-                    let map: fn(_) -> _ = |st| (Some(st), None);
-                    (s, map)
-                } else {
-                    let map: fn(_) -> _ = |st| (None, Some(st));
-                    (o, map)
-                };
-                runs.extend(slc.iter().map(|run| run.clamp_lower(idx).map_state(map)));
-            }
-
-            EdgeSet { runs, uninit }
+            let xs = self.runs.iter().copied();
+            let ys = other.runs.iter().copied();
+            // FIXME(@joshlf): Merge contiguous runs with common destination.
+            EdgeSet { runs: union(xs, ys).map(|(range, (x, y))| (range, join(x, y))).collect() }
         }
     }
 }
+
+/// Merges two sorted sequences into one sorted sequence.
+pub(crate) fn union<S: Copy, X: Iterator<Item = (Byte, S)>, Y: Iterator<Item = (Byte, S)>>(
+    xs: X,
+    ys: Y,
+) -> UnionIter<X, Y> {
+    UnionIter { xs: xs.peekable(), ys: ys.peekable() }
+}
+
+pub(crate) struct UnionIter<X: Iterator, Y: Iterator> {
+    xs: Peekable<X>,
+    ys: Peekable<Y>,
+}
+
+// FIXME(jswrenn) we'd likely benefit from specializing try_fold here.
+impl<S: Copy, X: Iterator<Item = (Byte, S)>, Y: Iterator<Item = (Byte, S)>> Iterator
+    for UnionIter<X, Y>
+{
+    type Item = (Byte, (Option<S>, Option<S>));
+
+    fn next(&mut self) -> Option<Self::Item> {
+        use std::cmp::{self, Ordering};
+
+        let ret;
+        match (self.xs.peek_mut(), self.ys.peek_mut()) {
+            (None, None) => {
+                ret = None;
+            }
+            (Some(x), None) => {
+                ret = Some((x.0, (Some(x.1), None)));
+                self.xs.next();
+            }
+            (None, Some(y)) => {
+                ret = Some((y.0, (None, Some(y.1))));
+                self.ys.next();
+            }
+            (Some(x), Some(y)) => {
+                let start;
+                let end;
+                let dst;
+                match x.0.start.cmp(&y.0.start) {
+                    Ordering::Less => {
+                        start = x.0.start;
+                        end = cmp::min(x.0.end, y.0.start);
+                        dst = (Some(x.1), None);
+                    }
+                    Ordering::Greater => {
+                        start = y.0.start;
+                        end = cmp::min(x.0.start, y.0.end);
+                        dst = (None, Some(y.1));
+                    }
+                    Ordering::Equal => {
+                        start = x.0.start;
+                        end = cmp::min(x.0.end, y.0.end);
+                        dst = (Some(x.1), Some(y.1));
+                    }
+                }
+                ret = Some((Byte { start, end }, dst));
+                if start == x.0.start {
+                    x.0.start = end;
+                }
+                if start == y.0.start {
+                    y.0.start = end;
+                }
+                if x.0.is_empty() {
+                    self.xs.next();
+                }
+                if y.0.is_empty() {
+                    self.ys.next();
+                }
+            }
+        }
+        ret
+    }
+}
diff --git a/compiler/rustc_transmute/src/layout/mod.rs b/compiler/rustc_transmute/src/layout/mod.rs
index 4d5f630..c08bf44 100644
--- a/compiler/rustc_transmute/src/layout/mod.rs
+++ b/compiler/rustc_transmute/src/layout/mod.rs
@@ -6,61 +6,61 @@
 pub(crate) use tree::Tree;
 
 pub(crate) mod dfa;
-pub(crate) use dfa::Dfa;
+pub(crate) use dfa::{Dfa, union};
 
 #[derive(Debug)]
 pub(crate) struct Uninhabited;
 
-/// A range of byte values, or the uninit byte.
+/// A range of byte values (including an uninit byte value).
 #[derive(Hash, Eq, PartialEq, Ord, PartialOrd, Clone, Copy)]
 pub(crate) struct Byte {
-    // An inclusive-inclusive range. We use this instead of `RangeInclusive`
-    // because `RangeInclusive: !Copy`.
+    // An inclusive-exclusive range. We use this instead of `Range` because `Range: !Copy`.
     //
-    // `None` means uninit.
-    //
-    // FIXME(@joshlf): Optimize this representation. Some pairs of values (where
-    // `lo > hi`) are illegal, and we could use these to represent `None`.
-    range: Option<(u8, u8)>,
+    // Uninit byte value is represented by 256.
+    pub(crate) start: u16,
+    pub(crate) end: u16,
 }
 
 impl Byte {
+    const UNINIT: u16 = 256;
+
+    #[inline]
     fn new(range: RangeInclusive<u8>) -> Self {
-        Self { range: Some((*range.start(), *range.end())) }
+        let start: u16 = (*range.start()).into();
+        let end: u16 = (*range.end()).into();
+        Byte { start, end: end + 1 }
     }
 
+    #[inline]
     fn from_val(val: u8) -> Self {
-        Self { range: Some((val, val)) }
+        let val: u16 = val.into();
+        Byte { start: val, end: val + 1 }
     }
 
-    pub(crate) fn uninit() -> Byte {
-        Byte { range: None }
+    #[inline]
+    fn uninit() -> Byte {
+        Byte { start: 0, end: Self::UNINIT + 1 }
     }
 
-    /// Returns `None` if `self` is the uninit byte.
-    pub(crate) fn range(&self) -> Option<RangeInclusive<u8>> {
-        self.range.map(|(lo, hi)| lo..=hi)
+    #[inline]
+    fn is_empty(&self) -> bool {
+        self.start == self.end
     }
 
-    /// Are any of the values in `self` transmutable into `other`?
-    ///
-    /// Note two special cases: An uninit byte is only transmutable into another
-    /// uninit byte. Any byte is transmutable into an uninit byte.
-    pub(crate) fn transmutable_into(&self, other: &Byte) -> bool {
-        match (self.range, other.range) {
-            (None, None) => true,
-            (None, Some(_)) => false,
-            (Some(_), None) => true,
-            (Some((slo, shi)), Some((olo, ohi))) => slo <= ohi && olo <= shi,
-        }
+    #[inline]
+    fn contains_uninit(&self) -> bool {
+        self.start <= Self::UNINIT && Self::UNINIT < self.end
     }
 }
 
 impl fmt::Debug for Byte {
     fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
-        match self.range {
-            None => write!(f, "uninit"),
-            Some((lo, hi)) => write!(f, "{lo}..={hi}"),
+        if self.start == Self::UNINIT && self.end == Self::UNINIT + 1 {
+            write!(f, "uninit")
+        } else if self.start <= Self::UNINIT && self.end == Self::UNINIT + 1 {
+            write!(f, "{}..{}|uninit", self.start, self.end - 1)
+        } else {
+            write!(f, "{}..{}", self.start, self.end)
         }
     }
 }
@@ -72,6 +72,7 @@ fn from(src: RangeInclusive<u8>) -> Self {
 }
 
 impl From<u8> for Byte {
+    #[inline]
     fn from(src: u8) -> Self {
         Self::from_val(src)
     }
diff --git a/compiler/rustc_transmute/src/maybe_transmutable/mod.rs b/compiler/rustc_transmute/src/maybe_transmutable/mod.rs
index 0a19ccc..f76abe5 100644
--- a/compiler/rustc_transmute/src/maybe_transmutable/mod.rs
+++ b/compiler/rustc_transmute/src/maybe_transmutable/mod.rs
@@ -1,14 +1,11 @@
-use std::rc::Rc;
-use std::{cmp, iter};
-
-use itertools::Either;
+use rustc_data_structures::stack::ensure_sufficient_stack;
 use tracing::{debug, instrument, trace};
 
 pub(crate) mod query_context;
 #[cfg(test)]
 mod tests;
 
-use crate::layout::{self, Byte, Def, Dfa, Ref, Tree, dfa};
+use crate::layout::{self, Def, Dfa, Ref, Tree, dfa, union};
 use crate::maybe_transmutable::query_context::QueryContext;
 use crate::{Answer, Condition, Map, Reason};
 
@@ -153,232 +150,137 @@ fn answer_memo(
         if let Some(answer) = cache.get(&(src_state, dst_state)) {
             answer.clone()
         } else {
-            debug!(?src_state, ?dst_state);
-            debug!(src = ?self.src);
-            debug!(dst = ?self.dst);
-            debug!(
-                src_transitions_len = self.src.transitions.len(),
-                dst_transitions_len = self.dst.transitions.len()
-            );
-            let answer = if dst_state == self.dst.accept {
-                // truncation: `size_of(Src) >= size_of(Dst)`
-                //
-                // Why is truncation OK to do? Because even though the Src is bigger, all we care about
-                // is whether we have enough data for the Dst to be valid in accordance with what its
-                // type dictates.
-                // For example, in a u8 to `()` transmutation, we have enough data available from the u8
-                // to transmute it to a `()` (though in this case does `()` really need any data to
-                // begin with? It doesn't). Same thing with u8 to fieldless struct.
-                // Now then, why is something like u8 to bool not allowed? That is not because the bool
-                // is smaller in size, but rather because those 2 bits that we are re-interpreting from
-                // the u8 could introduce invalid states for the bool type.
-                //
-                // So, if it's possible to transmute to a smaller Dst by truncating, and we can guarantee
-                // that none of the actually-used data can introduce an invalid state for Dst's type, we
-                // are able to safely transmute, even with truncation.
-                Answer::Yes
-            } else if src_state == self.src.accept {
-                // extension: `size_of(Src) <= size_of(Dst)`
-                if let Some(dst_state_prime) = self.dst.get_uninit_edge_dst(dst_state) {
-                    self.answer_memo(cache, src_state, dst_state_prime)
-                } else {
-                    Answer::No(Reason::DstIsTooBig)
-                }
-            } else {
-                let src_quantifier = if self.assume.validity {
-                    // if the compiler may assume that the programmer is doing additional validity checks,
-                    // (e.g.: that `src != 3u8` when the destination type is `bool`)
-                    // then there must exist at least one transition out of `src_state` such that the transmute is viable...
-                    Quantifier::ThereExists
-                } else {
-                    // if the compiler cannot assume that the programmer is doing additional validity checks,
-                    // then for all transitions out of `src_state`, such that the transmute is viable...
-                    // then there must exist at least one transition out of `dst_state` such that the transmute is viable...
-                    Quantifier::ForAll
-                };
-
-                let c = &core::cell::RefCell::new(&mut *cache);
-                let bytes_answer = src_quantifier.apply(
-                    // for each of the byte set transitions out of the `src_state`...
-                    self.src.bytes_from(src_state).flat_map(
-                        move |(src_validity, src_state_prime)| {
-                            // ...find all matching transitions out of `dst_state`.
-
-                            let Some(src_validity) = src_validity.range() else {
-                                // NOTE: We construct an iterator here rather
-                                // than just computing the value directly (via
-                                // `self.answer_memo`) so that, if the iterator
-                                // we produce from this branch is
-                                // short-circuited, we don't waste time
-                                // computing `self.answer_memo` unnecessarily.
-                                // That will specifically happen if
-                                // `src_quantifier == Quantifier::ThereExists`,
-                                // since we emit `Answer::Yes` first (before
-                                // chaining `answer_iter`).
-                                let answer_iter = if let Some(dst_state_prime) =
-                                    self.dst.get_uninit_edge_dst(dst_state)
-                                {
-                                    Either::Left(iter::once_with(move || {
-                                        let mut c = c.borrow_mut();
-                                        self.answer_memo(&mut *c, src_state_prime, dst_state_prime)
-                                    }))
-                                } else {
-                                    Either::Right(iter::once(Answer::No(
-                                        Reason::DstIsBitIncompatible,
-                                    )))
-                                };
-
-                                // When `answer == Answer::No(...)`, there are
-                                // two cases to consider:
-                                // - If `assume.validity`, then we should
-                                //   succeed because the user is responsible for
-                                //   ensuring that the *specific* byte value
-                                //   appearing at runtime is valid for the
-                                //   destination type. When `assume.validity`,
-                                //   `src_quantifier ==
-                                //   Quantifier::ThereExists`, so adding an
-                                //   `Answer::Yes` has the effect of ensuring
-                                //   that the "there exists" is always
-                                //   satisfied.
-                                // - If `!assume.validity`, then we should fail.
-                                //   In this case, `src_quantifier ==
-                                //   Quantifier::ForAll`, so adding an
-                                //   `Answer::Yes` has no effect.
-                                return Either::Left(iter::once(Answer::Yes).chain(answer_iter));
-                            };
-
-                            #[derive(Copy, Clone, Debug)]
-                            struct Accum {
-                                // The number of matching byte edges that we
-                                // have found in the destination so far.
-                                sum: usize,
-                                found_uninit: bool,
-                            }
-
-                            let accum1 = Rc::new(std::cell::Cell::new(Accum {
-                                sum: 0,
-                                found_uninit: false,
-                            }));
-                            let accum2 = Rc::clone(&accum1);
-                            let sv = src_validity.clone();
-                            let update_accum = move |mut accum: Accum, dst_validity: Byte| {
-                                if let Some(dst_validity) = dst_validity.range() {
-                                    // Only add the part of `dst_validity` that
-                                    // overlaps with `src_validity`.
-                                    let start = cmp::max(*sv.start(), *dst_validity.start());
-                                    let end = cmp::min(*sv.end(), *dst_validity.end());
-
-                                    // We add 1 here to account for the fact
-                                    // that `end` is an inclusive bound.
-                                    accum.sum += 1 + usize::from(end.saturating_sub(start));
-                                } else {
-                                    accum.found_uninit = true;
-                                }
-                                accum
-                            };
-
-                            let answers = self
-                                .dst
-                                .states_from(dst_state, src_validity.clone())
-                                .map(move |(dst_validity, dst_state_prime)| {
-                                    let mut c = c.borrow_mut();
-                                    accum1.set(update_accum(accum1.get(), dst_validity));
-                                    let answer =
-                                        self.answer_memo(&mut *c, src_state_prime, dst_state_prime);
-                                    answer
-                                })
-                                .chain(
-                                    iter::once_with(move || {
-                                        let src_validity_len = usize::from(*src_validity.end())
-                                            - usize::from(*src_validity.start())
-                                            + 1;
-                                        let accum = accum2.get();
-
-                                        // If this condition is false, then
-                                        // there are some byte values in the
-                                        // source which have no corresponding
-                                        // transition in the destination DFA. In
-                                        // that case, we add a `No` to our list
-                                        // of answers. When
-                                        // `!self.assume.validity`, this will
-                                        // cause the query to fail.
-                                        if accum.found_uninit || accum.sum == src_validity_len {
-                                            None
-                                        } else {
-                                            Some(Answer::No(Reason::DstIsBitIncompatible))
-                                        }
-                                    })
-                                    .flatten(),
-                                );
-                            Either::Right(answers)
-                        },
-                    ),
-                );
-
-                // The below early returns reflect how this code would behave:
-                //   if self.assume.validity {
-                //       or(bytes_answer, refs_answer)
-                //   } else {
-                //       and(bytes_answer, refs_answer)
-                //   }
-                // ...if `refs_answer` was computed lazily. The below early
-                // returns can be deleted without impacting the correctness of
-                // the algorithm; only its performance.
-                debug!(?bytes_answer);
-                match bytes_answer {
-                    Answer::No(_) if !self.assume.validity => return bytes_answer,
-                    Answer::Yes if self.assume.validity => return bytes_answer,
-                    _ => {}
-                };
-
-                let refs_answer = src_quantifier.apply(
-                    // for each reference transition out of `src_state`...
-                    self.src.refs_from(src_state).map(|(src_ref, src_state_prime)| {
-                        // ...there exists a reference transition out of `dst_state`...
-                        Quantifier::ThereExists.apply(self.dst.refs_from(dst_state).map(
-                            |(dst_ref, dst_state_prime)| {
-                                if !src_ref.is_mutable() && dst_ref.is_mutable() {
-                                    Answer::No(Reason::DstIsMoreUnique)
-                                } else if !self.assume.alignment
-                                    && src_ref.min_align() < dst_ref.min_align()
-                                {
-                                    Answer::No(Reason::DstHasStricterAlignment {
-                                        src_min_align: src_ref.min_align(),
-                                        dst_min_align: dst_ref.min_align(),
-                                    })
-                                } else if dst_ref.size() > src_ref.size() {
-                                    Answer::No(Reason::DstRefIsTooBig {
-                                        src: src_ref,
-                                        dst: dst_ref,
-                                    })
-                                } else {
-                                    // ...such that `src` is transmutable into `dst`, if
-                                    // `src_ref` is transmutability into `dst_ref`.
-                                    and(
-                                        Answer::If(Condition::IfTransmutable {
-                                            src: src_ref,
-                                            dst: dst_ref,
-                                        }),
-                                        self.answer_memo(cache, src_state_prime, dst_state_prime),
-                                    )
-                                }
-                            },
-                        ))
-                    }),
-                );
-
-                if self.assume.validity {
-                    or(bytes_answer, refs_answer)
-                } else {
-                    and(bytes_answer, refs_answer)
-                }
-            };
+            let answer = ensure_sufficient_stack(|| self.answer_impl(cache, src_state, dst_state));
             if let Some(..) = cache.insert((src_state, dst_state), answer.clone()) {
                 panic!("failed to correctly cache transmutability")
             }
             answer
         }
     }
+
+    fn answer_impl(
+        &self,
+        cache: &mut Map<(dfa::State, dfa::State), Answer<<C as QueryContext>::Ref>>,
+        src_state: dfa::State,
+        dst_state: dfa::State,
+    ) -> Answer<<C as QueryContext>::Ref> {
+        debug!(?src_state, ?dst_state);
+        debug!(src = ?self.src);
+        debug!(dst = ?self.dst);
+        debug!(
+            src_transitions_len = self.src.transitions.len(),
+            dst_transitions_len = self.dst.transitions.len()
+        );
+        if dst_state == self.dst.accept {
+            // truncation: `size_of(Src) >= size_of(Dst)`
+            //
+            // Why is truncation OK to do? Because even though the Src is bigger, all we care about
+            // is whether we have enough data for the Dst to be valid in accordance with what its
+            // type dictates.
+            // For example, in a u8 to `()` transmutation, we have enough data available from the u8
+            // to transmute it to a `()` (though in this case does `()` really need any data to
+            // begin with? It doesn't). Same thing with u8 to fieldless struct.
+            // Now then, why is something like u8 to bool not allowed? That is not because the bool
+            // is smaller in size, but rather because those 2 bits that we are re-interpreting from
+            // the u8 could introduce invalid states for the bool type.
+            //
+            // So, if it's possible to transmute to a smaller Dst by truncating, and we can guarantee
+            // that none of the actually-used data can introduce an invalid state for Dst's type, we
+            // are able to safely transmute, even with truncation.
+            Answer::Yes
+        } else if src_state == self.src.accept {
+            // extension: `size_of(Src) <= size_of(Dst)`
+            if let Some(dst_state_prime) = self.dst.get_uninit_edge_dst(dst_state) {
+                self.answer_memo(cache, src_state, dst_state_prime)
+            } else {
+                Answer::No(Reason::DstIsTooBig)
+            }
+        } else {
+            let src_quantifier = if self.assume.validity {
+                // if the compiler may assume that the programmer is doing additional validity checks,
+                // (e.g.: that `src != 3u8` when the destination type is `bool`)
+                // then there must exist at least one transition out of `src_state` such that the transmute is viable...
+                Quantifier::ThereExists
+            } else {
+                // if the compiler cannot assume that the programmer is doing additional validity checks,
+                // then for all transitions out of `src_state`, such that the transmute is viable...
+                // then there must exist at least one transition out of `dst_state` such that the transmute is viable...
+                Quantifier::ForAll
+            };
+
+            let bytes_answer = src_quantifier.apply(
+                union(self.src.bytes_from(src_state), self.dst.bytes_from(dst_state)).filter_map(
+                    |(_range, (src_state_prime, dst_state_prime))| {
+                        match (src_state_prime, dst_state_prime) {
+                            // No matching transitions in `src`. Skip.
+                            (None, _) => None,
+                            // No matching transitions in `dst`. Fail.
+                            (Some(_), None) => Some(Answer::No(Reason::DstIsBitIncompatible)),
+                            // Matching transitions. Continue with successor states.
+                            (Some(src_state_prime), Some(dst_state_prime)) => {
+                                Some(self.answer_memo(cache, src_state_prime, dst_state_prime))
+                            }
+                        }
+                    },
+                ),
+            );
+
+            // The below early returns reflect how this code would behave:
+            //   if self.assume.validity {
+            //       or(bytes_answer, refs_answer)
+            //   } else {
+            //       and(bytes_answer, refs_answer)
+            //   }
+            // ...if `refs_answer` was computed lazily. The below early
+            // returns can be deleted without impacting the correctness of
+            // the algorithm; only its performance.
+            debug!(?bytes_answer);
+            match bytes_answer {
+                Answer::No(_) if !self.assume.validity => return bytes_answer,
+                Answer::Yes if self.assume.validity => return bytes_answer,
+                _ => {}
+            };
+
+            let refs_answer = src_quantifier.apply(
+                // for each reference transition out of `src_state`...
+                self.src.refs_from(src_state).map(|(src_ref, src_state_prime)| {
+                    // ...there exists a reference transition out of `dst_state`...
+                    Quantifier::ThereExists.apply(self.dst.refs_from(dst_state).map(
+                        |(dst_ref, dst_state_prime)| {
+                            if !src_ref.is_mutable() && dst_ref.is_mutable() {
+                                Answer::No(Reason::DstIsMoreUnique)
+                            } else if !self.assume.alignment
+                                && src_ref.min_align() < dst_ref.min_align()
+                            {
+                                Answer::No(Reason::DstHasStricterAlignment {
+                                    src_min_align: src_ref.min_align(),
+                                    dst_min_align: dst_ref.min_align(),
+                                })
+                            } else if dst_ref.size() > src_ref.size() {
+                                Answer::No(Reason::DstRefIsTooBig { src: src_ref, dst: dst_ref })
+                            } else {
+                                // ...such that `src` is transmutable into `dst`, if
+                                // `src_ref` is transmutability into `dst_ref`.
+                                and(
+                                    Answer::If(Condition::IfTransmutable {
+                                        src: src_ref,
+                                        dst: dst_ref,
+                                    }),
+                                    self.answer_memo(cache, src_state_prime, dst_state_prime),
+                                )
+                            }
+                        },
+                    ))
+                }),
+            );
+
+            if self.assume.validity {
+                or(bytes_answer, refs_answer)
+            } else {
+                and(bytes_answer, refs_answer)
+            }
+        }
+    }
 }
 
 fn and<R>(lhs: Answer<R>, rhs: Answer<R>) -> Answer<R>
diff --git a/compiler/rustc_transmute/src/maybe_transmutable/tests.rs b/compiler/rustc_transmute/src/maybe_transmutable/tests.rs
index 992fcb7..fbb4639 100644
--- a/compiler/rustc_transmute/src/maybe_transmutable/tests.rs
+++ b/compiler/rustc_transmute/src/maybe_transmutable/tests.rs
@@ -400,16 +400,23 @@ mod r#ref {
     fn should_permit_identity_transmutation() {
         type Tree = crate::layout::Tree<Def, [(); 1]>;
 
-        let layout = Tree::Seq(vec![Tree::byte(0x00), Tree::Ref([()])]);
+        for validity in [false, true] {
+            let layout = Tree::Seq(vec![Tree::byte(0x00), Tree::Ref([()])]);
 
-        let answer = crate::maybe_transmutable::MaybeTransmutableQuery::new(
-            layout.clone(),
-            layout,
-            Assume::default(),
-            UltraMinimal::default(),
-        )
-        .answer();
-        assert_eq!(answer, Answer::If(crate::Condition::IfTransmutable { src: [()], dst: [()] }));
+            let assume = Assume { validity, ..Assume::default() };
+
+            let answer = crate::maybe_transmutable::MaybeTransmutableQuery::new(
+                layout.clone(),
+                layout,
+                assume,
+                UltraMinimal::default(),
+            )
+            .answer();
+            assert_eq!(
+                answer,
+                Answer::If(crate::Condition::IfTransmutable { src: [()], dst: [()] })
+            );
+        }
     }
 }
 
diff --git a/compiler/rustc_type_ir/src/canonical.rs b/compiler/rustc_type_ir/src/canonical.rs
index 03d3194..67b67df 100644
--- a/compiler/rustc_type_ir/src/canonical.rs
+++ b/compiler/rustc_type_ir/src/canonical.rs
@@ -34,7 +34,6 @@ pub struct CanonicalQueryInput<I: Interner, V> {
 #[derive_where(Eq; I: Interner, V: Eq)]
 #[derive_where(Debug; I: Interner, V: fmt::Debug)]
 #[derive_where(Copy; I: Interner, V: Copy)]
-#[derive(TypeVisitable_Generic, TypeFoldable_Generic)]
 #[cfg_attr(
     feature = "nightly",
     derive(Encodable_NoContext, Decodable_NoContext, HashStable_NoContext)
@@ -147,7 +146,6 @@ pub fn expect_placeholder_index(self) -> usize {
 /// in the type-theory sense of the term -- i.e., a "meta" type system
 /// that analyzes type-like values.
 #[derive_where(Clone, Copy, Hash, PartialEq, Eq, Debug; I: Interner)]
-#[derive(TypeVisitable_Generic, TypeFoldable_Generic)]
 #[cfg_attr(
     feature = "nightly",
     derive(Decodable_NoContext, Encodable_NoContext, HashStable_NoContext)
diff --git a/library/core/src/fmt/rt.rs b/library/core/src/fmt/rt.rs
index adcfdd3..e409771 100644
--- a/library/core/src/fmt/rt.rs
+++ b/library/core/src/fmt/rt.rs
@@ -200,8 +200,15 @@ pub(super) const fn as_u16(&self) -> Option<u16> {
     /// let f = format_args!("{}", "a");
     /// println!("{f}");
     /// ```
+    ///
+    /// This function should _not_ be const, to make sure we don't accept
+    /// format_args!() and panic!() with arguments in const, even when not evaluated:
+    ///
+    /// ```compile_fail,E0015
+    /// const _: () = if false { panic!("a {}", "a") };
+    /// ```
     #[inline]
-    pub const fn none() -> [Self; 0] {
+    pub fn none() -> [Self; 0] {
         []
     }
 }
diff --git a/library/core/src/ptr/const_ptr.rs b/library/core/src/ptr/const_ptr.rs
index bcf3478..5234fb8 100644
--- a/library/core/src/ptr/const_ptr.rs
+++ b/library/core/src/ptr/const_ptr.rs
@@ -484,8 +484,9 @@ const fn runtime_offset_nowrap(this: *const (), count: isize, size: usize) -> bo
     ///
     /// This operation itself is always safe, but using the resulting pointer is not.
     ///
-    /// The resulting pointer "remembers" the [allocated object] that `self` points to; it must not
-    /// be used to read or write other allocated objects.
+    /// The resulting pointer "remembers" the [allocated object] that `self` points to
+    /// (this is called "[Provenance](ptr/index.html#provenance)").
+    /// The pointer must not be used to read or write other allocated objects.
     ///
     /// In other words, `let z = x.wrapping_offset((y as isize) - (x as isize))` does *not* make `z`
     /// the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still
diff --git a/library/core/src/ptr/mut_ptr.rs b/library/core/src/ptr/mut_ptr.rs
index 6d1a50d..31b8d3b 100644
--- a/library/core/src/ptr/mut_ptr.rs
+++ b/library/core/src/ptr/mut_ptr.rs
@@ -482,8 +482,9 @@ const fn runtime_offset_nowrap(this: *const (), count: isize, size: usize) -> bo
     ///
     /// This operation itself is always safe, but using the resulting pointer is not.
     ///
-    /// The resulting pointer "remembers" the [allocated object] that `self` points to; it must not
-    /// be used to read or write other allocated objects.
+    /// The resulting pointer "remembers" the [allocated object] that `self` points to
+    /// (this is called "[Provenance](ptr/index.html#provenance)").
+    /// The pointer must not be used to read or write other allocated objects.
     ///
     /// In other words, `let z = x.wrapping_offset((y as isize) - (x as isize))` does *not* make `z`
     /// the same as `y` even if we assume `T` has size `1` and there is no overflow: `z` is still
diff --git a/library/test/src/test_result.rs b/library/test/src/test_result.rs
index a312894..4cb43fc 100644
--- a/library/test/src/test_result.rs
+++ b/library/test/src/test_result.rs
@@ -61,16 +61,15 @@ pub(crate) fn calc_result(
             } else if let Some(panic_str) = maybe_panic_str {
                 TestResult::TrFailedMsg(format!(
                     r#"panic did not contain expected string
-      panic message: `{panic_str:?}`,
- expected substring: `{msg:?}`"#
+      panic message: {panic_str:?}
+ expected substring: {msg:?}"#
                 ))
             } else {
                 TestResult::TrFailedMsg(format!(
                     r#"expected panic with string value,
  found non-string value: `{:?}`
-     expected substring: `{:?}`"#,
-                    (*err).type_id(),
-                    msg
+     expected substring: {msg:?}"#,
+                    (*err).type_id()
                 ))
             }
         }
diff --git a/library/test/src/tests.rs b/library/test/src/tests.rs
index 47f581f..d986bd7 100644
--- a/library/test/src/tests.rs
+++ b/library/test/src/tests.rs
@@ -200,8 +200,8 @@ fn f() -> Result<(), String> {
     }
     let expected = "foobar";
     let failed_msg = r#"panic did not contain expected string
-      panic message: `"an error message"`,
- expected substring: `"foobar"`"#;
+      panic message: "an error message"
+ expected substring: "foobar""#;
     let desc = TestDescAndFn {
         desc: TestDesc {
             name: StaticTestName("whatever"),
@@ -238,7 +238,7 @@ fn f() -> Result<(), String> {
     let failed_msg = format!(
         r#"expected panic with string value,
  found non-string value: `{:?}`
-     expected substring: `"foobar"`"#,
+     expected substring: "foobar""#,
         TypeId::of::<i32>()
     );
     let desc = TestDescAndFn {
diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs
index e4503b2..36b3c95 100644
--- a/src/bootstrap/src/core/builder/cargo.rs
+++ b/src/bootstrap/src/core/builder/cargo.rs
@@ -872,11 +872,15 @@ fn cargo(
         }
         cargo.env(
             profile_var("DEBUG_ASSERTIONS"),
-            if mode == Mode::Std {
-                self.config.std_debug_assertions.to_string()
-            } else {
-                self.config.rustc_debug_assertions.to_string()
-            },
+            match mode {
+                Mode::Std => self.config.std_debug_assertions,
+                Mode::Rustc => self.config.rustc_debug_assertions,
+                Mode::Codegen => self.config.rustc_debug_assertions,
+                Mode::ToolBootstrap => self.config.tools_debug_assertions,
+                Mode::ToolStd => self.config.tools_debug_assertions,
+                Mode::ToolRustc => self.config.tools_debug_assertions,
+            }
+            .to_string(),
         );
         cargo.env(
             profile_var("OVERFLOW_CHECKS"),
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index 23b623d..65a3e76 100644
--- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/src/core/config/config.rs
@@ -306,6 +306,7 @@ pub struct Config {
 
     pub rustc_debug_assertions: bool,
     pub std_debug_assertions: bool,
+    pub tools_debug_assertions: bool,
 
     pub rust_overflow_checks: bool,
     pub rust_overflow_checks_std: bool,
@@ -1280,6 +1281,7 @@ struct Rust {
         rustc_debug_assertions: Option<bool> = "debug-assertions",
         randomize_layout: Option<bool> = "randomize-layout",
         std_debug_assertions: Option<bool> = "debug-assertions-std",
+        tools_debug_assertions: Option<bool> = "debug-assertions-tools",
         overflow_checks: Option<bool> = "overflow-checks",
         overflow_checks_std: Option<bool> = "overflow-checks-std",
         debug_logging: Option<bool> = "debug-logging",
@@ -1937,6 +1939,7 @@ fn get_table(option: &str) -> Result<TomlConfig, toml::de::Error> {
         let mut debug = None;
         let mut rustc_debug_assertions = None;
         let mut std_debug_assertions = None;
+        let mut tools_debug_assertions = None;
         let mut overflow_checks = None;
         let mut overflow_checks_std = None;
         let mut debug_logging = None;
@@ -2000,6 +2003,7 @@ fn get_table(option: &str) -> Result<TomlConfig, toml::de::Error> {
                 codegen_units_std,
                 rustc_debug_assertions: rustc_debug_assertions_toml,
                 std_debug_assertions: std_debug_assertions_toml,
+                tools_debug_assertions: tools_debug_assertions_toml,
                 overflow_checks: overflow_checks_toml,
                 overflow_checks_std: overflow_checks_std_toml,
                 debug_logging: debug_logging_toml,
@@ -2084,6 +2088,7 @@ fn get_table(option: &str) -> Result<TomlConfig, toml::de::Error> {
             debug = debug_toml;
             rustc_debug_assertions = rustc_debug_assertions_toml;
             std_debug_assertions = std_debug_assertions_toml;
+            tools_debug_assertions = tools_debug_assertions_toml;
             overflow_checks = overflow_checks_toml;
             overflow_checks_std = overflow_checks_std_toml;
             debug_logging = debug_logging_toml;
@@ -2509,6 +2514,8 @@ fn get_table(option: &str) -> Result<TomlConfig, toml::de::Error> {
         let default = debug == Some(true);
         config.rustc_debug_assertions = rustc_debug_assertions.unwrap_or(default);
         config.std_debug_assertions = std_debug_assertions.unwrap_or(config.rustc_debug_assertions);
+        config.tools_debug_assertions =
+            tools_debug_assertions.unwrap_or(config.rustc_debug_assertions);
         config.rust_overflow_checks = overflow_checks.unwrap_or(default);
         config.rust_overflow_checks_std =
             overflow_checks_std.unwrap_or(config.rust_overflow_checks);
@@ -3568,6 +3575,7 @@ macro_rules! warn {
         codegen_units_std: _,
         rustc_debug_assertions: _,
         std_debug_assertions: _,
+        tools_debug_assertions: _,
         overflow_checks: _,
         overflow_checks_std: _,
         debuginfo_level: _,
diff --git a/src/bootstrap/src/utils/change_tracker.rs b/src/bootstrap/src/utils/change_tracker.rs
index 3f1885a..d926185 100644
--- a/src/bootstrap/src/utils/change_tracker.rs
+++ b/src/bootstrap/src/utils/change_tracker.rs
@@ -401,4 +401,9 @@ pub fn human_readable_changes(changes: &[ChangeInfo]) -> String {
         severity: ChangeSeverity::Info,
         summary: "Added new option `include` to create config extensions.",
     },
+    ChangeInfo {
+        change_id: 140438,
+        severity: ChangeSeverity::Info,
+        summary: "Added a new option `rust.debug-assertions-tools` to control debug asssertions for tools.",
+    },
 ];
diff --git a/src/doc/rustc-dev-guide/src/tests/ui.md b/src/doc/rustc-dev-guide/src/tests/ui.md
index 6232c8b..b31c861 100644
--- a/src/doc/rustc-dev-guide/src/tests/ui.md
+++ b/src/doc/rustc-dev-guide/src/tests/ui.md
@@ -372,9 +372,9 @@
 Avoid using this directive for `ERROR`s and `WARN`ings, unless there's a serious reason, like
 target-dependent compiler output.
 
-Missing diagnostic kinds (`//~ message`) are currently accepted, but are being phased away.
-They will match any compiler output kind, but will not force exhaustive annotations for that kind.
-Prefer explicit kind and `//@ dont-require-annotations` to achieve the same effect.
+Some diagnostics are never required to be line-annotated, regardless of their kind or directives,
+for example secondary lines of multiline diagnostics,
+or ubiquitous diagnostics like `aborting due to N previous errors`.
 
 UI tests use the `-A unused` flag by default to ignore all unused warnings, as
 unused warnings are usually not the focus of a test. However, simple code
diff --git a/src/tools/compiletest/src/errors.rs b/src/tools/compiletest/src/errors.rs
index 3bb9827..a45f39b0 100644
--- a/src/tools/compiletest/src/errors.rs
+++ b/src/tools/compiletest/src/errors.rs
@@ -30,24 +30,20 @@ pub fn from_compiler_str(s: &str) -> ErrorKind {
 
     /// Either the canonical uppercase string, or some additional versions for compatibility.
     /// FIXME: consider keeping only the canonical versions here.
-    fn from_user_str(s: &str) -> Option<ErrorKind> {
-        Some(match s {
+    pub fn from_user_str(s: &str) -> ErrorKind {
+        match s {
             "HELP" | "help" => ErrorKind::Help,
             "ERROR" | "error" => ErrorKind::Error,
-            "NOTE" | "note" => ErrorKind::Note,
+            // `MONO_ITEM` makes annotations in `codegen-units` tests syntactically correct,
+            // but those tests never use the error kind later on.
+            "NOTE" | "note" | "MONO_ITEM" => ErrorKind::Note,
             "SUGGESTION" => ErrorKind::Suggestion,
             "WARN" | "WARNING" | "warn" | "warning" => ErrorKind::Warning,
-            _ => return None,
-        })
-    }
-
-    pub fn expect_from_user_str(s: &str) -> ErrorKind {
-        ErrorKind::from_user_str(s).unwrap_or_else(|| {
-            panic!(
+            _ => panic!(
                 "unexpected diagnostic kind `{s}`, expected \
                  `ERROR`, `WARN`, `NOTE`, `HELP` or `SUGGESTION`"
-            )
-        })
+            ),
+        }
     }
 }
 
@@ -67,8 +63,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
 pub struct Error {
     pub line_num: Option<usize>,
     /// What kind of message we expect (e.g., warning, error, suggestion).
-    /// `None` if not specified or unknown message kind.
-    pub kind: Option<ErrorKind>,
+    pub kind: ErrorKind,
     pub msg: String,
     /// For some `Error`s, like secondary lines of multi-line diagnostics, line annotations
     /// are not mandatory, even if they would otherwise be mandatory for primary errors.
@@ -79,12 +74,7 @@ pub struct Error {
 impl Error {
     pub fn render_for_expected(&self) -> String {
         use colored::Colorize;
-        format!(
-            "{: <10}line {: >3}: {}",
-            self.kind.map(|kind| kind.to_string()).unwrap_or_default(),
-            self.line_num_str(),
-            self.msg.cyan(),
-        )
+        format!("{: <10}line {: >3}: {}", self.kind, self.line_num_str(), self.msg.cyan())
     }
 
     pub fn line_num_str(&self) -> String {
@@ -173,9 +163,10 @@ fn parse_expected(
     // Get the part of the comment after the sigil (e.g. `~^^` or ~|).
     let tag = captures.get(0).unwrap();
     let rest = line[tag.end()..].trim_start();
-    let (kind_str, _) = rest.split_once(|c: char| !c.is_ascii_alphabetic()).unwrap_or((rest, ""));
+    let (kind_str, _) =
+        rest.split_once(|c: char| c != '_' && !c.is_ascii_alphabetic()).unwrap_or((rest, ""));
     let kind = ErrorKind::from_user_str(kind_str);
-    let untrimmed_msg = if kind.is_some() { &rest[kind_str.len()..] } else { rest };
+    let untrimmed_msg = &rest[kind_str.len()..];
     let msg = untrimmed_msg.strip_prefix(':').unwrap_or(untrimmed_msg).trim().to_owned();
 
     let line_num_adjust = &captures["adjust"];
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index 2b203bb..8bee9ca 100644
--- a/src/tools/compiletest/src/header.rs
+++ b/src/tools/compiletest/src/header.rs
@@ -593,7 +593,7 @@ fn split_flags(flags: &str) -> Vec<String> {
                         config.parse_name_value_directive(ln, DONT_REQUIRE_ANNOTATIONS)
                     {
                         self.dont_require_annotations
-                            .insert(ErrorKind::expect_from_user_str(err_kind.trim()));
+                            .insert(ErrorKind::from_user_str(err_kind.trim()));
                     }
                 },
             );
diff --git a/src/tools/compiletest/src/json.rs b/src/tools/compiletest/src/json.rs
index 62fe538..960f5ba 100644
--- a/src/tools/compiletest/src/json.rs
+++ b/src/tools/compiletest/src/json.rs
@@ -229,7 +229,7 @@ fn push_actual_errors(
     // Convert multi-line messages into multiple errors.
     // We expect to replace these with something more structured anyhow.
     let mut message_lines = diagnostic.message.lines();
-    let kind = Some(ErrorKind::from_compiler_str(&diagnostic.level));
+    let kind = ErrorKind::from_compiler_str(&diagnostic.level);
     let first_line = message_lines.next().unwrap_or(&diagnostic.message);
     if primary_spans.is_empty() {
         static RE: OnceLock<Regex> = OnceLock::new();
@@ -278,7 +278,7 @@ fn push_actual_errors(
             for (index, line) in suggested_replacement.lines().enumerate() {
                 errors.push(Error {
                     line_num: Some(span.line_start + index),
-                    kind: Some(ErrorKind::Suggestion),
+                    kind: ErrorKind::Suggestion,
                     msg: line.to_string(),
                     require_annotation: true,
                 });
@@ -297,7 +297,7 @@ fn push_actual_errors(
     for span in spans_in_this_file.iter().filter(|span| span.label.is_some()) {
         errors.push(Error {
             line_num: Some(span.line_start),
-            kind: Some(ErrorKind::Note),
+            kind: ErrorKind::Note,
             msg: span.label.clone().unwrap(),
             require_annotation: true,
         });
@@ -317,7 +317,7 @@ fn push_backtrace(
     if Path::new(&expansion.span.file_name) == Path::new(&file_name) {
         errors.push(Error {
             line_num: Some(expansion.span.line_start),
-            kind: Some(ErrorKind::Note),
+            kind: ErrorKind::Note,
             msg: format!("in this expansion of {}", expansion.macro_decl_name),
             require_annotation: true,
         });
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index fe23cce..97cb82c 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -675,9 +675,7 @@ fn check_expected_errors(&self, expected_errors: Vec<Error>, proc_res: &ProcRes)
             "check_expected_errors: expected_errors={:?} proc_res.status={:?}",
             expected_errors, proc_res.status
         );
-        if proc_res.status.success()
-            && expected_errors.iter().any(|x| x.kind == Some(ErrorKind::Error))
-        {
+        if proc_res.status.success() && expected_errors.iter().any(|x| x.kind == ErrorKind::Error) {
             self.fatal_proc_rec("process did not return an error status", proc_res);
         }
 
@@ -709,7 +707,7 @@ fn check_expected_errors(&self, expected_errors: Vec<Error>, proc_res: &ProcRes)
         // if one of them actually occurs in the test.
         let expected_kinds: HashSet<_> = [ErrorKind::Error, ErrorKind::Warning]
             .into_iter()
-            .chain(expected_errors.iter().filter_map(|e| e.kind))
+            .chain(expected_errors.iter().map(|e| e.kind))
             .collect();
 
         // Parse the JSON output from the compiler and extract out the messages.
@@ -723,8 +721,7 @@ fn check_expected_errors(&self, expected_errors: Vec<Error>, proc_res: &ProcRes)
                 expected_errors.iter().enumerate().position(|(index, expected_error)| {
                     !found[index]
                         && actual_error.line_num == expected_error.line_num
-                        && (expected_error.kind.is_none()
-                            || actual_error.kind == expected_error.kind)
+                        && actual_error.kind == expected_error.kind
                         && actual_error.msg.contains(&expected_error.msg)
                 });
 
@@ -737,19 +734,14 @@ fn check_expected_errors(&self, expected_errors: Vec<Error>, proc_res: &ProcRes)
 
                 None => {
                     if actual_error.require_annotation
-                        && actual_error.kind.map_or(false, |kind| {
-                            expected_kinds.contains(&kind)
-                                && !self.props.dont_require_annotations.contains(&kind)
-                        })
+                        && expected_kinds.contains(&actual_error.kind)
+                        && !self.props.dont_require_annotations.contains(&actual_error.kind)
                     {
                         self.error(&format!(
                             "{}:{}: unexpected {}: '{}'",
                             file_name,
                             actual_error.line_num_str(),
-                            actual_error
-                                .kind
-                                .as_ref()
-                                .map_or(String::from("message"), |k| k.to_string()),
+                            actual_error.kind,
                             actual_error.msg
                         ));
                         unexpected.push(actual_error);
@@ -766,7 +758,7 @@ fn check_expected_errors(&self, expected_errors: Vec<Error>, proc_res: &ProcRes)
                     "{}:{}: expected {} not found: {}",
                     file_name,
                     expected_error.line_num_str(),
-                    expected_error.kind.as_ref().map_or("message".into(), |k| k.to_string()),
+                    expected_error.kind,
                     expected_error.msg
                 ));
                 not_found.push(expected_error);
diff --git a/src/tools/compiletest/src/runtest/ui.rs b/src/tools/compiletest/src/runtest/ui.rs
index e87b037..cf0ae14 100644
--- a/src/tools/compiletest/src/runtest/ui.rs
+++ b/src/tools/compiletest/src/runtest/ui.rs
@@ -6,8 +6,8 @@
 use tracing::debug;
 
 use super::{
-    AllowUnused, Emit, ErrorKind, FailMode, LinkToAux, PassMode, TargetLocation, TestCx,
-    TestOutput, Truncated, UI_FIXED, WillExecute,
+    AllowUnused, Emit, FailMode, LinkToAux, PassMode, TargetLocation, TestCx, TestOutput,
+    Truncated, UI_FIXED, WillExecute,
 };
 use crate::{errors, json};
 
@@ -176,7 +176,7 @@ pub(super) fn run_ui_test(&self) {
             let msg = format!(
                 "line {}: cannot combine `--error-format` with {} annotations; use `error-pattern` instead",
                 expected_errors[0].line_num_str(),
-                expected_errors[0].kind.unwrap_or(ErrorKind::Error),
+                expected_errors[0].kind,
             );
             self.fatal(&msg);
         }
diff --git a/src/tools/miri/src/intrinsics/mod.rs b/src/tools/miri/src/intrinsics/mod.rs
index 7d60a7e..3334c0b 100644
--- a/src/tools/miri/src/intrinsics/mod.rs
+++ b/src/tools/miri/src/intrinsics/mod.rs
@@ -7,13 +7,13 @@
 use rustc_abi::Size;
 use rustc_apfloat::{Float, Round};
 use rustc_middle::mir;
-use rustc_middle::ty::{self, FloatTy, ScalarInt};
+use rustc_middle::ty::{self, FloatTy};
 use rustc_span::{Symbol, sym};
 
 use self::atomic::EvalContextExt as _;
 use self::helpers::{ToHost, ToSoft, check_intrinsic_arg_count};
 use self::simd::EvalContextExt as _;
-use crate::math::apply_random_float_error_ulp;
+use crate::math::apply_random_float_error_to_imm;
 use crate::*;
 
 impl<'tcx> EvalContextExt<'tcx> for crate::MiriInterpCx<'tcx> {}
@@ -473,26 +473,3 @@ fn emulate_intrinsic_by_name(
         interp_ok(EmulateItemResult::NeedsReturn)
     }
 }
-
-/// Applies a random 16ULP floating point error to `val` and returns the new value.
-/// Will fail if `val` is not a floating point number.
-fn apply_random_float_error_to_imm<'tcx>(
-    ecx: &mut MiriInterpCx<'tcx>,
-    val: ImmTy<'tcx>,
-    ulp_exponent: u32,
-) -> InterpResult<'tcx, ImmTy<'tcx>> {
-    let scalar = val.to_scalar_int()?;
-    let res: ScalarInt = match val.layout.ty.kind() {
-        ty::Float(FloatTy::F16) =>
-            apply_random_float_error_ulp(ecx, scalar.to_f16(), ulp_exponent).into(),
-        ty::Float(FloatTy::F32) =>
-            apply_random_float_error_ulp(ecx, scalar.to_f32(), ulp_exponent).into(),
-        ty::Float(FloatTy::F64) =>
-            apply_random_float_error_ulp(ecx, scalar.to_f64(), ulp_exponent).into(),
-        ty::Float(FloatTy::F128) =>
-            apply_random_float_error_ulp(ecx, scalar.to_f128(), ulp_exponent).into(),
-        _ => bug!("intrinsic called with non-float input type"),
-    };
-
-    interp_ok(ImmTy::from_scalar_int(res, val.layout))
-}
diff --git a/src/tools/miri/src/machine.rs b/src/tools/miri/src/machine.rs
index c3d8413..55aa3d6 100644
--- a/src/tools/miri/src/machine.rs
+++ b/src/tools/miri/src/machine.rs
@@ -1199,6 +1199,16 @@ fn generate_nan<F1: Float + FloatConvert<F2>, F2: Float>(
     }
 
     #[inline(always)]
+    fn apply_float_nondet(
+        ecx: &mut InterpCx<'tcx, Self>,
+        val: ImmTy<'tcx>,
+    ) -> InterpResult<'tcx, ImmTy<'tcx>> {
+        crate::math::apply_random_float_error_to_imm(
+            ecx, val, 2 /* log2(4) */
+        )
+    }
+
+    #[inline(always)]
     fn equal_float_min_max<F: Float>(ecx: &MiriInterpCx<'tcx>, a: F, b: F) -> F {
         ecx.equal_float_min_max(a, b)
     }
diff --git a/src/tools/miri/src/math.rs b/src/tools/miri/src/math.rs
index fdd021f..2ff29c7 100644
--- a/src/tools/miri/src/math.rs
+++ b/src/tools/miri/src/math.rs
@@ -1,6 +1,9 @@
 use rand::Rng as _;
 use rustc_apfloat::Float as _;
 use rustc_apfloat::ieee::IeeeFloat;
+use rustc_middle::ty::{self, FloatTy, ScalarInt};
+
+use crate::*;
 
 /// Disturbes a floating-point result by a relative error in the range (-2^scale, 2^scale).
 ///
@@ -43,6 +46,29 @@ pub(crate) fn apply_random_float_error_ulp<F: rustc_apfloat::Float>(
     apply_random_float_error(ecx, val, err_scale)
 }
 
+/// Applies a random 16ULP floating point error to `val` and returns the new value.
+/// Will fail if `val` is not a floating point number.
+pub(crate) fn apply_random_float_error_to_imm<'tcx>(
+    ecx: &mut MiriInterpCx<'tcx>,
+    val: ImmTy<'tcx>,
+    ulp_exponent: u32,
+) -> InterpResult<'tcx, ImmTy<'tcx>> {
+    let scalar = val.to_scalar_int()?;
+    let res: ScalarInt = match val.layout.ty.kind() {
+        ty::Float(FloatTy::F16) =>
+            apply_random_float_error_ulp(ecx, scalar.to_f16(), ulp_exponent).into(),
+        ty::Float(FloatTy::F32) =>
+            apply_random_float_error_ulp(ecx, scalar.to_f32(), ulp_exponent).into(),
+        ty::Float(FloatTy::F64) =>
+            apply_random_float_error_ulp(ecx, scalar.to_f64(), ulp_exponent).into(),
+        ty::Float(FloatTy::F128) =>
+            apply_random_float_error_ulp(ecx, scalar.to_f128(), ulp_exponent).into(),
+        _ => bug!("intrinsic called with non-float input type"),
+    };
+
+    interp_ok(ImmTy::from_scalar_int(res, val.layout))
+}
+
 pub(crate) fn sqrt<S: rustc_apfloat::ieee::Semantics>(x: IeeeFloat<S>) -> IeeeFloat<S> {
     match x.category() {
         // preserve zero sign
diff --git a/src/tools/miri/tests/pass/float.rs b/src/tools/miri/tests/pass/float.rs
index 575d705..98a88cf 100644
--- a/src/tools/miri/tests/pass/float.rs
+++ b/src/tools/miri/tests/pass/float.rs
@@ -1292,8 +1292,7 @@ fn ensure_nondet<T: PartialEq + std::fmt::Debug>(f: impl Fn() -> T) {
             }
         }
         // We saw the same thing N times.
-        // FIXME: temporarily disabled as it breaks std tests.
-        //panic!("expected non-determinism, got {rounds} times the same result: {first:?}");
+        panic!("expected non-determinism, got {rounds} times the same result: {first:?}");
     }
 
     macro_rules! test_operations_f {
@@ -1319,66 +1318,68 @@ pub fn test_operations_f16(a: f16, b: f16) {
     }
     pub fn test_operations_f32(a: f32, b: f32) {
         test_operations_f!(a, b);
-        ensure_nondet(|| a.log(b));
-        ensure_nondet(|| a.exp());
-        ensure_nondet(|| 10f32.exp2());
-        ensure_nondet(|| f32::consts::E.ln());
-        ensure_nondet(|| 1f32.ln_1p());
-        ensure_nondet(|| 10f32.log10());
-        ensure_nondet(|| 8f32.log2());
-        ensure_nondet(|| 27.0f32.cbrt());
-        ensure_nondet(|| 3.0f32.hypot(4.0f32));
-        ensure_nondet(|| 1f32.sin());
-        ensure_nondet(|| 0f32.cos());
-        // On i686-pc-windows-msvc , these functions are implemented by calling the `f64` version,
-        // which means the little rounding errors Miri introduces are discard by the cast down to `f32`.
-        // Just skip the test for them.
-        if !cfg!(all(target_os = "windows", target_env = "msvc", target_arch = "x86")) {
-            ensure_nondet(|| 1.0f32.tan());
-            ensure_nondet(|| 1.0f32.asin());
-            ensure_nondet(|| 5.0f32.acos());
-            ensure_nondet(|| 1.0f32.atan());
-            ensure_nondet(|| 1.0f32.atan2(2.0f32));
-            ensure_nondet(|| 1.0f32.sinh());
-            ensure_nondet(|| 1.0f32.cosh());
-            ensure_nondet(|| 1.0f32.tanh());
-        }
-        ensure_nondet(|| 1.0f32.asinh());
-        ensure_nondet(|| 2.0f32.acosh());
-        ensure_nondet(|| 0.5f32.atanh());
-        ensure_nondet(|| 5.0f32.gamma());
-        ensure_nondet(|| 5.0f32.ln_gamma());
-        ensure_nondet(|| 5.0f32.erf());
-        ensure_nondet(|| 5.0f32.erfc());
+        // FIXME: temporarily disabled as it breaks std tests.
+        // ensure_nondet(|| a.log(b));
+        // ensure_nondet(|| a.exp());
+        // ensure_nondet(|| 10f32.exp2());
+        // ensure_nondet(|| f32::consts::E.ln());
+        // ensure_nondet(|| 1f32.ln_1p());
+        // ensure_nondet(|| 10f32.log10());
+        // ensure_nondet(|| 8f32.log2());
+        // ensure_nondet(|| 27.0f32.cbrt());
+        // ensure_nondet(|| 3.0f32.hypot(4.0f32));
+        // ensure_nondet(|| 1f32.sin());
+        // ensure_nondet(|| 0f32.cos());
+        // // On i686-pc-windows-msvc , these functions are implemented by calling the `f64` version,
+        // // which means the little rounding errors Miri introduces are discard by the cast down to `f32`.
+        // // Just skip the test for them.
+        // if !cfg!(all(target_os = "windows", target_env = "msvc", target_arch = "x86")) {
+        //     ensure_nondet(|| 1.0f32.tan());
+        //     ensure_nondet(|| 1.0f32.asin());
+        //     ensure_nondet(|| 5.0f32.acos());
+        //     ensure_nondet(|| 1.0f32.atan());
+        //     ensure_nondet(|| 1.0f32.atan2(2.0f32));
+        //     ensure_nondet(|| 1.0f32.sinh());
+        //     ensure_nondet(|| 1.0f32.cosh());
+        //     ensure_nondet(|| 1.0f32.tanh());
+        // }
+        // ensure_nondet(|| 1.0f32.asinh());
+        // ensure_nondet(|| 2.0f32.acosh());
+        // ensure_nondet(|| 0.5f32.atanh());
+        // ensure_nondet(|| 5.0f32.gamma());
+        // ensure_nondet(|| 5.0f32.ln_gamma());
+        // ensure_nondet(|| 5.0f32.erf());
+        // ensure_nondet(|| 5.0f32.erfc());
     }
     pub fn test_operations_f64(a: f64, b: f64) {
         test_operations_f!(a, b);
-        ensure_nondet(|| a.log(b));
-        ensure_nondet(|| a.exp());
-        ensure_nondet(|| 50f64.exp2());
-        ensure_nondet(|| 3f64.ln());
-        ensure_nondet(|| 1f64.ln_1p());
-        ensure_nondet(|| f64::consts::E.log10());
-        ensure_nondet(|| f64::consts::E.log2());
-        ensure_nondet(|| 27.0f64.cbrt());
-        ensure_nondet(|| 3.0f64.hypot(4.0f64));
-        ensure_nondet(|| 1f64.sin());
-        ensure_nondet(|| 0f64.cos());
-        ensure_nondet(|| 1.0f64.tan());
-        ensure_nondet(|| 1.0f64.asin());
-        ensure_nondet(|| 5.0f64.acos());
-        ensure_nondet(|| 1.0f64.atan());
-        ensure_nondet(|| 1.0f64.atan2(2.0f64));
-        ensure_nondet(|| 1.0f64.sinh());
-        ensure_nondet(|| 1.0f64.cosh());
-        ensure_nondet(|| 1.0f64.tanh());
-        ensure_nondet(|| 1.0f64.asinh());
-        ensure_nondet(|| 3.0f64.acosh());
-        ensure_nondet(|| 0.5f64.atanh());
-        ensure_nondet(|| 5.0f64.gamma());
-        ensure_nondet(|| 5.0f64.ln_gamma());
-        ensure_nondet(|| 5.0f64.erf());
-        ensure_nondet(|| 5.0f64.erfc());
+        // FIXME: temporarily disabled as it breaks std tests.
+        // ensure_nondet(|| a.log(b));
+        // ensure_nondet(|| a.exp());
+        // ensure_nondet(|| 50f64.exp2());
+        // ensure_nondet(|| 3f64.ln());
+        // ensure_nondet(|| 1f64.ln_1p());
+        // ensure_nondet(|| f64::consts::E.log10());
+        // ensure_nondet(|| f64::consts::E.log2());
+        // ensure_nondet(|| 27.0f64.cbrt());
+        // ensure_nondet(|| 3.0f64.hypot(4.0f64));
+        // ensure_nondet(|| 1f64.sin());
+        // ensure_nondet(|| 0f64.cos());
+        // ensure_nondet(|| 1.0f64.tan());
+        // ensure_nondet(|| 1.0f64.asin());
+        // ensure_nondet(|| 5.0f64.acos());
+        // ensure_nondet(|| 1.0f64.atan());
+        // ensure_nondet(|| 1.0f64.atan2(2.0f64));
+        // ensure_nondet(|| 1.0f64.sinh());
+        // ensure_nondet(|| 1.0f64.cosh());
+        // ensure_nondet(|| 1.0f64.tanh());
+        // ensure_nondet(|| 1.0f64.asinh());
+        // ensure_nondet(|| 3.0f64.acosh());
+        // ensure_nondet(|| 0.5f64.atanh());
+        // ensure_nondet(|| 5.0f64.gamma());
+        // ensure_nondet(|| 5.0f64.ln_gamma());
+        // ensure_nondet(|| 5.0f64.erf());
+        // ensure_nondet(|| 5.0f64.erfc());
     }
     pub fn test_operations_f128(a: f128, b: f128) {
         test_operations_f!(a, b);
diff --git a/src/tools/tidy/src/issues.txt b/src/tools/tidy/src/issues.txt
index f1ce3cc..e6b5aa5 100644
--- a/src/tools/tidy/src/issues.txt
+++ b/src/tools/tidy/src/issues.txt
@@ -1979,7 +1979,6 @@
 ui/issues/issue-28105.rs
 ui/issues/issue-28109.rs
 ui/issues/issue-28181.rs
-ui/issues/issue-2823.rs
 ui/issues/issue-28279.rs
 ui/issues/issue-28344.rs
 ui/issues/issue-28433.rs
diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs
index 2e069af..44dd1e5 100644
--- a/src/tools/tidy/src/ui_tests.rs
+++ b/src/tools/tidy/src/ui_tests.rs
@@ -17,7 +17,7 @@
 const ENTRY_LIMIT: u32 = 901;
 // FIXME: The following limits should be reduced eventually.
 
-const ISSUES_ENTRY_LIMIT: u32 = 1626;
+const ISSUES_ENTRY_LIMIT: u32 = 1624;
 
 const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
     "rs",     // test source files
diff --git a/tests/codegen/const-vector.rs b/tests/codegen/const-vector.rs
index 1d4edc3..289b673 100644
--- a/tests/codegen/const-vector.rs
+++ b/tests/codegen/const-vector.rs
@@ -9,6 +9,7 @@
 #![feature(rustc_attrs)]
 #![feature(simd_ffi)]
 #![feature(arm_target_feature)]
+#![feature(mips_target_feature)]
 #![allow(non_camel_case_types)]
 
 // Setting up structs that can be used as const vectors
@@ -45,6 +46,7 @@
 #[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
 #[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
 #[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
+#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
 pub fn do_call() {
     unsafe {
         // CHECK: call void @test_i8x2(<2 x i8> <i8 32, i8 64>
diff --git a/tests/codegen/repr/transparent.rs b/tests/codegen/repr/transparent.rs
index 5475bfb..29b6274 100644
--- a/tests/codegen/repr/transparent.rs
+++ b/tests/codegen/repr/transparent.rs
@@ -9,7 +9,7 @@
 // For LoongArch: see codegen/loongarch-abi
 
 #![crate_type = "lib"]
-#![feature(repr_simd, transparent_unions, arm_target_feature)]
+#![feature(repr_simd, transparent_unions, arm_target_feature, mips_target_feature)]
 
 use std::marker::PhantomData;
 
@@ -142,6 +142,7 @@ pub extern "C" fn test_Nested2(_: Nested2) -> Nested2 {
 #[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
 #[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
 #[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
+#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
 pub extern "C" fn test_Vector(_: Vector) -> Vector {
     loop {}
 }
diff --git a/tests/codegen/simd/extract-insert-dyn.rs b/tests/codegen/simd/extract-insert-dyn.rs
index 2c64f5d..7d032c6 100644
--- a/tests/codegen/simd/extract-insert-dyn.rs
+++ b/tests/codegen/simd/extract-insert-dyn.rs
@@ -1,6 +1,6 @@
 //@compile-flags: -C opt-level=3 -C no-prepopulate-passes
 
-#![feature(core_intrinsics, repr_simd, arm_target_feature)]
+#![feature(core_intrinsics, repr_simd, arm_target_feature, mips_target_feature)]
 #![no_std]
 #![crate_type = "lib"]
 #![allow(non_camel_case_types)]
@@ -24,6 +24,7 @@
 #[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
 #[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
 #[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
+#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
 unsafe extern "C" fn dyn_simd_extract(x: i8x16, idx: u32) -> i8 {
     simd_extract_dyn(x, idx)
 }
@@ -34,6 +35,7 @@
 #[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
 #[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
 #[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
+#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
 unsafe extern "C" fn literal_dyn_simd_extract(x: i8x16) -> i8 {
     simd_extract_dyn(x, 7)
 }
@@ -44,6 +46,7 @@
 #[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
 #[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
 #[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
+#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
 unsafe extern "C" fn const_dyn_simd_extract(x: i8x16) -> i8 {
     simd_extract_dyn(x, const { 3 + 4 })
 }
@@ -54,6 +57,7 @@
 #[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
 #[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
 #[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
+#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
 unsafe extern "C" fn const_simd_extract(x: i8x16) -> i8 {
     simd_extract(x, const { 3 + 4 })
 }
@@ -64,6 +68,7 @@
 #[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
 #[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
 #[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
+#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
 unsafe extern "C" fn dyn_simd_insert(x: i8x16, e: i8, idx: u32) -> i8x16 {
     simd_insert_dyn(x, idx, e)
 }
@@ -74,6 +79,7 @@
 #[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
 #[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
 #[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
+#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
 unsafe extern "C" fn literal_dyn_simd_insert(x: i8x16, e: i8) -> i8x16 {
     simd_insert_dyn(x, 7, e)
 }
@@ -84,6 +90,7 @@
 #[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
 #[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
 #[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
+#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
 unsafe extern "C" fn const_dyn_simd_insert(x: i8x16, e: i8) -> i8x16 {
     simd_insert_dyn(x, const { 3 + 4 }, e)
 }
@@ -94,6 +101,7 @@
 #[cfg_attr(target_family = "wasm", target_feature(enable = "simd128"))]
 #[cfg_attr(target_arch = "arm", target_feature(enable = "neon"))]
 #[cfg_attr(target_arch = "x86", target_feature(enable = "sse"))]
+#[cfg_attr(target_arch = "mips", target_feature(enable = "msa"))]
 unsafe extern "C" fn const_simd_insert(x: i8x16, e: i8) -> i8x16 {
     simd_insert(x, const { 3 + 4 }, e)
 }
diff --git a/tests/rustdoc-ui/issues/ice-generic-type-alias-105742.rs b/tests/rustdoc-ui/issues/ice-generic-type-alias-105742.rs
index 73a6877..33f3c2f 100644
--- a/tests/rustdoc-ui/issues/ice-generic-type-alias-105742.rs
+++ b/tests/rustdoc-ui/issues/ice-generic-type-alias-105742.rs
@@ -1,12 +1,14 @@
 //@ compile-flags: -Znormalize-docs
+//@ dont-require-annotations: NOTE
+
 // https://github.com/rust-lang/rust/issues/105742
 use std::ops::Index;
 
 pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
-    //~^ expected 1 lifetime argument
-    //~| expected 1 generic argument
+    //~^ NOTE expected 1 lifetime argument
+    //~| NOTE expected 1 generic argument
     //~| ERROR the trait `SVec` is not dyn compatible
-    //~| `SVec` is not dyn compatible
+    //~| NOTE `SVec` is not dyn compatible
     //~| ERROR missing generics for associated type `SVec::Item`
     //~| ERROR missing generics for associated type `SVec::Item`
     let _ = s;
@@ -14,8 +16,8 @@ pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
 
 pub trait SVec: Index<
     <Self as SVec>::Item,
-    //~^ expected 1 lifetime argument
-    //~| expected 1 generic argument
+    //~^ NOTE expected 1 lifetime argument
+    //~| NOTE expected 1 generic argument
     //~| ERROR missing generics for associated type `SVec::Item`
     //~| ERROR missing generics for associated type `SVec::Item`
     //~| ERROR missing generics for associated type `SVec::Item`
@@ -25,8 +27,8 @@ pub trait SVec: Index<
     //~| ERROR missing generics for associated type `SVec::Item`
     //~| ERROR missing generics for associated type `SVec::Item`
     Output = <Index<<Self as SVec>::Item,
-    //~^ expected 1 lifetime argument
-    //~| expected 1 generic argument
+    //~^ NOTE expected 1 lifetime argument
+    //~| NOTE expected 1 generic argument
     //~| ERROR missing generics for associated type `SVec::Item`
     //~| ERROR missing generics for associated type `SVec::Item`
     //~| ERROR missing generics for associated type `SVec::Item`
@@ -36,16 +38,16 @@ pub trait SVec: Index<
     //~| ERROR missing generics for associated type `SVec::Item`
     //~| ERROR missing generics for associated type `SVec::Item`
     Output = <Self as SVec>::Item> as SVec>::Item,
-    //~^ expected 1 lifetime argument
-    //~| expected 1 generic argument
-    //~| expected 1 lifetime argument
+    //~^ NOTE expected 1 lifetime argument
+    //~| NOTE expected 1 generic argument
+    //~| NOTE expected 1 lifetime argument
     //~| ERROR missing generics for associated type `SVec::Item`
     //~| ERROR missing generics for associated type `SVec::Item`
     //~| ERROR missing generics for associated type `SVec::Item`
     //~| ERROR missing generics for associated type `SVec::Item`
     //~| ERROR missing generics for associated type `SVec::Item`
     //~| ERROR missing generics for associated type `SVec::Item`
-    //~| expected 1 generic argument
+    //~| NOTE expected 1 generic argument
     //~| ERROR missing generics for associated type `SVec::Item`
     //~| ERROR missing generics for associated type `SVec::Item`
     //~| ERROR missing generics for associated type `SVec::Item`
@@ -60,8 +62,8 @@ pub trait SVec: Index<
     type Item<'a, T>;
 
     fn len(&self) -> <Self as SVec>::Item;
-    //~^ expected 1 lifetime argument
+    //~^ NOTE expected 1 lifetime argument
     //~| ERROR missing generics for associated type `SVec::Item`
-    //~| expected 1 generic argument
+    //~| NOTE expected 1 generic argument
     //~| ERROR missing generics for associated type `SVec::Item`
 }
diff --git a/tests/rustdoc-ui/issues/ice-generic-type-alias-105742.stderr b/tests/rustdoc-ui/issues/ice-generic-type-alias-105742.stderr
index e4a8465..6428477 100644
--- a/tests/rustdoc-ui/issues/ice-generic-type-alias-105742.stderr
+++ b/tests/rustdoc-ui/issues/ice-generic-type-alias-105742.stderr
@@ -1,11 +1,11 @@
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:16:21
+  --> $DIR/ice-generic-type-alias-105742.rs:18:21
    |
 LL |     <Self as SVec>::Item,
    |                     ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -15,13 +15,13 @@
    |                         ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:16:21
+  --> $DIR/ice-generic-type-alias-105742.rs:18:21
    |
 LL |     <Self as SVec>::Item,
    |                     ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -31,13 +31,13 @@
    |                         +++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:27:37
+  --> $DIR/ice-generic-type-alias-105742.rs:29:37
    |
 LL |     Output = <Index<<Self as SVec>::Item,
    |                                     ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -47,13 +47,13 @@
    |                                         ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:27:37
+  --> $DIR/ice-generic-type-alias-105742.rs:29:37
    |
 LL |     Output = <Index<<Self as SVec>::Item,
    |                                     ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -63,13 +63,13 @@
    |                                         +++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:38:30
+  --> $DIR/ice-generic-type-alias-105742.rs:40:30
    |
 LL |     Output = <Self as SVec>::Item> as SVec>::Item,
    |                              ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -79,13 +79,13 @@
    |                                  ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:38:30
+  --> $DIR/ice-generic-type-alias-105742.rs:40:30
    |
 LL |     Output = <Self as SVec>::Item> as SVec>::Item,
    |                              ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -95,13 +95,13 @@
    |                                  +++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:38:46
+  --> $DIR/ice-generic-type-alias-105742.rs:40:46
    |
 LL |     Output = <Self as SVec>::Item> as SVec>::Item,
    |                                              ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -111,13 +111,13 @@
    |                                                  ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:38:46
+  --> $DIR/ice-generic-type-alias-105742.rs:40:46
    |
 LL |     Output = <Self as SVec>::Item> as SVec>::Item,
    |                                              ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -127,13 +127,13 @@
    |                                                  +++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:5:40
+  --> $DIR/ice-generic-type-alias-105742.rs:7:40
    |
 LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
    |                                        ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -143,13 +143,13 @@
    |                                            ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:5:40
+  --> $DIR/ice-generic-type-alias-105742.rs:7:40
    |
 LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
    |                                        ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -159,13 +159,13 @@
    |                                            +++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:16:21
+  --> $DIR/ice-generic-type-alias-105742.rs:18:21
    |
 LL |     <Self as SVec>::Item,
    |                     ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -176,13 +176,13 @@
    |                         ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:16:21
+  --> $DIR/ice-generic-type-alias-105742.rs:18:21
    |
 LL |     <Self as SVec>::Item,
    |                     ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -193,13 +193,13 @@
    |                         +++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:27:37
+  --> $DIR/ice-generic-type-alias-105742.rs:29:37
    |
 LL |     Output = <Index<<Self as SVec>::Item,
    |                                     ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -210,13 +210,13 @@
    |                                         ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:27:37
+  --> $DIR/ice-generic-type-alias-105742.rs:29:37
    |
 LL |     Output = <Index<<Self as SVec>::Item,
    |                                     ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -227,13 +227,13 @@
    |                                         +++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:38:30
+  --> $DIR/ice-generic-type-alias-105742.rs:40:30
    |
 LL |     Output = <Self as SVec>::Item> as SVec>::Item,
    |                              ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -244,13 +244,13 @@
    |                                  ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:38:30
+  --> $DIR/ice-generic-type-alias-105742.rs:40:30
    |
 LL |     Output = <Self as SVec>::Item> as SVec>::Item,
    |                              ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -261,13 +261,13 @@
    |                                  +++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:38:46
+  --> $DIR/ice-generic-type-alias-105742.rs:40:46
    |
 LL |     Output = <Self as SVec>::Item> as SVec>::Item,
    |                                              ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -278,13 +278,13 @@
    |                                                  ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:38:46
+  --> $DIR/ice-generic-type-alias-105742.rs:40:46
    |
 LL |     Output = <Self as SVec>::Item> as SVec>::Item,
    |                                              ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -295,14 +295,14 @@
    |                                                  +++
 
 error[E0038]: the trait `SVec` is not dyn compatible
-  --> $DIR/ice-generic-type-alias-105742.rs:5:35
+  --> $DIR/ice-generic-type-alias-105742.rs:7:35
    |
 LL | pub fn next<'a, T>(s: &'a mut dyn SVec<Item = T, Output = T>) {
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^ `SVec` is not dyn compatible
    |
 note: for a trait to be dyn compatible it needs to allow building a vtable
       for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
-  --> $DIR/ice-generic-type-alias-105742.rs:15:17
+  --> $DIR/ice-generic-type-alias-105742.rs:17:17
    |
 LL |    pub trait SVec: Index<
    |  ____________----__^
@@ -324,13 +324,13 @@
    |
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:16:21
+  --> $DIR/ice-generic-type-alias-105742.rs:18:21
    |
 LL |     <Self as SVec>::Item,
    |                     ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -341,13 +341,13 @@
    |                         ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:16:21
+  --> $DIR/ice-generic-type-alias-105742.rs:18:21
    |
 LL |     <Self as SVec>::Item,
    |                     ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -358,13 +358,13 @@
    |                         +++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:27:37
+  --> $DIR/ice-generic-type-alias-105742.rs:29:37
    |
 LL |     Output = <Index<<Self as SVec>::Item,
    |                                     ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -375,13 +375,13 @@
    |                                         ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:27:37
+  --> $DIR/ice-generic-type-alias-105742.rs:29:37
    |
 LL |     Output = <Index<<Self as SVec>::Item,
    |                                     ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -392,13 +392,13 @@
    |                                         +++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:38:30
+  --> $DIR/ice-generic-type-alias-105742.rs:40:30
    |
 LL |     Output = <Self as SVec>::Item> as SVec>::Item,
    |                              ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -409,13 +409,13 @@
    |                                  ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:38:30
+  --> $DIR/ice-generic-type-alias-105742.rs:40:30
    |
 LL |     Output = <Self as SVec>::Item> as SVec>::Item,
    |                              ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -426,13 +426,13 @@
    |                                  +++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:38:46
+  --> $DIR/ice-generic-type-alias-105742.rs:40:46
    |
 LL |     Output = <Self as SVec>::Item> as SVec>::Item,
    |                                              ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -443,13 +443,13 @@
    |                                                  ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:38:46
+  --> $DIR/ice-generic-type-alias-105742.rs:40:46
    |
 LL |     Output = <Self as SVec>::Item> as SVec>::Item,
    |                                              ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -460,13 +460,13 @@
    |                                                  +++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:16:21
+  --> $DIR/ice-generic-type-alias-105742.rs:18:21
    |
 LL |     <Self as SVec>::Item,
    |                     ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -477,13 +477,13 @@
    |                         ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:16:21
+  --> $DIR/ice-generic-type-alias-105742.rs:18:21
    |
 LL |     <Self as SVec>::Item,
    |                     ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -494,13 +494,13 @@
    |                         +++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:27:37
+  --> $DIR/ice-generic-type-alias-105742.rs:29:37
    |
 LL |     Output = <Index<<Self as SVec>::Item,
    |                                     ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -511,13 +511,13 @@
    |                                         ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:27:37
+  --> $DIR/ice-generic-type-alias-105742.rs:29:37
    |
 LL |     Output = <Index<<Self as SVec>::Item,
    |                                     ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -528,13 +528,13 @@
    |                                         +++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:38:30
+  --> $DIR/ice-generic-type-alias-105742.rs:40:30
    |
 LL |     Output = <Self as SVec>::Item> as SVec>::Item,
    |                              ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -545,13 +545,13 @@
    |                                  ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:38:30
+  --> $DIR/ice-generic-type-alias-105742.rs:40:30
    |
 LL |     Output = <Self as SVec>::Item> as SVec>::Item,
    |                              ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -562,13 +562,13 @@
    |                                  +++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:38:46
+  --> $DIR/ice-generic-type-alias-105742.rs:40:46
    |
 LL |     Output = <Self as SVec>::Item> as SVec>::Item,
    |                                              ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -579,13 +579,13 @@
    |                                                  ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:38:46
+  --> $DIR/ice-generic-type-alias-105742.rs:40:46
    |
 LL |     Output = <Self as SVec>::Item> as SVec>::Item,
    |                                              ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
@@ -596,13 +596,13 @@
    |                                                  +++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:62:38
+  --> $DIR/ice-generic-type-alias-105742.rs:64:38
    |
 LL |     fn len(&self) -> <Self as SVec>::Item;
    |                                      ^^^^ expected 1 lifetime argument
    |
 note: associated type defined here, with 1 lifetime parameter: `'a`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^ --
@@ -612,13 +612,13 @@
    |                                          ++++
 
 error[E0107]: missing generics for associated type `SVec::Item`
-  --> $DIR/ice-generic-type-alias-105742.rs:62:38
+  --> $DIR/ice-generic-type-alias-105742.rs:64:38
    |
 LL |     fn len(&self) -> <Self as SVec>::Item;
    |                                      ^^^^ expected 1 generic argument
    |
 note: associated type defined here, with 1 generic parameter: `T`
-  --> $DIR/ice-generic-type-alias-105742.rs:60:10
+  --> $DIR/ice-generic-type-alias-105742.rs:62:10
    |
 LL |     type Item<'a, T>;
    |          ^^^^     -
diff --git a/tests/ui-fulldeps/auxiliary/parser.rs b/tests/ui-fulldeps/auxiliary/parser.rs
index 4ea0d81..be51bd2 100644
--- a/tests/ui-fulldeps/auxiliary/parser.rs
+++ b/tests/ui-fulldeps/auxiliary/parser.rs
@@ -39,8 +39,6 @@ pub fn parse_expr(psess: &ParseSess, source_code: &str) -> Option<P<Expr>> {
 struct Normalize;
 
 impl MutVisitor for Normalize {
-    const VISIT_TOKENS: bool = true;
-
     fn visit_id(&mut self, id: &mut NodeId) {
         *id = DUMMY_NODE_ID;
     }
diff --git a/tests/ui/array-slice-vec/array-not-vector.rs b/tests/ui/array-slice-vec/array-not-vector.rs
index d8b5b10..7345f72 100644
--- a/tests/ui/array-slice-vec/array-not-vector.rs
+++ b/tests/ui/array-slice-vec/array-not-vector.rs
@@ -1,12 +1,14 @@
+//@ dont-require-annotations: NOTE
+
 fn main() {
     let _x: i32 = [1, 2, 3];
     //~^ ERROR mismatched types
-    //~| expected `i32`, found `[{integer}; 3]`
+    //~| NOTE expected `i32`, found `[{integer}; 3]`
 
     let x: &[i32] = &[1, 2, 3];
     let _y: &i32 = x;
     //~^ ERROR mismatched types
-    //~| expected reference `&i32`
-    //~| found reference `&[i32]`
-    //~| expected `&i32`, found `&[i32]`
+    //~| NOTE expected reference `&i32`
+    //~| NOTE found reference `&[i32]`
+    //~| NOTE expected `&i32`, found `&[i32]`
 }
diff --git a/tests/ui/array-slice-vec/array-not-vector.stderr b/tests/ui/array-slice-vec/array-not-vector.stderr
index f20d995..686c5df 100644
--- a/tests/ui/array-slice-vec/array-not-vector.stderr
+++ b/tests/ui/array-slice-vec/array-not-vector.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/array-not-vector.rs:2:19
+  --> $DIR/array-not-vector.rs:4:19
    |
 LL |     let _x: i32 = [1, 2, 3];
    |             ---   ^^^^^^^^^ expected `i32`, found `[{integer}; 3]`
@@ -7,7 +7,7 @@
    |             expected due to this
 
 error[E0308]: mismatched types
-  --> $DIR/array-not-vector.rs:7:20
+  --> $DIR/array-not-vector.rs:9:20
    |
 LL |     let _y: &i32 = x;
    |             ----   ^ expected `&i32`, found `&[i32]`
diff --git a/tests/ui/array-slice-vec/slice-mut.rs b/tests/ui/array-slice-vec/slice-mut.rs
index e9989f0..baa05c3 100644
--- a/tests/ui/array-slice-vec/slice-mut.rs
+++ b/tests/ui/array-slice-vec/slice-mut.rs
@@ -6,7 +6,8 @@ fn main() {
 
     let y: &mut[_] = &x[2..4];
     //~^ ERROR mismatched types
-    //~| expected mutable reference `&mut [_]`
-    //~| found reference `&[isize]`
-    //~| types differ in mutability
+    //~| NOTE expected mutable reference `&mut [_]`
+    //~| NOTE found reference `&[isize]`
+    //~| NOTE types differ in mutability
+    //~| NOTE expected due to this
 }
diff --git a/tests/ui/associated-consts/defaults-not-assumed-fail.rs b/tests/ui/associated-consts/defaults-not-assumed-fail.rs
index 3dc709c..830fd4a 100644
--- a/tests/ui/associated-consts/defaults-not-assumed-fail.rs
+++ b/tests/ui/associated-consts/defaults-not-assumed-fail.rs
@@ -1,4 +1,5 @@
 //@ build-fail
+//@ dont-require-annotations: NOTE
 
 trait Tr {
     const A: u8 = 255;
@@ -31,7 +32,7 @@ impl Tr for u32 {
 fn main() {
     assert_eq!(<() as Tr>::A, 255);
     assert_eq!(<() as Tr>::B, 0);    // causes the error above
-    //~^ constant
+    //~^ NOTE constant
 
     assert_eq!(<u8 as Tr>::A, 254);
     assert_eq!(<u8 as Tr>::B, 255);
diff --git a/tests/ui/associated-consts/defaults-not-assumed-fail.stderr b/tests/ui/associated-consts/defaults-not-assumed-fail.stderr
index 4b53603..3386e81 100644
--- a/tests/ui/associated-consts/defaults-not-assumed-fail.stderr
+++ b/tests/ui/associated-consts/defaults-not-assumed-fail.stderr
@@ -1,17 +1,17 @@
 error[E0080]: evaluation of `<() as Tr>::B` failed
-  --> $DIR/defaults-not-assumed-fail.rs:8:19
+  --> $DIR/defaults-not-assumed-fail.rs:9:19
    |
 LL |     const B: u8 = Self::A + 1;
    |                   ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
 
 note: erroneous constant encountered
-  --> $DIR/defaults-not-assumed-fail.rs:33:16
+  --> $DIR/defaults-not-assumed-fail.rs:34:16
    |
 LL |     assert_eq!(<() as Tr>::B, 0);    // causes the error above
    |                ^^^^^^^^^^^^^
 
 note: erroneous constant encountered
-  --> $DIR/defaults-not-assumed-fail.rs:33:16
+  --> $DIR/defaults-not-assumed-fail.rs:34:16
    |
 LL |     assert_eq!(<() as Tr>::B, 0);    // causes the error above
    |                ^^^^^^^^^^^^^
@@ -19,7 +19,7 @@
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: erroneous constant encountered
-  --> $DIR/defaults-not-assumed-fail.rs:33:5
+  --> $DIR/defaults-not-assumed-fail.rs:34:5
    |
 LL |     assert_eq!(<() as Tr>::B, 0);    // causes the error above
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -27,7 +27,7 @@
    = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 note: erroneous constant encountered
-  --> $DIR/defaults-not-assumed-fail.rs:33:5
+  --> $DIR/defaults-not-assumed-fail.rs:34:5
    |
 LL |     assert_eq!(<() as Tr>::B, 0);    // causes the error above
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/associated-types/associated-types-eq-3.rs b/tests/ui/associated-types/associated-types-eq-3.rs
index 380d0e9..082a732 100644
--- a/tests/ui/associated-types/associated-types-eq-3.rs
+++ b/tests/ui/associated-types/associated-types-eq-3.rs
@@ -1,6 +1,8 @@
 // Test equality constraints on associated types. Check we get type errors
 // where we should.
 
+//@ dont-require-annotations: NOTE
+
 pub trait Foo {
     type A;
     fn boo(&self) -> <Self as Foo>::A;
@@ -22,9 +24,9 @@ fn foo1<I: Foo<A=Bar>>(x: I) {
 fn foo2<I: Foo>(x: I) {
     let _: Bar = x.boo();
     //~^ ERROR mismatched types
-    //~| found associated type `<I as Foo>::A`
-    //~| expected `Bar`, found
-    //~| expected struct `Bar`
+    //~| NOTE found associated type `<I as Foo>::A`
+    //~| NOTE expected `Bar`, found
+    //~| NOTE expected struct `Bar`
 }
 
 
diff --git a/tests/ui/associated-types/associated-types-eq-3.stderr b/tests/ui/associated-types/associated-types-eq-3.stderr
index c3377ee..5fef2a0 100644
--- a/tests/ui/associated-types/associated-types-eq-3.stderr
+++ b/tests/ui/associated-types/associated-types-eq-3.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/associated-types-eq-3.rs:23:18
+  --> $DIR/associated-types-eq-3.rs:25:18
    |
 LL |     let _: Bar = x.boo();
    |            ---   ^^^^^^^ expected `Bar`, found associated type
@@ -14,7 +14,7 @@
    |               +++++++++
 
 error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
-  --> $DIR/associated-types-eq-3.rs:38:10
+  --> $DIR/associated-types-eq-3.rs:40:10
    |
 LL |     foo1(a);
    |     ---- ^ type mismatch resolving `<isize as Foo>::A == Bar`
@@ -22,24 +22,24 @@
    |     required by a bound introduced by this call
    |
 note: expected this to be `Bar`
-  --> $DIR/associated-types-eq-3.rs:12:14
+  --> $DIR/associated-types-eq-3.rs:14:14
    |
 LL |     type A = usize;
    |              ^^^^^
 note: required by a bound in `foo1`
-  --> $DIR/associated-types-eq-3.rs:18:16
+  --> $DIR/associated-types-eq-3.rs:20:16
    |
 LL | fn foo1<I: Foo<A=Bar>>(x: I) {
    |                ^^^^^ required by this bound in `foo1`
 
 error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
-  --> $DIR/associated-types-eq-3.rs:40:9
+  --> $DIR/associated-types-eq-3.rs:42:9
    |
 LL |     baz(&a);
    |         ^^ type mismatch resolving `<isize as Foo>::A == Bar`
    |
 note: expected this to be `Bar`
-  --> $DIR/associated-types-eq-3.rs:12:14
+  --> $DIR/associated-types-eq-3.rs:14:14
    |
 LL |     type A = usize;
    |              ^^^^^
diff --git a/tests/ui/associated-types/associated-types-path-2.rs b/tests/ui/associated-types/associated-types-path-2.rs
index c993e1d..b81aa99 100644
--- a/tests/ui/associated-types/associated-types-path-2.rs
+++ b/tests/ui/associated-types/associated-types-path-2.rs
@@ -1,5 +1,7 @@
 // Test type checking of uses of associated types via sugary paths.
 
+//@ dont-require-annotations: NOTE
+
 pub trait Foo {
     type A;
 
@@ -18,7 +20,7 @@ pub fn f2<T: Foo>(a: T) -> T::A {
 pub fn f1_int_int() {
     f1(2i32, 4i32);
     //~^ ERROR mismatched types
-    //~| expected `u32`, found `i32`
+    //~| NOTE expected `u32`, found `i32`
 }
 
 pub fn f1_int_uint() {
@@ -40,7 +42,7 @@ pub fn f1_uint_int() {
 pub fn f2_int() {
     let _: i32 = f2(2i32);
     //~^ ERROR mismatched types
-    //~| expected `i32`, found `u32`
+    //~| NOTE expected `i32`, found `u32`
 }
 
 pub fn main() { }
diff --git a/tests/ui/associated-types/associated-types-path-2.stderr b/tests/ui/associated-types/associated-types-path-2.stderr
index 897eb75..46e34b0 100644
--- a/tests/ui/associated-types/associated-types-path-2.stderr
+++ b/tests/ui/associated-types/associated-types-path-2.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/associated-types-path-2.rs:19:14
+  --> $DIR/associated-types-path-2.rs:21:14
    |
 LL |     f1(2i32, 4i32);
    |     --       ^^^^ expected `u32`, found `i32`
@@ -7,7 +7,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/associated-types-path-2.rs:13:8
+  --> $DIR/associated-types-path-2.rs:15:8
    |
 LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
    |        ^^               -------
@@ -18,7 +18,7 @@
    |
 
 error[E0277]: the trait bound `u32: Foo` is not satisfied
-  --> $DIR/associated-types-path-2.rs:29:8
+  --> $DIR/associated-types-path-2.rs:31:8
    |
 LL |     f1(2u32, 4u32);
    |     -- ^^^^ the trait `Foo` is not implemented for `u32`
@@ -27,13 +27,13 @@
    |
    = help: the trait `Foo` is implemented for `i32`
 note: required by a bound in `f1`
-  --> $DIR/associated-types-path-2.rs:13:14
+  --> $DIR/associated-types-path-2.rs:15:14
    |
 LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
    |              ^^^ required by this bound in `f1`
 
 error[E0277]: the trait bound `u32: Foo` is not satisfied
-  --> $DIR/associated-types-path-2.rs:29:14
+  --> $DIR/associated-types-path-2.rs:31:14
    |
 LL |     f1(2u32, 4u32);
    |              ^^^^ the trait `Foo` is not implemented for `u32`
@@ -41,7 +41,7 @@
    = help: the trait `Foo` is implemented for `i32`
 
 error[E0277]: the trait bound `u32: Foo` is not satisfied
-  --> $DIR/associated-types-path-2.rs:35:8
+  --> $DIR/associated-types-path-2.rs:37:8
    |
 LL |     f1(2u32, 4i32);
    |     -- ^^^^ the trait `Foo` is not implemented for `u32`
@@ -50,13 +50,13 @@
    |
    = help: the trait `Foo` is implemented for `i32`
 note: required by a bound in `f1`
-  --> $DIR/associated-types-path-2.rs:13:14
+  --> $DIR/associated-types-path-2.rs:15:14
    |
 LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
    |              ^^^ required by this bound in `f1`
 
 error[E0277]: the trait bound `u32: Foo` is not satisfied
-  --> $DIR/associated-types-path-2.rs:35:14
+  --> $DIR/associated-types-path-2.rs:37:14
    |
 LL |     f1(2u32, 4i32);
    |              ^^^^ the trait `Foo` is not implemented for `u32`
@@ -64,7 +64,7 @@
    = help: the trait `Foo` is implemented for `i32`
 
 error[E0308]: mismatched types
-  --> $DIR/associated-types-path-2.rs:41:18
+  --> $DIR/associated-types-path-2.rs:43:18
    |
 LL |     let _: i32 = f2(2i32);
    |            ---   ^^^^^^^^ expected `i32`, found `u32`
diff --git a/tests/ui/associated-types/substs-ppaux.normal.stderr b/tests/ui/associated-types/substs-ppaux.normal.stderr
index 1ea8ab2..aa2aca7 100644
--- a/tests/ui/associated-types/substs-ppaux.normal.stderr
+++ b/tests/ui/associated-types/substs-ppaux.normal.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/substs-ppaux.rs:23:17
+  --> $DIR/substs-ppaux.rs:22:17
    |
 LL | /     fn bar<'a, T>()
 LL | |     where
@@ -19,7 +19,7 @@
    |                                                                        ++
 
 error[E0308]: mismatched types
-  --> $DIR/substs-ppaux.rs:31:17
+  --> $DIR/substs-ppaux.rs:30:17
    |
 LL | /     fn bar<'a, T>()
 LL | |     where
@@ -39,7 +39,7 @@
    |                                                                         ++
 
 error[E0308]: mismatched types
-  --> $DIR/substs-ppaux.rs:39:17
+  --> $DIR/substs-ppaux.rs:38:17
    |
 LL |     fn baz() {}
    |     -------- associated function `baz` defined here
@@ -57,7 +57,7 @@
    |                                                       ++
 
 error[E0308]: mismatched types
-  --> $DIR/substs-ppaux.rs:47:17
+  --> $DIR/substs-ppaux.rs:46:17
    |
 LL | / fn foo<'z>()
 LL | | where
@@ -77,13 +77,13 @@
    |                               ++
 
 error[E0277]: the trait bound `str: Foo<'_, '_, u8>` is not satisfied
-  --> $DIR/substs-ppaux.rs:55:6
+  --> $DIR/substs-ppaux.rs:54:6
    |
 LL |     <str as Foo<u8>>::bar;
    |      ^^^ the trait `Sized` is not implemented for `str`
    |
 note: required for `str` to implement `Foo<'_, '_, u8>`
-  --> $DIR/substs-ppaux.rs:15:20
+  --> $DIR/substs-ppaux.rs:14:20
    |
 LL | impl<'a, 'b, T, S> Foo<'a, 'b, S> for T {}
    |              -     ^^^^^^^^^^^^^^     ^
diff --git a/tests/ui/associated-types/substs-ppaux.rs b/tests/ui/associated-types/substs-ppaux.rs
index 302a6b3..ceec997 100644
--- a/tests/ui/associated-types/substs-ppaux.rs
+++ b/tests/ui/associated-types/substs-ppaux.rs
@@ -1,7 +1,6 @@
-//
 //@ revisions: verbose normal
-//
 //@[verbose] compile-flags: -Z verbose-internals
+//@ dont-require-annotations: NOTE
 
 trait Foo<'b, 'c, S = u32> {
     fn bar<'a, T>()
@@ -22,35 +21,35 @@ fn foo<'z>()
 {
     let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>;
     //[verbose]~^ ERROR mismatched types
-    //[verbose]~| expected unit type `()`
-    //[verbose]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}`
+    //[verbose]~| NOTE expected unit type `()`
+    //[verbose]~| NOTE found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}`
     //[normal]~^^^^ ERROR mismatched types
-    //[normal]~| expected unit type `()`
-    //[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}`
+    //[normal]~| NOTE expected unit type `()`
+    //[normal]~| NOTE found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::bar::<'static, char>}`
 
     let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>;
     //[verbose]~^ ERROR mismatched types
-    //[verbose]~| expected unit type `()`
-    //[verbose]~| found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}`
+    //[verbose]~| NOTE expected unit type `()`
+    //[verbose]~| NOTE found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}`
     //[normal]~^^^^ ERROR mismatched types
-    //[normal]~| expected unit type `()`
-    //[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}`
+    //[normal]~| NOTE expected unit type `()`
+    //[normal]~| NOTE found fn item `fn() {<i8 as Foo<'static, 'static>>::bar::<'static, char>}`
 
     let x: () = <i8 as Foo<'static, 'static, u8>>::baz;
     //[verbose]~^ ERROR mismatched types
-    //[verbose]~| expected unit type `()`
-    //[verbose]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}`
+    //[verbose]~| NOTE expected unit type `()`
+    //[verbose]~| NOTE found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}`
     //[normal]~^^^^ ERROR mismatched types
-    //[normal]~| expected unit type `()`
-    //[normal]~| found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}`
+    //[normal]~| NOTE expected unit type `()`
+    //[normal]~| NOTE found fn item `fn() {<i8 as Foo<'static, 'static, u8>>::baz}`
 
     let x: () = foo::<'static>;
     //[verbose]~^ ERROR mismatched types
-    //[verbose]~| expected unit type `()`
-    //[verbose]~| found fn item `fn() {foo::<'static>}`
+    //[verbose]~| NOTE expected unit type `()`
+    //[verbose]~| NOTE found fn item `fn() {foo::<'static>}`
     //[normal]~^^^^ ERROR mismatched types
-    //[normal]~| expected unit type `()`
-    //[normal]~| found fn item `fn() {foo::<'static>}`
+    //[normal]~| NOTE expected unit type `()`
+    //[normal]~| NOTE found fn item `fn() {foo::<'static>}`
 
     <str as Foo<u8>>::bar;
     //[verbose]~^ ERROR the trait bound `str: Foo<'?0, '?1, u8>` is not satisfied
diff --git a/tests/ui/associated-types/substs-ppaux.verbose.stderr b/tests/ui/associated-types/substs-ppaux.verbose.stderr
index 05cd971..23cf222 100644
--- a/tests/ui/associated-types/substs-ppaux.verbose.stderr
+++ b/tests/ui/associated-types/substs-ppaux.verbose.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/substs-ppaux.rs:23:17
+  --> $DIR/substs-ppaux.rs:22:17
    |
 LL | /     fn bar<'a, T>()
 LL | |     where
@@ -19,7 +19,7 @@
    |                                                                        ++
 
 error[E0308]: mismatched types
-  --> $DIR/substs-ppaux.rs:31:17
+  --> $DIR/substs-ppaux.rs:30:17
    |
 LL | /     fn bar<'a, T>()
 LL | |     where
@@ -39,7 +39,7 @@
    |                                                                         ++
 
 error[E0308]: mismatched types
-  --> $DIR/substs-ppaux.rs:39:17
+  --> $DIR/substs-ppaux.rs:38:17
    |
 LL |     fn baz() {}
    |     -------- associated function `baz` defined here
@@ -57,7 +57,7 @@
    |                                                       ++
 
 error[E0308]: mismatched types
-  --> $DIR/substs-ppaux.rs:47:17
+  --> $DIR/substs-ppaux.rs:46:17
    |
 LL | / fn foo<'z>()
 LL | | where
@@ -77,13 +77,13 @@
    |                               ++
 
 error[E0277]: the trait bound `str: Foo<'?0, '?1, u8>` is not satisfied
-  --> $DIR/substs-ppaux.rs:55:6
+  --> $DIR/substs-ppaux.rs:54:6
    |
 LL |     <str as Foo<u8>>::bar;
    |      ^^^ the trait `Sized` is not implemented for `str`
    |
 note: required for `str` to implement `Foo<'?0, '?1, u8>`
-  --> $DIR/substs-ppaux.rs:15:20
+  --> $DIR/substs-ppaux.rs:14:20
    |
 LL | impl<'a, 'b, T, S> Foo<'a, 'b, S> for T {}
    |              -     ^^^^^^^^^^^^^^     ^
diff --git a/tests/ui/binop/shift-various-bad-types.rs b/tests/ui/binop/shift-various-bad-types.rs
index 31224bb..025cd92 100644
--- a/tests/ui/binop/shift-various-bad-types.rs
+++ b/tests/ui/binop/shift-various-bad-types.rs
@@ -1,5 +1,7 @@
 // Test that we can do shifts by any integral type.
 
+//@ dont-require-annotations: NOTE
+
 struct Panolpy {
     char: char,
     str: &'static str,
@@ -24,7 +26,7 @@ fn foo(p: &Panolpy) {
     // Type of the result follows the LHS, not the RHS:
     let _: i32 = 22_i64 >> 1_i32;
     //~^ ERROR mismatched types
-    //~| expected `i32`, found `i64`
+    //~| NOTE expected `i32`, found `i64`
 }
 
 fn main() {
diff --git a/tests/ui/binop/shift-various-bad-types.stderr b/tests/ui/binop/shift-various-bad-types.stderr
index d7c9eb5..5d16ed7 100644
--- a/tests/ui/binop/shift-various-bad-types.stderr
+++ b/tests/ui/binop/shift-various-bad-types.stderr
@@ -1,5 +1,5 @@
 error[E0277]: no implementation for `{integer} >> char`
-  --> $DIR/shift-various-bad-types.rs:9:8
+  --> $DIR/shift-various-bad-types.rs:11:8
    |
 LL |     22 >> p.char;
    |        ^^ no implementation for `{integer} >> char`
@@ -17,7 +17,7 @@
            and 568 others
 
 error[E0277]: no implementation for `{integer} >> &str`
-  --> $DIR/shift-various-bad-types.rs:12:8
+  --> $DIR/shift-various-bad-types.rs:14:8
    |
 LL |     22 >> p.str;
    |        ^^ no implementation for `{integer} >> &str`
@@ -35,7 +35,7 @@
            and 568 others
 
 error[E0277]: no implementation for `{integer} >> &Panolpy`
-  --> $DIR/shift-various-bad-types.rs:15:8
+  --> $DIR/shift-various-bad-types.rs:17:8
    |
 LL |     22 >> p;
    |        ^^ no implementation for `{integer} >> &Panolpy`
@@ -53,7 +53,7 @@
            and 568 others
 
 error[E0308]: mismatched types
-  --> $DIR/shift-various-bad-types.rs:25:18
+  --> $DIR/shift-various-bad-types.rs:27:18
    |
 LL |     let _: i32 = 22_i64 >> 1_i32;
    |            ---   ^^^^^^^^^^^^^^^ expected `i32`, found `i64`
diff --git a/tests/ui/blind/blind-item-item-shadow.rs b/tests/ui/blind/blind-item-item-shadow.rs
index 82d07ea..4384156 100644
--- a/tests/ui/blind/blind-item-item-shadow.rs
+++ b/tests/ui/blind/blind-item-item-shadow.rs
@@ -1,7 +1,9 @@
+//@ dont-require-annotations: NOTE
+
 mod foo { pub mod foo {  } }
 
 use foo::foo;
 //~^ ERROR the name `foo` is defined multiple times
-//~| `foo` reimported here
+//~| NOTE `foo` reimported here
 
 fn main() {}
diff --git a/tests/ui/blind/blind-item-item-shadow.stderr b/tests/ui/blind/blind-item-item-shadow.stderr
index 08f5f5b..7d13fbe 100644
--- a/tests/ui/blind/blind-item-item-shadow.stderr
+++ b/tests/ui/blind/blind-item-item-shadow.stderr
@@ -1,5 +1,5 @@
 error[E0255]: the name `foo` is defined multiple times
-  --> $DIR/blind-item-item-shadow.rs:3:5
+  --> $DIR/blind-item-item-shadow.rs:5:5
    |
 LL | mod foo { pub mod foo {  } }
    | ------- previous definition of the module `foo` here
diff --git a/tests/ui/block-result/block-must-not-have-result-while.rs b/tests/ui/block-result/block-must-not-have-result-while.rs
index 418059b..ada4e17 100644
--- a/tests/ui/block-result/block-must-not-have-result-while.rs
+++ b/tests/ui/block-result/block-must-not-have-result-while.rs
@@ -1,6 +1,8 @@
+//@ dont-require-annotations: NOTE
+
 fn main() {
     while true { //~ WARN denote infinite loops with
         true //~  ERROR mismatched types
-             //~| expected `()`, found `bool`
+             //~| NOTE expected `()`, found `bool`
     }
 }
diff --git a/tests/ui/block-result/block-must-not-have-result-while.stderr b/tests/ui/block-result/block-must-not-have-result-while.stderr
index 94a4b33..0b9941e 100644
--- a/tests/ui/block-result/block-must-not-have-result-while.stderr
+++ b/tests/ui/block-result/block-must-not-have-result-while.stderr
@@ -1,5 +1,5 @@
 warning: denote infinite loops with `loop { ... }`
-  --> $DIR/block-must-not-have-result-while.rs:2:5
+  --> $DIR/block-must-not-have-result-while.rs:4:5
    |
 LL |     while true {
    |     ^^^^^^^^^^ help: use `loop`
@@ -7,7 +7,7 @@
    = note: `#[warn(while_true)]` on by default
 
 error[E0308]: mismatched types
-  --> $DIR/block-must-not-have-result-while.rs:3:9
+  --> $DIR/block-must-not-have-result-while.rs:5:9
    |
 LL | /     while true {
 LL | |         true
diff --git a/tests/ui/block-result/issue-13624.rs b/tests/ui/block-result/issue-13624.rs
index 8f93e5a..f9f7c33 100644
--- a/tests/ui/block-result/issue-13624.rs
+++ b/tests/ui/block-result/issue-13624.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 mod a {
   pub enum Enum {
     EnumStructVariant { x: u8, y: u8, z: u8 }
@@ -6,7 +8,7 @@ pub enum Enum {
   pub fn get_enum_struct_variant() -> () {
     Enum::EnumStructVariant { x: 1, y: 2, z: 3 }
     //~^ ERROR mismatched types
-    //~| expected `()`, found `Enum`
+    //~| NOTE expected `()`, found `Enum`
   }
 }
 
@@ -19,7 +21,7 @@ fn test_enum_struct_variant() {
       match enum_struct_variant {
         a::Enum::EnumStructVariant { x, y, z } => {
         //~^ ERROR mismatched types
-        //~| expected `()`, found `Enum`
+        //~| NOTE expected `()`, found `Enum`
         }
       }
     }
diff --git a/tests/ui/block-result/issue-13624.stderr b/tests/ui/block-result/issue-13624.stderr
index d41bd05..16f5233 100644
--- a/tests/ui/block-result/issue-13624.stderr
+++ b/tests/ui/block-result/issue-13624.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-13624.rs:7:5
+  --> $DIR/issue-13624.rs:9:5
    |
 LL |   pub fn get_enum_struct_variant() -> () {
    |                                       -- expected `()` because of return type
@@ -7,7 +7,7 @@
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `Enum`
 
 error[E0308]: mismatched types
-  --> $DIR/issue-13624.rs:20:9
+  --> $DIR/issue-13624.rs:22:9
    |
 LL |       match enum_struct_variant {
    |             ------------------- this expression has type `()`
diff --git a/tests/ui/block-result/issue-5500.rs b/tests/ui/block-result/issue-5500.rs
index de7fd39..cbad6a2 100644
--- a/tests/ui/block-result/issue-5500.rs
+++ b/tests/ui/block-result/issue-5500.rs
@@ -1,7 +1,7 @@
-fn main() {
+fn main() { //~ NOTE expected `()` because of default return type
     &panic!()
     //~^ ERROR mismatched types
-    //~| expected unit type `()`
-    //~| found reference `&_`
-    //~| expected `()`, found `&_`
+    //~| NOTE expected unit type `()`
+    //~| NOTE found reference `&_`
+    //~| NOTE expected `()`, found `&_`
 }
diff --git a/tests/ui/borrowck/borrowck-report-with-custom-diagnostic.rs b/tests/ui/borrowck/borrowck-report-with-custom-diagnostic.rs
index 9d323bf..caa312e 100644
--- a/tests/ui/borrowck/borrowck-report-with-custom-diagnostic.rs
+++ b/tests/ui/borrowck/borrowck-report-with-custom-diagnostic.rs
@@ -1,11 +1,13 @@
+//@ dont-require-annotations: NOTE
+
 #![allow(dead_code)]
 fn main() {
     // Original borrow ends at end of function
     let mut x = 1;
     let y = &mut x;
-    //~^ mutable borrow occurs here
+    //~^ NOTE mutable borrow occurs here
     let z = &x; //~ ERROR cannot borrow
-    //~^ immutable borrow occurs here
+    //~^ NOTE immutable borrow occurs here
     z.use_ref();
     y.use_mut();
 }
@@ -16,9 +18,9 @@ fn foo() {
             // Original borrow ends at end of match arm
             let mut x = 1;
             let y = &x;
-            //~^ immutable borrow occurs here
+            //~^ NOTE immutable borrow occurs here
             let z = &mut x; //~ ERROR cannot borrow
-            //~^ mutable borrow occurs here
+            //~^ NOTE mutable borrow occurs here
             z.use_mut();
             y.use_ref();
         }
@@ -31,9 +33,9 @@ fn bar() {
     || {
         let mut x = 1;
         let y = &mut x;
-        //~^ first mutable borrow occurs here
+        //~^ NOTE first mutable borrow occurs here
         let z = &mut x; //~ ERROR cannot borrow
-        //~^ second mutable borrow occurs here
+        //~^ NOTE second mutable borrow occurs here
         z.use_mut();
         y.use_mut();
     };
diff --git a/tests/ui/borrowck/borrowck-report-with-custom-diagnostic.stderr b/tests/ui/borrowck/borrowck-report-with-custom-diagnostic.stderr
index 444a74c..e247473 100644
--- a/tests/ui/borrowck/borrowck-report-with-custom-diagnostic.stderr
+++ b/tests/ui/borrowck/borrowck-report-with-custom-diagnostic.stderr
@@ -1,5 +1,5 @@
 error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
-  --> $DIR/borrowck-report-with-custom-diagnostic.rs:7:13
+  --> $DIR/borrowck-report-with-custom-diagnostic.rs:9:13
    |
 LL |     let y = &mut x;
    |             ------ mutable borrow occurs here
@@ -11,7 +11,7 @@
    |     - mutable borrow later used here
 
 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
-  --> $DIR/borrowck-report-with-custom-diagnostic.rs:20:21
+  --> $DIR/borrowck-report-with-custom-diagnostic.rs:22:21
    |
 LL |             let y = &x;
    |                     -- immutable borrow occurs here
@@ -23,7 +23,7 @@
    |             - immutable borrow later used here
 
 error[E0499]: cannot borrow `x` as mutable more than once at a time
-  --> $DIR/borrowck-report-with-custom-diagnostic.rs:35:17
+  --> $DIR/borrowck-report-with-custom-diagnostic.rs:37:17
    |
 LL |         let y = &mut x;
    |                 ------ first mutable borrow occurs here
diff --git a/tests/ui/borrowck/issue-81899.rs b/tests/ui/borrowck/issue-81899.rs
index 380c037..1175562 100644
--- a/tests/ui/borrowck/issue-81899.rs
+++ b/tests/ui/borrowck/issue-81899.rs
@@ -1,14 +1,16 @@
 // Regression test for #81899.
 // The `panic!()` below is important to trigger the fixed ICE.
 
+//@ dont-require-annotations: NOTE
+
 const _CONST: &[u8] = &f(&[], |_| {}); //~ ERROR evaluation of constant value failed
-//~^ constant
+//~^ NOTE constant
 
 const fn f<F>(_: &[u8], _: F) -> &[u8]
 where
     F: FnMut(&u8),
 {
-    panic!() //~ inside `f
+    panic!() //~ NOTE inside `f
 }
 
 fn main() {}
diff --git a/tests/ui/borrowck/issue-81899.stderr b/tests/ui/borrowck/issue-81899.stderr
index b5cd5e4..97d463c 100644
--- a/tests/ui/borrowck/issue-81899.stderr
+++ b/tests/ui/borrowck/issue-81899.stderr
@@ -1,17 +1,17 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/issue-81899.rs:4:24
+  --> $DIR/issue-81899.rs:6:24
    |
 LL | const _CONST: &[u8] = &f(&[], |_| {});
    |                        ^^^^^^^^^^^^^^ evaluation panicked: explicit panic
    |
-note: inside `f::<{closure@$DIR/issue-81899.rs:4:31: 4:34}>`
-  --> $DIR/issue-81899.rs:11:5
+note: inside `f::<{closure@$DIR/issue-81899.rs:6:31: 6:34}>`
+  --> $DIR/issue-81899.rs:13:5
    |
 LL |     panic!()
    |     ^^^^^^^^ the failure occurred here
 
 note: erroneous constant encountered
-  --> $DIR/issue-81899.rs:4:23
+  --> $DIR/issue-81899.rs:6:23
    |
 LL | const _CONST: &[u8] = &f(&[], |_| {});
    |                       ^^^^^^^^^^^^^^^
diff --git a/tests/ui/borrowck/issue-88434-minimal-example.rs b/tests/ui/borrowck/issue-88434-minimal-example.rs
index ebaa9a9..7482b3f 100644
--- a/tests/ui/borrowck/issue-88434-minimal-example.rs
+++ b/tests/ui/borrowck/issue-88434-minimal-example.rs
@@ -1,13 +1,15 @@
 // Regression test related to issue 88434
 
+//@ dont-require-annotations: NOTE
+
 const _CONST: &() = &f(&|_| {}); //~ ERROR evaluation of constant value failed
-//~^ constant
+//~^ NOTE constant
 
 const fn f<F>(_: &F)
 where
     F: FnMut(&u8),
 {
-    panic!() //~ inside `f
+    panic!() //~ NOTE inside `f
 }
 
 fn main() { }
diff --git a/tests/ui/borrowck/issue-88434-minimal-example.stderr b/tests/ui/borrowck/issue-88434-minimal-example.stderr
index d9f3b4d..4c525b9 100644
--- a/tests/ui/borrowck/issue-88434-minimal-example.stderr
+++ b/tests/ui/borrowck/issue-88434-minimal-example.stderr
@@ -1,17 +1,17 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/issue-88434-minimal-example.rs:3:22
+  --> $DIR/issue-88434-minimal-example.rs:5:22
    |
 LL | const _CONST: &() = &f(&|_| {});
    |                      ^^^^^^^^^^ evaluation panicked: explicit panic
    |
-note: inside `f::<{closure@$DIR/issue-88434-minimal-example.rs:3:25: 3:28}>`
-  --> $DIR/issue-88434-minimal-example.rs:10:5
+note: inside `f::<{closure@$DIR/issue-88434-minimal-example.rs:5:25: 5:28}>`
+  --> $DIR/issue-88434-minimal-example.rs:12:5
    |
 LL |     panic!()
    |     ^^^^^^^^ the failure occurred here
 
 note: erroneous constant encountered
-  --> $DIR/issue-88434-minimal-example.rs:3:21
+  --> $DIR/issue-88434-minimal-example.rs:5:21
    |
 LL | const _CONST: &() = &f(&|_| {});
    |                     ^^^^^^^^^^^
diff --git a/tests/ui/borrowck/issue-88434-removal-index-should-be-less.rs b/tests/ui/borrowck/issue-88434-removal-index-should-be-less.rs
index 8d04263..09b1f59 100644
--- a/tests/ui/borrowck/issue-88434-removal-index-should-be-less.rs
+++ b/tests/ui/borrowck/issue-88434-removal-index-should-be-less.rs
@@ -1,13 +1,15 @@
 // Regression test for issue 88434
 
+//@ dont-require-annotations: NOTE
+
 const _CONST: &[u8] = &f(&[], |_| {}); //~ ERROR evaluation of constant value failed
-//~^ constant
+//~^ NOTE constant
 
 const fn f<F>(_: &[u8], _: F) -> &[u8]
 where
     F: FnMut(&u8),
 {
-    panic!() //~ inside `f
+    panic!() //~ NOTE inside `f
 }
 
 fn main() { }
diff --git a/tests/ui/borrowck/issue-88434-removal-index-should-be-less.stderr b/tests/ui/borrowck/issue-88434-removal-index-should-be-less.stderr
index c82b5cf..a22621c 100644
--- a/tests/ui/borrowck/issue-88434-removal-index-should-be-less.stderr
+++ b/tests/ui/borrowck/issue-88434-removal-index-should-be-less.stderr
@@ -1,17 +1,17 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/issue-88434-removal-index-should-be-less.rs:3:24
+  --> $DIR/issue-88434-removal-index-should-be-less.rs:5:24
    |
 LL | const _CONST: &[u8] = &f(&[], |_| {});
    |                        ^^^^^^^^^^^^^^ evaluation panicked: explicit panic
    |
-note: inside `f::<{closure@$DIR/issue-88434-removal-index-should-be-less.rs:3:31: 3:34}>`
-  --> $DIR/issue-88434-removal-index-should-be-less.rs:10:5
+note: inside `f::<{closure@$DIR/issue-88434-removal-index-should-be-less.rs:5:31: 5:34}>`
+  --> $DIR/issue-88434-removal-index-should-be-less.rs:12:5
    |
 LL |     panic!()
    |     ^^^^^^^^ the failure occurred here
 
 note: erroneous constant encountered
-  --> $DIR/issue-88434-removal-index-should-be-less.rs:3:23
+  --> $DIR/issue-88434-removal-index-should-be-less.rs:5:23
    |
 LL | const _CONST: &[u8] = &f(&[], |_| {});
    |                       ^^^^^^^^^^^^^^^
diff --git a/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.rs b/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.rs
index f8910c9..ce94ba6 100644
--- a/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.rs
+++ b/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.rs
@@ -1,4 +1,5 @@
 //@ check-fail
+//@ dont-require-annotations: NOTE
 
 trait Trait<'a> {}
 
@@ -18,7 +19,7 @@ fn change_lt_ba<'a, 'b: 'a>(x: *mut dyn Trait<'a>) -> *mut dyn Trait<'b> {
 fn change_lt_hr<'a>(x: *mut dyn Trait<'a>) -> *mut dyn for<'b> Trait<'b> {
     x as _ //~ error: lifetime may not live long enough
     //~^ error: mismatched types
-    //~| one type is more general than the other
+    //~| NOTE one type is more general than the other
 }
 
 trait Assocked {
diff --git a/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.stderr b/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.stderr
index faaa632..88a89dc 100644
--- a/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.stderr
+++ b/tests/ui/cast/ptr-to-trait-obj-different-regions-misc.stderr
@@ -1,5 +1,5 @@
 error: lifetime may not live long enough
-  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:6:5
+  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:7:5
    |
 LL | fn change_lt<'a, 'b>(x: *mut dyn Trait<'a>) -> *mut dyn Trait<'b> {
    |              --  -- lifetime `'b` defined here
@@ -14,7 +14,7 @@
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:6:5
+  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:7:5
    |
 LL | fn change_lt<'a, 'b>(x: *mut dyn Trait<'a>) -> *mut dyn Trait<'b> {
    |              --  -- lifetime `'b` defined here
@@ -31,7 +31,7 @@
 help: `'b` and `'a` must be the same: replace one with the other
 
 error: lifetime may not live long enough
-  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:11:5
+  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:12:5
    |
 LL | fn change_lt_ab<'a: 'b, 'b>(x: *mut dyn Trait<'a>) -> *mut dyn Trait<'b> {
    |                 --      -- lifetime `'b` defined here
@@ -46,7 +46,7 @@
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:15:5
+  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:16:5
    |
 LL | fn change_lt_ba<'a, 'b: 'a>(x: *mut dyn Trait<'a>) -> *mut dyn Trait<'b> {
    |                 --  -- lifetime `'b` defined here
@@ -61,7 +61,7 @@
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:19:5
+  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:20:5
    |
 LL | fn change_lt_hr<'a>(x: *mut dyn Trait<'a>) -> *mut dyn for<'b> Trait<'b> {
    |                 -- lifetime `'a` defined here
@@ -74,7 +74,7 @@
    |                                                                          ++++
 
 error[E0308]: mismatched types
-  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:19:5
+  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:20:5
    |
 LL |     x as _
    |     ^^^^^^ one type is more general than the other
@@ -83,7 +83,7 @@
               found trait object `dyn Trait<'_>`
 
 error: lifetime may not live long enough
-  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:31:5
+  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:32:5
    |
 LL | fn change_assoc_0<'a, 'b>(
    |                   --  -- lifetime `'b` defined here
@@ -99,7 +99,7 @@
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:31:5
+  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:32:5
    |
 LL | fn change_assoc_0<'a, 'b>(
    |                   --  -- lifetime `'b` defined here
@@ -119,7 +119,7 @@
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error: lifetime may not live long enough
-  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:38:5
+  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:39:5
    |
 LL | fn change_assoc_1<'a, 'b>(
    |                   --  -- lifetime `'b` defined here
@@ -135,7 +135,7 @@
    = help: see <https://doc.rust-lang.org/nomicon/subtyping.html> for more information about variance
 
 error: lifetime may not live long enough
-  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:38:5
+  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:39:5
    |
 LL | fn change_assoc_1<'a, 'b>(
    |                   --  -- lifetime `'b` defined here
@@ -155,7 +155,7 @@
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 error[E0521]: borrowed data escapes outside of function
-  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:45:5
+  --> $DIR/ptr-to-trait-obj-different-regions-misc.rs:46:5
    |
 LL | fn extend_to_static<'a>(ptr: *const dyn Trait<'a>) {
    |                     --  ---
diff --git a/tests/ui/codegen/no-mangle-on-internal-lang-items.rs b/tests/ui/codegen/no-mangle-on-internal-lang-items.rs
new file mode 100644
index 0000000..3776693
--- /dev/null
+++ b/tests/ui/codegen/no-mangle-on-internal-lang-items.rs
@@ -0,0 +1,14 @@
+// Issue a error when the user uses #[no_mangle] on internal language items
+//@ edition:2024
+
+#![feature(rustc_attrs)]
+
+#[rustc_std_internal_symbol]
+#[unsafe(no_mangle)] //~ERROR `#[no_mangle]` cannot be used on internal language items
+fn internal_lang_function () {
+
+}
+
+fn main() {
+
+}
diff --git a/tests/ui/codegen/no-mangle-on-internal-lang-items.stderr b/tests/ui/codegen/no-mangle-on-internal-lang-items.stderr
new file mode 100644
index 0000000..12461a6
--- /dev/null
+++ b/tests/ui/codegen/no-mangle-on-internal-lang-items.stderr
@@ -0,0 +1,12 @@
+error: `#[no_mangle]` cannot be used on internal language items
+  --> $DIR/no-mangle-on-internal-lang-items.rs:7:1
+   |
+LL | #[unsafe(no_mangle)]
+   | ^^^^^^^^^^^^^^^^^^^^
+LL | fn internal_lang_function () {
+   | ---------------------------- should be the internal language item
+   |
+   = note: Rustc requires this item to have a specific mangled name.
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/codegen/no-mangle-on-panic-handler.rs b/tests/ui/codegen/no-mangle-on-panic-handler.rs
new file mode 100644
index 0000000..1dc0cce
--- /dev/null
+++ b/tests/ui/codegen/no-mangle-on-panic-handler.rs
@@ -0,0 +1,14 @@
+// Issue an error when the user uses #[no_mangle] on the panic handler
+//@ edition:2024
+
+#![crate_type="lib"]
+#![no_std]
+#![no_main]
+
+use core::panic::PanicInfo;
+
+#[unsafe(no_mangle)] //~ ERROR `#[no_mangle]` cannot be used on internal language items
+#[panic_handler]
+pub unsafe fn panic_fmt(pi: &PanicInfo) -> ! {
+    loop {}
+}
diff --git a/tests/ui/codegen/no-mangle-on-panic-handler.stderr b/tests/ui/codegen/no-mangle-on-panic-handler.stderr
new file mode 100644
index 0000000..dc88b66
--- /dev/null
+++ b/tests/ui/codegen/no-mangle-on-panic-handler.stderr
@@ -0,0 +1,16 @@
+error: `#[no_mangle]` cannot be used on internal language items
+  --> $DIR/no-mangle-on-panic-handler.rs:10:1
+   |
+LL | #[unsafe(no_mangle)]
+   | ^^^^^^^^^^^^^^^^^^^^
+LL | #[panic_handler]
+LL | pub unsafe fn panic_fmt(pi: &PanicInfo) -> ! {
+   | -------------------------------------------- should be the internal language item
+   |
+   = note: Rustc requires this item to have a specific mangled name.
+   = note: If you are trying to prevent mangling to ease debugging, many
+   = note: debuggers support a command such as `rbreak rust_begin_unwind` to
+   = note: match `.*rust_begin_unwind.*` instead of `break rust_begin_unwind` on a specific name
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/coercion/coerce-mut.rs b/tests/ui/coercion/coerce-mut.rs
index 43f0b55..d3ed0a5 100644
--- a/tests/ui/coercion/coerce-mut.rs
+++ b/tests/ui/coercion/coerce-mut.rs
@@ -1,10 +1,12 @@
+//@ dont-require-annotations: NOTE
+
 fn f(x: &mut i32) {}
 
 fn main() {
     let x = 0;
     f(&x);
     //~^ ERROR mismatched types
-    //~| expected mutable reference `&mut i32`
-    //~| found reference `&{integer}`
-    //~| types differ in mutability
+    //~| NOTE expected mutable reference `&mut i32`
+    //~| NOTE found reference `&{integer}`
+    //~| NOTE types differ in mutability
 }
diff --git a/tests/ui/coercion/coerce-mut.stderr b/tests/ui/coercion/coerce-mut.stderr
index 9bbfcc2..0e2a2d04 100644
--- a/tests/ui/coercion/coerce-mut.stderr
+++ b/tests/ui/coercion/coerce-mut.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/coerce-mut.rs:5:7
+  --> $DIR/coerce-mut.rs:7:7
    |
 LL |     f(&x);
    |     - ^^ types differ in mutability
@@ -9,7 +9,7 @@
    = note: expected mutable reference `&mut i32`
                       found reference `&{integer}`
 note: function defined here
-  --> $DIR/coerce-mut.rs:1:4
+  --> $DIR/coerce-mut.rs:3:4
    |
 LL | fn f(x: &mut i32) {}
    |    ^ -----------
diff --git a/tests/ui/coercion/coercion-slice.rs b/tests/ui/coercion/coercion-slice.rs
index b99235d..a0795e8 100644
--- a/tests/ui/coercion/coercion-slice.rs
+++ b/tests/ui/coercion/coercion-slice.rs
@@ -3,5 +3,6 @@
 fn main() {
     let _: &[i32] = [0];
     //~^ ERROR mismatched types
-    //~| expected `&[i32]`, found `[{integer}; 1]`
+    //~| NOTE expected `&[i32]`, found `[{integer}; 1]`
+    //~| NOTE expected due to this
 }
diff --git a/tests/ui/coercion/mut-mut-wont-coerce.rs b/tests/ui/coercion/mut-mut-wont-coerce.rs
index 33016e1..6b00bfd 100644
--- a/tests/ui/coercion/mut-mut-wont-coerce.rs
+++ b/tests/ui/coercion/mut-mut-wont-coerce.rs
@@ -2,6 +2,9 @@
 // Making this compile was a feature request in rust-lang/rust#34117 but this is currently
 // "working as intended". Allowing "deep pointer coercion" seems footgun-prone, and would
 // require proceeding carefully.
+
+//@ dont-require-annotations: NOTE
+
 use std::ops::{Deref, DerefMut};
 
 struct Foo(i32);
@@ -34,7 +37,7 @@ fn make_foo(_: *mut *mut Foo) {
 fn main() {
     let mut result: SmartPtr<Foo> = SmartPtr(std::ptr::null_mut());
     make_foo(&mut &mut *result); //~ ERROR mismatched types
-                                 //~^ expected `*mut *mut Foo`, found `&mut &mut Foo`
+                                 //~^ NOTE expected `*mut *mut Foo`, found `&mut &mut Foo`
     make_foo(out(&mut result)); // works, but makes one wonder why above coercion cannot happen
 }
 
diff --git a/tests/ui/coercion/mut-mut-wont-coerce.stderr b/tests/ui/coercion/mut-mut-wont-coerce.stderr
index 5daf9cb..c37ea6a 100644
--- a/tests/ui/coercion/mut-mut-wont-coerce.stderr
+++ b/tests/ui/coercion/mut-mut-wont-coerce.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/mut-mut-wont-coerce.rs:36:14
+  --> $DIR/mut-mut-wont-coerce.rs:39:14
    |
 LL |     make_foo(&mut &mut *result);
    |     -------- ^^^^^^^^^^^^^^^^^ expected `*mut *mut Foo`, found `&mut &mut Foo`
@@ -9,7 +9,7 @@
    = note:    expected raw pointer `*mut *mut Foo`
            found mutable reference `&mut &mut Foo`
 note: function defined here
-  --> $DIR/mut-mut-wont-coerce.rs:30:4
+  --> $DIR/mut-mut-wont-coerce.rs:33:4
    |
 LL | fn make_foo(_: *mut *mut Foo) {
    |    ^^^^^^^^ ----------------
diff --git a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs
index 761a638..e743b78 100644
--- a/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs
+++ b/tests/ui/const-generics/adt_const_params/const_param_ty_impl_no_structural_eq.rs
@@ -9,11 +9,11 @@ impl std::marker::UnsizedConstParamTy for ImplementsConstParamTy {}
 
 impl std::marker::UnsizedConstParamTy for CantParam {}
 //~^ error: the type `CantParam` does not `#[derive(PartialEq)]`
-//~| the trait bound `CantParam: Eq` is not satisfied
+//~| ERROR the trait bound `CantParam: Eq` is not satisfied
 
 #[derive(std::marker::UnsizedConstParamTy)]
 //~^ error: the type `CantParamDerive` does not `#[derive(PartialEq)]`
-//~| the trait bound `CantParamDerive: Eq` is not satisfied
+//~| ERROR the trait bound `CantParamDerive: Eq` is not satisfied
 struct CantParamDerive(ImplementsConstParamTy);
 
 fn check<T: std::marker::UnsizedConstParamTy>() {}
diff --git a/tests/ui/const-generics/defaults/mismatch.rs b/tests/ui/const-generics/defaults/mismatch.rs
index 3e35c20..bbedf24 100644
--- a/tests/ui/const-generics/defaults/mismatch.rs
+++ b/tests/ui/const-generics/defaults/mismatch.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 pub struct Example<const N: usize = 13>;
 pub struct Example2<T = u32, const N: usize = 13>(T);
 pub struct Example3<const N: usize = 13, T = u32>(T);
@@ -6,17 +8,17 @@
 fn main() {
     let e: Example<13> = ();
     //~^ ERROR mismatched types
-    //~| expected struct `Example`
+    //~| NOTE expected struct `Example`
     let e: Example2<u32, 13> = ();
     //~^ ERROR mismatched types
-    //~| expected struct `Example2`
+    //~| NOTE expected struct `Example2`
     let e: Example3<13, u32> = ();
     //~^ ERROR mismatched types
-    //~| expected struct `Example3`
+    //~| NOTE expected struct `Example3`
     let e: Example3<7> = ();
     //~^ ERROR mismatched types
-    //~| expected struct `Example3<7>`
+    //~| NOTE expected struct `Example3<7>`
     let e: Example4<7> = ();
     //~^ ERROR mismatched types
-    //~| expected struct `Example4<7>`
+    //~| NOTE expected struct `Example4<7>`
 }
diff --git a/tests/ui/const-generics/defaults/mismatch.stderr b/tests/ui/const-generics/defaults/mismatch.stderr
index 9c4f0bc..8cedd1a 100644
--- a/tests/ui/const-generics/defaults/mismatch.stderr
+++ b/tests/ui/const-generics/defaults/mismatch.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/mismatch.rs:7:26
+  --> $DIR/mismatch.rs:9:26
    |
 LL |     let e: Example<13> = ();
    |            -----------   ^^ expected `Example`, found `()`
@@ -10,7 +10,7 @@
            found unit type `()`
 
 error[E0308]: mismatched types
-  --> $DIR/mismatch.rs:10:32
+  --> $DIR/mismatch.rs:12:32
    |
 LL |     let e: Example2<u32, 13> = ();
    |            -----------------   ^^ expected `Example2`, found `()`
@@ -21,7 +21,7 @@
            found unit type `()`
 
 error[E0308]: mismatched types
-  --> $DIR/mismatch.rs:13:32
+  --> $DIR/mismatch.rs:15:32
    |
 LL |     let e: Example3<13, u32> = ();
    |            -----------------   ^^ expected `Example3`, found `()`
@@ -32,7 +32,7 @@
            found unit type `()`
 
 error[E0308]: mismatched types
-  --> $DIR/mismatch.rs:16:26
+  --> $DIR/mismatch.rs:18:26
    |
 LL |     let e: Example3<7> = ();
    |            -----------   ^^ expected `Example3<7>`, found `()`
@@ -43,7 +43,7 @@
            found unit type `()`
 
 error[E0308]: mismatched types
-  --> $DIR/mismatch.rs:19:26
+  --> $DIR/mismatch.rs:21:26
    |
 LL |     let e: Example4<7> = ();
    |            -----------   ^^ expected `Example4<7>`, found `()`
diff --git a/tests/ui/const-generics/issues/issue-100313.rs b/tests/ui/const-generics/issues/issue-100313.rs
index 7ce2a3b..7d43d7b 100644
--- a/tests/ui/const-generics/issues/issue-100313.rs
+++ b/tests/ui/const-generics/issues/issue-100313.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 #![allow(incomplete_features)]
 #![feature(adt_const_params, unsized_const_params)]
 
@@ -6,7 +8,7 @@
 impl<const B: &'static bool> T<B> {
     const fn set_false(&self) {
         unsafe {
-            *(B as *const bool as *mut bool) = false; //~ inside `T
+            *(B as *const bool as *mut bool) = false; //~ NOTE inside `T
         }
     }
 }
diff --git a/tests/ui/const-generics/issues/issue-100313.stderr b/tests/ui/const-generics/issues/issue-100313.stderr
index 03a658a..98c3ec5 100644
--- a/tests/ui/const-generics/issues/issue-100313.stderr
+++ b/tests/ui/const-generics/issues/issue-100313.stderr
@@ -1,11 +1,11 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/issue-100313.rs:16:5
+  --> $DIR/issue-100313.rs:18:5
    |
 LL |     x.set_false();
    |     ^^^^^^^^^^^^^ writing to ALLOC0 which is read-only
    |
 note: inside `T::<&true>::set_false`
-  --> $DIR/issue-100313.rs:9:13
+  --> $DIR/issue-100313.rs:11:13
    |
 LL |             *(B as *const bool as *mut bool) = false;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the failure occurred here
diff --git a/tests/ui/const-generics/min_const_generics/invalid-patterns.32bit.stderr b/tests/ui/const-generics/min_const_generics/invalid-patterns.32bit.stderr
index 11a824b..d1f3b08 100644
--- a/tests/ui/const-generics/min_const_generics/invalid-patterns.32bit.stderr
+++ b/tests/ui/const-generics/min_const_generics/invalid-patterns.32bit.stderr
@@ -1,11 +1,11 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/invalid-patterns.rs:38:32
+  --> $DIR/invalid-patterns.rs:40:32
    |
 LL |   get_flag::<false, { unsafe { char_raw.character } }>();
    |                                ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/invalid-patterns.rs:41:14
+  --> $DIR/invalid-patterns.rs:43:14
    |
 LL |   get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>();
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean
@@ -16,7 +16,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/invalid-patterns.rs:43:14
+  --> $DIR/invalid-patterns.rs:45:14
    |
 LL |   get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean
@@ -27,31 +27,31 @@
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/invalid-patterns.rs:43:58
+  --> $DIR/invalid-patterns.rs:45:58
    |
 LL |   get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
    |                                                          ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
 
 error[E0308]: mismatched types
-  --> $DIR/invalid-patterns.rs:29:21
+  --> $DIR/invalid-patterns.rs:31:21
    |
 LL |   get_flag::<false, 0xFF>();
    |                     ^^^^ expected `char`, found `u8`
 
 error[E0308]: mismatched types
-  --> $DIR/invalid-patterns.rs:31:14
+  --> $DIR/invalid-patterns.rs:33:14
    |
 LL |   get_flag::<7, 'c'>();
    |              ^ expected `bool`, found integer
 
 error[E0308]: mismatched types
-  --> $DIR/invalid-patterns.rs:33:14
+  --> $DIR/invalid-patterns.rs:35:14
    |
 LL |   get_flag::<42, 0x5ad>();
    |              ^^ expected `bool`, found integer
 
 error[E0308]: mismatched types
-  --> $DIR/invalid-patterns.rs:33:18
+  --> $DIR/invalid-patterns.rs:35:18
    |
 LL |   get_flag::<42, 0x5ad>();
    |                  ^^^^^ expected `char`, found `u8`
diff --git a/tests/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr b/tests/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr
index 11a824b..d1f3b08 100644
--- a/tests/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr
+++ b/tests/ui/const-generics/min_const_generics/invalid-patterns.64bit.stderr
@@ -1,11 +1,11 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/invalid-patterns.rs:38:32
+  --> $DIR/invalid-patterns.rs:40:32
    |
 LL |   get_flag::<false, { unsafe { char_raw.character } }>();
    |                                ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/invalid-patterns.rs:41:14
+  --> $DIR/invalid-patterns.rs:43:14
    |
 LL |   get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>();
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean
@@ -16,7 +16,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/invalid-patterns.rs:43:14
+  --> $DIR/invalid-patterns.rs:45:14
    |
 LL |   get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x42, but expected a boolean
@@ -27,31 +27,31 @@
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/invalid-patterns.rs:43:58
+  --> $DIR/invalid-patterns.rs:45:58
    |
 LL |   get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
    |                                                          ^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
 
 error[E0308]: mismatched types
-  --> $DIR/invalid-patterns.rs:29:21
+  --> $DIR/invalid-patterns.rs:31:21
    |
 LL |   get_flag::<false, 0xFF>();
    |                     ^^^^ expected `char`, found `u8`
 
 error[E0308]: mismatched types
-  --> $DIR/invalid-patterns.rs:31:14
+  --> $DIR/invalid-patterns.rs:33:14
    |
 LL |   get_flag::<7, 'c'>();
    |              ^ expected `bool`, found integer
 
 error[E0308]: mismatched types
-  --> $DIR/invalid-patterns.rs:33:14
+  --> $DIR/invalid-patterns.rs:35:14
    |
 LL |   get_flag::<42, 0x5ad>();
    |              ^^ expected `bool`, found integer
 
 error[E0308]: mismatched types
-  --> $DIR/invalid-patterns.rs:33:18
+  --> $DIR/invalid-patterns.rs:35:18
    |
 LL |   get_flag::<42, 0x5ad>();
    |                  ^^^^^ expected `char`, found `u8`
diff --git a/tests/ui/const-generics/min_const_generics/invalid-patterns.rs b/tests/ui/const-generics/min_const_generics/invalid-patterns.rs
index a9d2a8a..10b0d74 100644
--- a/tests/ui/const-generics/min_const_generics/invalid-patterns.rs
+++ b/tests/ui/const-generics/min_const_generics/invalid-patterns.rs
@@ -1,4 +1,6 @@
 //@ stderr-per-bitwidth
+//@ dont-require-annotations: NOTE
+
 use std::mem::transmute;
 
 fn get_flag<const FlagSet: bool, const ShortName: char>() -> Option<char> {
@@ -37,11 +39,11 @@ fn main() {
 
   get_flag::<false, { unsafe { char_raw.character } }>();
   //~^ ERROR evaluation of constant value failed
-  //~| uninitialized
+  //~| NOTE uninitialized
   get_flag::<{ unsafe { bool_raw.boolean } }, 'z'>();
   //~^ ERROR it is undefined behavior
   get_flag::<{ unsafe { bool_raw.boolean } }, { unsafe { char_raw.character } }>();
   //~^ ERROR evaluation of constant value failed
-  //~| uninitialized
+  //~| NOTE uninitialized
   //~| ERROR it is undefined behavior
 }
diff --git a/tests/ui/consts/const-array-oob.rs b/tests/ui/consts/const-array-oob.rs
index cf3db07..4b457d1 100644
--- a/tests/ui/consts/const-array-oob.rs
+++ b/tests/ui/consts/const-array-oob.rs
@@ -1,10 +1,11 @@
 const FOO: [usize; 3] = [1, 2, 3];
 const BAR: usize = FOO[5];
 //~^ ERROR: evaluation of constant value failed
+//~| NOTE index out of bounds: the length is 3 but the index is 5
 
 const BLUB: [u32; FOO[4]] = [5, 6];
 //~^ ERROR evaluation of constant value failed [E0080]
-//~| index out of bounds: the length is 3 but the index is 4
+//~| NOTE index out of bounds: the length is 3 but the index is 4
 
 fn main() {
     let _ = BAR;
diff --git a/tests/ui/consts/const-array-oob.stderr b/tests/ui/consts/const-array-oob.stderr
index be31f18..89427c0 100644
--- a/tests/ui/consts/const-array-oob.stderr
+++ b/tests/ui/consts/const-array-oob.stderr
@@ -1,5 +1,5 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-array-oob.rs:5:19
+  --> $DIR/const-array-oob.rs:6:19
    |
 LL | const BLUB: [u32; FOO[4]] = [5, 6];
    |                   ^^^^^^ index out of bounds: the length is 3 but the index is 4
diff --git a/tests/ui/consts/const-err-late.rs b/tests/ui/consts/const-err-late.rs
index 6dff2c1..f8bea38 100644
--- a/tests/ui/consts/const-err-late.rs
+++ b/tests/ui/consts/const-err-late.rs
@@ -1,5 +1,6 @@
 //@ build-fail
 //@ compile-flags: -C overflow-checks=on
+//@ dont-require-annotations: NOTE
 
 #![allow(arithmetic_overflow, unconditional_panic)]
 
@@ -16,5 +17,5 @@ impl<T> S<T> {
 }
 
 fn main() {
-    black_box((S::<i32>::FOO, S::<u32>::FOO)); //~ constant
+    black_box((S::<i32>::FOO, S::<u32>::FOO)); //~ NOTE constant
 }
diff --git a/tests/ui/consts/const-err-late.stderr b/tests/ui/consts/const-err-late.stderr
index 53badea..0c021e8 100644
--- a/tests/ui/consts/const-err-late.stderr
+++ b/tests/ui/consts/const-err-late.stderr
@@ -1,29 +1,29 @@
 error[E0080]: evaluation of `S::<i32>::FOO` failed
-  --> $DIR/const-err-late.rs:13:21
+  --> $DIR/const-err-late.rs:14:21
    |
 LL |     const FOO: u8 = [5u8][1];
    |                     ^^^^^^^^ index out of bounds: the length is 1 but the index is 1
 
 note: erroneous constant encountered
-  --> $DIR/const-err-late.rs:19:16
+  --> $DIR/const-err-late.rs:20:16
    |
 LL |     black_box((S::<i32>::FOO, S::<u32>::FOO));
    |                ^^^^^^^^^^^^^
 
 error[E0080]: evaluation of `S::<u32>::FOO` failed
-  --> $DIR/const-err-late.rs:13:21
+  --> $DIR/const-err-late.rs:14:21
    |
 LL |     const FOO: u8 = [5u8][1];
    |                     ^^^^^^^^ index out of bounds: the length is 1 but the index is 1
 
 note: erroneous constant encountered
-  --> $DIR/const-err-late.rs:19:31
+  --> $DIR/const-err-late.rs:20:31
    |
 LL |     black_box((S::<i32>::FOO, S::<u32>::FOO));
    |                               ^^^^^^^^^^^^^
 
 note: erroneous constant encountered
-  --> $DIR/const-err-late.rs:19:16
+  --> $DIR/const-err-late.rs:20:16
    |
 LL |     black_box((S::<i32>::FOO, S::<u32>::FOO));
    |                ^^^^^^^^^^^^^
@@ -31,7 +31,7 @@
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: erroneous constant encountered
-  --> $DIR/const-err-late.rs:19:31
+  --> $DIR/const-err-late.rs:20:31
    |
 LL |     black_box((S::<i32>::FOO, S::<u32>::FOO));
    |                               ^^^^^^^^^^^^^
diff --git a/tests/ui/consts/const-err-multi.rs b/tests/ui/consts/const-err-multi.rs
index b265bc4..f21cc97 100644
--- a/tests/ui/consts/const-err-multi.rs
+++ b/tests/ui/consts/const-err-multi.rs
@@ -1,11 +1,12 @@
 pub const A: i8 = -i8::MIN;
 //~^ ERROR constant
+//~| NOTE attempt to negate `i8::MIN`, which would overflow
 pub const B: i8 = A;
-//~^ constant
+//~^ NOTE constant
 pub const C: u8 = A as u8;
-//~^ constant
+//~^ NOTE constant
 pub const D: i8 = 50 - A;
-//~^ constant
+//~^ NOTE constant
 
 fn main() {
     let _ = (A, B, C, D);
diff --git a/tests/ui/consts/const-err-multi.stderr b/tests/ui/consts/const-err-multi.stderr
index 2fe0b9b..c60be59 100644
--- a/tests/ui/consts/const-err-multi.stderr
+++ b/tests/ui/consts/const-err-multi.stderr
@@ -5,19 +5,19 @@
    |                   ^^^^^^^^ attempt to negate `i8::MIN`, which would overflow
 
 note: erroneous constant encountered
-  --> $DIR/const-err-multi.rs:3:19
+  --> $DIR/const-err-multi.rs:4:19
    |
 LL | pub const B: i8 = A;
    |                   ^
 
 note: erroneous constant encountered
-  --> $DIR/const-err-multi.rs:5:19
+  --> $DIR/const-err-multi.rs:6:19
    |
 LL | pub const C: u8 = A as u8;
    |                   ^
 
 note: erroneous constant encountered
-  --> $DIR/const-err-multi.rs:7:24
+  --> $DIR/const-err-multi.rs:8:24
    |
 LL | pub const D: i8 = 50 - A;
    |                        ^
diff --git a/tests/ui/consts/const-eval/const-eval-overflow-4b.rs b/tests/ui/consts/const-eval/const-eval-overflow-4b.rs
index ce9c980..3ad23a5 100644
--- a/tests/ui/consts/const-eval/const-eval-overflow-4b.rs
+++ b/tests/ui/consts/const-eval/const-eval-overflow-4b.rs
@@ -3,12 +3,14 @@
 //
 // This test is checking the count in an array type.
 
+//@ dont-require-annotations: NOTE
+
 #![allow(unused_imports)]
 
 const A_I8_T
     : [u32; (i8::MAX as i8 + 1u8) as usize]
     //~^ ERROR mismatched types
-    //~| expected `i8`, found `u8`
+    //~| NOTE expected `i8`, found `u8`
     //~| ERROR cannot add `u8` to `i8`
     = [0; (i8::MAX as usize) + 1];
 
diff --git a/tests/ui/consts/const-eval/const-eval-overflow-4b.stderr b/tests/ui/consts/const-eval/const-eval-overflow-4b.stderr
index 399f21a..1a0832b 100644
--- a/tests/ui/consts/const-eval/const-eval-overflow-4b.stderr
+++ b/tests/ui/consts/const-eval/const-eval-overflow-4b.stderr
@@ -1,11 +1,11 @@
 error[E0308]: mismatched types
-  --> $DIR/const-eval-overflow-4b.rs:9:30
+  --> $DIR/const-eval-overflow-4b.rs:11:30
    |
 LL |     : [u32; (i8::MAX as i8 + 1u8) as usize]
    |                              ^^^ expected `i8`, found `u8`
 
 error[E0277]: cannot add `u8` to `i8`
-  --> $DIR/const-eval-overflow-4b.rs:9:28
+  --> $DIR/const-eval-overflow-4b.rs:11:28
    |
 LL |     : [u32; (i8::MAX as i8 + 1u8) as usize]
    |                            ^ no implementation for `i8 + u8`
@@ -18,13 +18,13 @@
              `i8` implements `Add`
 
 error[E0604]: only `u8` can be cast as `char`, not `i8`
-  --> $DIR/const-eval-overflow-4b.rs:22:13
+  --> $DIR/const-eval-overflow-4b.rs:24:13
    |
 LL |     : [u32; 5i8 as char as usize]
    |             ^^^^^^^^^^^ invalid cast
    |
 help: try casting from `u8` instead
-  --> $DIR/const-eval-overflow-4b.rs:22:13
+  --> $DIR/const-eval-overflow-4b.rs:24:13
    |
 LL |     : [u32; 5i8 as char as usize]
    |             ^^^^^^^^^^^
diff --git a/tests/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr b/tests/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr
index f099bc7..3eccd59 100644
--- a/tests/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr
+++ b/tests/ui/consts/const-eval/const-pointer-values-in-various-types.64bit.stderr
@@ -1,5 +1,5 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:26:49
+  --> $DIR/const-pointer-values-in-various-types.rs:27:49
    |
 LL |     const I32_REF_USIZE_UNION: usize = unsafe { Nonsense { int_32_ref: &3 }.u };
    |                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -8,7 +8,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:29:43
+  --> $DIR/const-pointer-values-in-various-types.rs:30:43
    |
 LL |     const I32_REF_U8_UNION: u8 = unsafe { Nonsense { int_32_ref: &3 }.uint_8 };
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -17,7 +17,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:32:45
+  --> $DIR/const-pointer-values-in-various-types.rs:33:45
    |
 LL |     const I32_REF_U16_UNION: u16 = unsafe { Nonsense { int_32_ref: &3 }.uint_16 };
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -26,7 +26,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:35:45
+  --> $DIR/const-pointer-values-in-various-types.rs:36:45
    |
 LL |     const I32_REF_U32_UNION: u32 = unsafe { Nonsense { int_32_ref: &3 }.uint_32 };
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -35,7 +35,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:38:45
+  --> $DIR/const-pointer-values-in-various-types.rs:39:45
    |
 LL |     const I32_REF_U64_UNION: u64 = unsafe { Nonsense { int_32_ref: &3 }.uint_64 };
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -44,13 +44,13 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:41:47
+  --> $DIR/const-pointer-values-in-various-types.rs:42:47
    |
 LL |     const I32_REF_U128_UNION: u128 = unsafe { Nonsense { int_32_ref: &3 }.uint_128 };
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:45:43
+  --> $DIR/const-pointer-values-in-various-types.rs:46:43
    |
 LL |     const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 };
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -59,7 +59,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:48:45
+  --> $DIR/const-pointer-values-in-various-types.rs:49:45
    |
 LL |     const I32_REF_I16_UNION: i16 = unsafe { Nonsense { int_32_ref: &3 }.int_16 };
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -68,7 +68,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:51:45
+  --> $DIR/const-pointer-values-in-various-types.rs:52:45
    |
 LL |     const I32_REF_I32_UNION: i32 = unsafe { Nonsense { int_32_ref: &3 }.int_32 };
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -77,7 +77,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:54:45
+  --> $DIR/const-pointer-values-in-various-types.rs:55:45
    |
 LL |     const I32_REF_I64_UNION: i64 = unsafe { Nonsense { int_32_ref: &3 }.int_64 };
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -86,13 +86,13 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:57:47
+  --> $DIR/const-pointer-values-in-various-types.rs:58:47
    |
 LL |     const I32_REF_I128_UNION: i128 = unsafe { Nonsense { int_32_ref: &3 }.int_128 };
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:61:45
+  --> $DIR/const-pointer-values-in-various-types.rs:62:45
    |
 LL |     const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 };
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -101,7 +101,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:64:45
+  --> $DIR/const-pointer-values-in-various-types.rs:65:45
    |
 LL |     const I32_REF_F64_UNION: f64 = unsafe { Nonsense { int_32_ref: &3 }.float_64 };
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -110,7 +110,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:67:47
+  --> $DIR/const-pointer-values-in-various-types.rs:68:47
    |
 LL |     const I32_REF_BOOL_UNION: bool = unsafe { Nonsense { int_32_ref: &3 }.truthy_falsey };
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -119,7 +119,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:70:47
+  --> $DIR/const-pointer-values-in-various-types.rs:71:47
    |
 LL |     const I32_REF_CHAR_UNION: char = unsafe { Nonsense { int_32_ref: &3 }.character };
    |                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -128,7 +128,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:73:39
+  --> $DIR/const-pointer-values-in-various-types.rs:74:39
    |
 LL |     const STR_U8_UNION: u8 = unsafe { Nonsense { stringy: "3" }.uint_8 };
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -137,7 +137,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:76:41
+  --> $DIR/const-pointer-values-in-various-types.rs:77:41
    |
 LL |     const STR_U16_UNION: u16 = unsafe { Nonsense { stringy: "3" }.uint_16 };
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -146,7 +146,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:79:41
+  --> $DIR/const-pointer-values-in-various-types.rs:80:41
    |
 LL |     const STR_U32_UNION: u32 = unsafe { Nonsense { stringy: "3" }.uint_32 };
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -155,7 +155,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:82:41
+  --> $DIR/const-pointer-values-in-various-types.rs:83:41
    |
 LL |     const STR_U64_UNION: u64 = unsafe { Nonsense { stringy: "3" }.uint_64 };
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -164,7 +164,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:85:43
+  --> $DIR/const-pointer-values-in-various-types.rs:86:43
    |
 LL |     const STR_U128_UNION: u128 = unsafe { Nonsense { stringy: "3" }.uint_128 };
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -173,7 +173,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:88:39
+  --> $DIR/const-pointer-values-in-various-types.rs:89:39
    |
 LL |     const STR_I8_UNION: i8 = unsafe { Nonsense { stringy: "3" }.int_8 };
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -182,7 +182,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:91:41
+  --> $DIR/const-pointer-values-in-various-types.rs:92:41
    |
 LL |     const STR_I16_UNION: i16 = unsafe { Nonsense { stringy: "3" }.int_16 };
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -191,7 +191,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:94:41
+  --> $DIR/const-pointer-values-in-various-types.rs:95:41
    |
 LL |     const STR_I32_UNION: i32 = unsafe { Nonsense { stringy: "3" }.int_32 };
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -200,7 +200,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:97:41
+  --> $DIR/const-pointer-values-in-various-types.rs:98:41
    |
 LL |     const STR_I64_UNION: i64 = unsafe { Nonsense { stringy: "3" }.int_64 };
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -209,7 +209,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:100:43
+  --> $DIR/const-pointer-values-in-various-types.rs:101:43
    |
 LL |     const STR_I128_UNION: i128 = unsafe { Nonsense { stringy: "3" }.int_128 };
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -218,7 +218,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:103:41
+  --> $DIR/const-pointer-values-in-various-types.rs:104:41
    |
 LL |     const STR_F32_UNION: f32 = unsafe { Nonsense { stringy: "3" }.float_32 };
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -227,7 +227,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:106:41
+  --> $DIR/const-pointer-values-in-various-types.rs:107:41
    |
 LL |     const STR_F64_UNION: f64 = unsafe { Nonsense { stringy: "3" }.float_64 };
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -236,7 +236,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:109:43
+  --> $DIR/const-pointer-values-in-various-types.rs:110:43
    |
 LL |     const STR_BOOL_UNION: bool = unsafe { Nonsense { stringy: "3" }.truthy_falsey };
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -245,7 +245,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const-pointer-values-in-various-types.rs:112:43
+  --> $DIR/const-pointer-values-in-various-types.rs:113:43
    |
 LL |     const STR_CHAR_UNION: char = unsafe { Nonsense { stringy: "3" }.character };
    |                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
diff --git a/tests/ui/consts/const-eval/const-pointer-values-in-various-types.rs b/tests/ui/consts/const-eval/const-pointer-values-in-various-types.rs
index d6b6d42..ce7380c 100644
--- a/tests/ui/consts/const-eval/const-pointer-values-in-various-types.rs
+++ b/tests/ui/consts/const-eval/const-pointer-values-in-various-types.rs
@@ -1,5 +1,6 @@
 //@ only-x86_64
 //@ stderr-per-bitwidth
+//@ dont-require-annotations: NOTE
 
 #[repr(C)]
 union Nonsense {
@@ -40,7 +41,7 @@ fn main() {
 
     const I32_REF_U128_UNION: u128 = unsafe { Nonsense { int_32_ref: &3 }.uint_128 };
     //~^ ERROR evaluation of constant value failed
-    //~| uninitialized
+    //~| NOTE uninitialized
 
     const I32_REF_I8_UNION: i8 = unsafe { Nonsense { int_32_ref: &3 }.int_8 };
     //~^ ERROR evaluation of constant value failed
@@ -56,7 +57,7 @@ fn main() {
 
     const I32_REF_I128_UNION: i128 = unsafe { Nonsense { int_32_ref: &3 }.int_128 };
     //~^ ERROR evaluation of constant value failed
-    //~| uninitialized
+    //~| NOTE uninitialized
 
     const I32_REF_F32_UNION: f32 = unsafe { Nonsense { int_32_ref: &3 }.float_32 };
     //~^ ERROR evaluation of constant value failed
diff --git a/tests/ui/consts/const-eval/format.rs b/tests/ui/consts/const-eval/format.rs
index 1878fc0..a8085a7 100644
--- a/tests/ui/consts/const-eval/format.rs
+++ b/tests/ui/consts/const-eval/format.rs
@@ -9,4 +9,9 @@ const fn print() {
     //~| ERROR cannot call non-const function `_print` in constant functions
 }
 
+const fn format_args() {
+    format_args!("{}", 0);
+    //~^ ERROR cannot call non-const formatting macro in constant functions
+}
+
 fn main() {}
diff --git a/tests/ui/consts/const-eval/format.stderr b/tests/ui/consts/const-eval/format.stderr
index e8d7bbc..4c4cbb3 100644
--- a/tests/ui/consts/const-eval/format.stderr
+++ b/tests/ui/consts/const-eval/format.stderr
@@ -24,6 +24,14 @@
    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
    = note: this error originates in the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error: aborting due to 3 previous errors
+error[E0015]: cannot call non-const formatting macro in constant functions
+  --> $DIR/format.rs:13:5
+   |
+LL |     format_args!("{}", 0);
+   |     ^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
+
+error: aborting due to 4 previous errors
 
 For more information about this error, try `rustc --explain E0015`.
diff --git a/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.rs b/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.rs
index c1a5440..b47e2b3 100644
--- a/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.rs
+++ b/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.rs
@@ -1,11 +1,13 @@
+//@ dont-require-annotations: NOTE
+
 #![feature(core_intrinsics)]
 #![feature(const_heap)]
 use std::intrinsics;
 
-const FOO: i32 = foo(); //~ error: evaluation of constant value failed
+const FOO: i32 = foo(); //~ ERROR evaluation of constant value failed
 const fn foo() -> i32 {
     unsafe {
-        let _ = intrinsics::const_allocate(4, 3) as *mut i32; //~ inside `foo`
+        let _ = intrinsics::const_allocate(4, 3) as *mut i32; //~ NOTE inside `foo`
     }
     1
 }
diff --git a/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr b/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr
index e1cb7a8..9f7546d 100644
--- a/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr
+++ b/tests/ui/consts/const-eval/heap/alloc_intrinsic_errors.stderr
@@ -1,11 +1,11 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/alloc_intrinsic_errors.rs:5:18
+  --> $DIR/alloc_intrinsic_errors.rs:7:18
    |
 LL | const FOO: i32 = foo();
    |                  ^^^^^ invalid align passed to `const_allocate`: 3 is not a power of 2
    |
 note: inside `foo`
-  --> $DIR/alloc_intrinsic_errors.rs:8:17
+  --> $DIR/alloc_intrinsic_errors.rs:10:17
    |
 LL |         let _ = intrinsics::const_allocate(4, 3) as *mut i32;
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the failure occurred here
diff --git a/tests/ui/consts/const-eval/issue-44578.rs b/tests/ui/consts/const-eval/issue-44578.rs
index 945bf93..565e1d3 100644
--- a/tests/ui/consts/const-eval/issue-44578.rs
+++ b/tests/ui/consts/const-eval/issue-44578.rs
@@ -1,4 +1,5 @@
 //@ build-fail
+//@ dont-require-annotations: NOTE
 
 trait Foo {
     const AMT: usize;
@@ -23,5 +24,5 @@ impl Foo for u16 {
 
 fn main() {
     println!("{}", <Bar<u16, u8> as Foo>::AMT);
-    //~^ constant
+    //~^ NOTE constant
 }
diff --git a/tests/ui/consts/const-eval/issue-44578.stderr b/tests/ui/consts/const-eval/issue-44578.stderr
index 7d5cf86..5093cec 100644
--- a/tests/ui/consts/const-eval/issue-44578.stderr
+++ b/tests/ui/consts/const-eval/issue-44578.stderr
@@ -1,17 +1,17 @@
 error[E0080]: evaluation of `<Bar<u16, u8> as Foo>::AMT` failed
-  --> $DIR/issue-44578.rs:13:24
+  --> $DIR/issue-44578.rs:14:24
    |
 LL |     const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize];
    |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 1
 
 note: erroneous constant encountered
-  --> $DIR/issue-44578.rs:25:20
+  --> $DIR/issue-44578.rs:26:20
    |
 LL |     println!("{}", <Bar<u16, u8> as Foo>::AMT);
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 note: erroneous constant encountered
-  --> $DIR/issue-44578.rs:25:20
+  --> $DIR/issue-44578.rs:26:20
    |
 LL |     println!("{}", <Bar<u16, u8> as Foo>::AMT);
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -19,7 +19,7 @@
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: erroneous constant encountered
-  --> $DIR/issue-44578.rs:25:20
+  --> $DIR/issue-44578.rs:26:20
    |
 LL |     println!("{}", <Bar<u16, u8> as Foo>::AMT);
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -27,7 +27,7 @@
    = note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 note: erroneous constant encountered
-  --> $DIR/issue-44578.rs:25:20
+  --> $DIR/issue-44578.rs:26:20
    |
 LL |     println!("{}", <Bar<u16, u8> as Foo>::AMT);
    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/consts/const-eval/issue-50814-2.mir-opt.stderr b/tests/ui/consts/const-eval/issue-50814-2.mir-opt.stderr
index 2de68d3..1f4f217 100644
--- a/tests/ui/consts/const-eval/issue-50814-2.mir-opt.stderr
+++ b/tests/ui/consts/const-eval/issue-50814-2.mir-opt.stderr
@@ -1,23 +1,23 @@
 error[E0080]: evaluation of `<A<()> as Foo<()>>::BAR` failed
-  --> $DIR/issue-50814-2.rs:16:24
+  --> $DIR/issue-50814-2.rs:17:24
    |
 LL |     const BAR: usize = [5, 6, 7][T::BOO];
    |                        ^^^^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 42
 
 note: erroneous constant encountered
-  --> $DIR/issue-50814-2.rs:20:6
+  --> $DIR/issue-50814-2.rs:21:6
    |
 LL |     &<A<T> as Foo<T>>::BAR
    |      ^^^^^^^^^^^^^^^^^^^^^
 
 note: erroneous constant encountered
-  --> $DIR/issue-50814-2.rs:20:5
+  --> $DIR/issue-50814-2.rs:21:5
    |
 LL |     &<A<T> as Foo<T>>::BAR
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 note: erroneous constant encountered
-  --> $DIR/issue-50814-2.rs:20:5
+  --> $DIR/issue-50814-2.rs:21:5
    |
 LL |     &<A<T> as Foo<T>>::BAR
    |     ^^^^^^^^^^^^^^^^^^^^^^
@@ -25,7 +25,7 @@
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: erroneous constant encountered
-  --> $DIR/issue-50814-2.rs:20:5
+  --> $DIR/issue-50814-2.rs:21:5
    |
 LL |     &<A<T> as Foo<T>>::BAR
    |     ^^^^^^^^^^^^^^^^^^^^^^
@@ -33,7 +33,7 @@
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: erroneous constant encountered
-  --> $DIR/issue-50814-2.rs:20:5
+  --> $DIR/issue-50814-2.rs:21:5
    |
 LL |     &<A<T> as Foo<T>>::BAR
    |     ^^^^^^^^^^^^^^^^^^^^^^
@@ -41,7 +41,7 @@
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: erroneous constant encountered
-  --> $DIR/issue-50814-2.rs:20:6
+  --> $DIR/issue-50814-2.rs:21:6
    |
 LL |     &<A<T> as Foo<T>>::BAR
    |      ^^^^^^^^^^^^^^^^^^^^^
@@ -49,7 +49,7 @@
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: erroneous constant encountered
-  --> $DIR/issue-50814-2.rs:20:6
+  --> $DIR/issue-50814-2.rs:21:6
    |
 LL |     &<A<T> as Foo<T>>::BAR
    |      ^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/consts/const-eval/issue-50814-2.normal.stderr b/tests/ui/consts/const-eval/issue-50814-2.normal.stderr
index 4a7dfb1..f790862 100644
--- a/tests/ui/consts/const-eval/issue-50814-2.normal.stderr
+++ b/tests/ui/consts/const-eval/issue-50814-2.normal.stderr
@@ -1,23 +1,23 @@
 error[E0080]: evaluation of `<A<()> as Foo<()>>::BAR` failed
-  --> $DIR/issue-50814-2.rs:16:24
+  --> $DIR/issue-50814-2.rs:17:24
    |
 LL |     const BAR: usize = [5, 6, 7][T::BOO];
    |                        ^^^^^^^^^^^^^^^^^ index out of bounds: the length is 3 but the index is 42
 
 note: erroneous constant encountered
-  --> $DIR/issue-50814-2.rs:20:6
+  --> $DIR/issue-50814-2.rs:21:6
    |
 LL |     &<A<T> as Foo<T>>::BAR
    |      ^^^^^^^^^^^^^^^^^^^^^
 
 note: erroneous constant encountered
-  --> $DIR/issue-50814-2.rs:20:5
+  --> $DIR/issue-50814-2.rs:21:5
    |
 LL |     &<A<T> as Foo<T>>::BAR
    |     ^^^^^^^^^^^^^^^^^^^^^^
 
 note: erroneous constant encountered
-  --> $DIR/issue-50814-2.rs:20:6
+  --> $DIR/issue-50814-2.rs:21:6
    |
 LL |     &<A<T> as Foo<T>>::BAR
    |      ^^^^^^^^^^^^^^^^^^^^^
@@ -25,7 +25,7 @@
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: the above error was encountered while instantiating `fn foo::<()>`
-  --> $DIR/issue-50814-2.rs:32:22
+  --> $DIR/issue-50814-2.rs:33:22
    |
 LL |     println!("{:x}", foo::<()>() as *const usize as usize);
    |                      ^^^^^^^^^^^
diff --git a/tests/ui/consts/const-eval/issue-50814-2.rs b/tests/ui/consts/const-eval/issue-50814-2.rs
index c2e2de6..261dcd3 100644
--- a/tests/ui/consts/const-eval/issue-50814-2.rs
+++ b/tests/ui/consts/const-eval/issue-50814-2.rs
@@ -1,6 +1,7 @@
 //@ build-fail
 //@ revisions: normal mir-opt
 //@ [mir-opt]compile-flags: -Zmir-opt-level=4
+//@ dont-require-annotations: NOTE
 
 trait C {
     const BOO: usize;
@@ -17,7 +18,7 @@ impl<T: C> Foo<T> for A<T> {
 }
 
 fn foo<T: C>() -> &'static usize {
-    &<A<T> as Foo<T>>::BAR //~ constant
+    &<A<T> as Foo<T>>::BAR //~ NOTE constant
 }
 
 impl C for () {
diff --git a/tests/ui/consts/const-eval/issue-50814.rs b/tests/ui/consts/const-eval/issue-50814.rs
index 27b5b39..5495fb4 100644
--- a/tests/ui/consts/const-eval/issue-50814.rs
+++ b/tests/ui/consts/const-eval/issue-50814.rs
@@ -1,4 +1,5 @@
 //@ build-fail
+//@ dont-require-annotations: NOTE
 
 trait Unsigned {
     const MAX: u8;
@@ -19,7 +20,7 @@ impl<A: Unsigned, B: Unsigned> Unsigned for Sum<A, B> {
 
 fn foo<T>(_: T) -> &'static u8 {
     &Sum::<U8, U8>::MAX
-    //~^ constant
+    //~^ NOTE constant
 }
 
 fn main() {
diff --git a/tests/ui/consts/const-eval/issue-50814.stderr b/tests/ui/consts/const-eval/issue-50814.stderr
index fe0e25b..5b23c48 100644
--- a/tests/ui/consts/const-eval/issue-50814.stderr
+++ b/tests/ui/consts/const-eval/issue-50814.stderr
@@ -1,17 +1,17 @@
 error[E0080]: evaluation of `<Sum<U8, U8> as Unsigned>::MAX` failed
-  --> $DIR/issue-50814.rs:15:21
+  --> $DIR/issue-50814.rs:16:21
    |
 LL |     const MAX: u8 = A::MAX + B::MAX;
    |                     ^^^^^^^^^^^^^^^ attempt to compute `u8::MAX + u8::MAX`, which would overflow
 
 note: erroneous constant encountered
-  --> $DIR/issue-50814.rs:21:6
+  --> $DIR/issue-50814.rs:22:6
    |
 LL |     &Sum::<U8, U8>::MAX
    |      ^^^^^^^^^^^^^^^^^^
 
 error[E0080]: evaluation of `<Sum<U8, U8> as Unsigned>::MAX` failed
-  --> $DIR/issue-50814.rs:15:21
+  --> $DIR/issue-50814.rs:16:21
    |
 LL |     const MAX: u8 = A::MAX + B::MAX;
    |                     ^^^^^^^^^^^^^^^ attempt to compute `u8::MAX + u8::MAX`, which would overflow
@@ -19,7 +19,7 @@
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: erroneous constant encountered
-  --> $DIR/issue-50814.rs:21:6
+  --> $DIR/issue-50814.rs:22:6
    |
 LL |     &Sum::<U8, U8>::MAX
    |      ^^^^^^^^^^^^^^^^^^
@@ -27,13 +27,13 @@
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: erroneous constant encountered
-  --> $DIR/issue-50814.rs:21:5
+  --> $DIR/issue-50814.rs:22:5
    |
 LL |     &Sum::<U8, U8>::MAX
    |     ^^^^^^^^^^^^^^^^^^^
 
 note: erroneous constant encountered
-  --> $DIR/issue-50814.rs:21:6
+  --> $DIR/issue-50814.rs:22:6
    |
 LL |     &Sum::<U8, U8>::MAX
    |      ^^^^^^^^^^^^^^^^^^
@@ -41,7 +41,7 @@
    = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 note: the above error was encountered while instantiating `fn foo::<i32>`
-  --> $DIR/issue-50814.rs:26:5
+  --> $DIR/issue-50814.rs:27:5
    |
 LL |     foo(0);
    |     ^^^^^^
diff --git a/tests/ui/consts/const-eval/panic-assoc-never-type.rs b/tests/ui/consts/const-eval/panic-assoc-never-type.rs
index bdaa514..79b5daf 100644
--- a/tests/ui/consts/const-eval/panic-assoc-never-type.rs
+++ b/tests/ui/consts/const-eval/panic-assoc-never-type.rs
@@ -1,4 +1,5 @@
 //@ build-fail
+//@ dont-require-annotations: NOTE
 
 // Regression test for #66975
 #![feature(never_type)]
@@ -11,5 +12,5 @@ impl PrintName {
 }
 
 fn main() {
-    let _ = PrintName::VOID; //~ erroneous constant encountered
+    let _ = PrintName::VOID; //~ NOTE erroneous constant encountered
 }
diff --git a/tests/ui/consts/const-eval/panic-assoc-never-type.stderr b/tests/ui/consts/const-eval/panic-assoc-never-type.stderr
index 71b33d8..03413f4 100644
--- a/tests/ui/consts/const-eval/panic-assoc-never-type.stderr
+++ b/tests/ui/consts/const-eval/panic-assoc-never-type.stderr
@@ -1,17 +1,17 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/panic-assoc-never-type.rs:9:21
+  --> $DIR/panic-assoc-never-type.rs:10:21
    |
 LL |     const VOID: ! = panic!();
    |                     ^^^^^^^^ evaluation panicked: explicit panic
 
 note: erroneous constant encountered
-  --> $DIR/panic-assoc-never-type.rs:14:13
+  --> $DIR/panic-assoc-never-type.rs:15:13
    |
 LL |     let _ = PrintName::VOID;
    |             ^^^^^^^^^^^^^^^
 
 note: erroneous constant encountered
-  --> $DIR/panic-assoc-never-type.rs:14:13
+  --> $DIR/panic-assoc-never-type.rs:15:13
    |
 LL |     let _ = PrintName::VOID;
    |             ^^^^^^^^^^^^^^^
diff --git a/tests/ui/consts/const-eval/raw-bytes.32bit.stderr b/tests/ui/consts/const-eval/raw-bytes.32bit.stderr
index 27c85cc..120a08a 100644
--- a/tests/ui/consts/const-eval/raw-bytes.32bit.stderr
+++ b/tests/ui/consts/const-eval/raw-bytes.32bit.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:21:1
+  --> $DIR/raw-bytes.rs:23:1
    |
 LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
    | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x00000001, but expected a valid enum tag
@@ -10,7 +10,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:29:1
+  --> $DIR/raw-bytes.rs:31:1
    |
 LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x00000000, but expected a valid enum tag
@@ -21,7 +21,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:43:1
+  --> $DIR/raw-bytes.rs:45:1
    |
 LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered an uninhabited enum variant
@@ -32,7 +32,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:45:1
+  --> $DIR/raw-bytes.rs:47:1
    |
 LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered an uninhabited enum variant
@@ -43,7 +43,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:51:1
+  --> $DIR/raw-bytes.rs:53:1
    |
 LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) }));
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
@@ -54,7 +54,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:56:1
+  --> $DIR/raw-bytes.rs:58:1
    |
 LL | const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
@@ -65,7 +65,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:59:1
+  --> $DIR/raw-bytes.rs:61:1
    |
 LL | const NULL_U8: NonZero<u8> = unsafe { mem::transmute(0u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1
@@ -76,7 +76,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:61:1
+  --> $DIR/raw-bytes.rs:63:1
    |
 LL | const NULL_USIZE: NonZero<usize> = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1
@@ -87,7 +87,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:67:1
+  --> $DIR/raw-bytes.rs:69:1
    |
 LL | const BAD_RANGE1: RestrictedRange1 = unsafe { RestrictedRange1(42) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 42, but expected something in the range 10..=30
@@ -98,7 +98,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:73:1
+  --> $DIR/raw-bytes.rs:75:1
    |
 LL | const BAD_RANGE2: RestrictedRange2 = unsafe { RestrictedRange2(20) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 20, but expected something less or equal to 10, or greater or equal to 30
@@ -109,7 +109,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:76:1
+  --> $DIR/raw-bytes.rs:78:1
    |
 LL | const NULL_FAT_PTR: NonNull<dyn Send> = unsafe {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
@@ -120,7 +120,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:84:1
+  --> $DIR/raw-bytes.rs:86:1
    |
 LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
    | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
@@ -131,7 +131,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:88:1
+  --> $DIR/raw-bytes.rs:90:1
    |
 LL | const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
@@ -142,7 +142,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:92:1
+  --> $DIR/raw-bytes.rs:94:1
    |
 LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference
@@ -153,7 +153,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:95:1
+  --> $DIR/raw-bytes.rs:97:1
    |
 LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box
@@ -164,7 +164,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:98:1
+  --> $DIR/raw-bytes.rs:100:1
    |
 LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (0x539[noalloc] has no provenance)
@@ -175,7 +175,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:101:1
+  --> $DIR/raw-bytes.rs:103:1
    |
 LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (0x539[noalloc] has no provenance)
@@ -186,7 +186,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:104:1
+  --> $DIR/raw-bytes.rs:106:1
    |
 LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a function pointer
@@ -197,7 +197,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:106:1
+  --> $DIR/raw-bytes.rs:108:1
    |
 LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0xd[noalloc], but expected a function pointer
@@ -208,7 +208,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:108:1
+  --> $DIR/raw-bytes.rs:110:1
    |
 LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
    | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC3<imm>, but expected a function pointer
@@ -219,7 +219,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:114:1
+  --> $DIR/raw-bytes.rs:116:1
    |
 LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar
@@ -230,7 +230,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:139:1
+  --> $DIR/raw-bytes.rs:141:1
    |
 LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
@@ -241,7 +241,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:141:1
+  --> $DIR/raw-bytes.rs:143:1
    |
 LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -252,7 +252,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:143:1
+  --> $DIR/raw-bytes.rs:145:1
    |
 LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -263,7 +263,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:146:1
+  --> $DIR/raw-bytes.rs:148:1
    |
 LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
    | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized memory, but expected a string
@@ -274,7 +274,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:148:1
+  --> $DIR/raw-bytes.rs:150:1
    |
 LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered uninitialized memory, but expected a string
@@ -285,7 +285,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:150:1
+  --> $DIR/raw-bytes.rs:152:1
    |
 LL | const MYSTR_NO_INIT_ISSUE83182: &MyStr = unsafe { mem::transmute::<&[_], _>(&[&()]) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered a pointer, but expected a string
@@ -298,7 +298,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:154:1
+  --> $DIR/raw-bytes.rs:156:1
    |
 LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
@@ -309,7 +309,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:156:1
+  --> $DIR/raw-bytes.rs:158:1
    |
 LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -320,7 +320,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:159:1
+  --> $DIR/raw-bytes.rs:161:1
    |
 LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation)
@@ -331,7 +331,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:162:1
+  --> $DIR/raw-bytes.rs:164:1
    |
 LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
@@ -342,13 +342,13 @@
            }
 
 note: erroneous constant encountered
-  --> $DIR/raw-bytes.rs:162:40
+  --> $DIR/raw-bytes.rs:164:40
    |
 LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:168:1
+  --> $DIR/raw-bytes.rs:170:1
    |
 LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered 0x03, but expected a boolean
@@ -359,13 +359,13 @@
            }
 
 note: erroneous constant encountered
-  --> $DIR/raw-bytes.rs:168:42
+  --> $DIR/raw-bytes.rs:170:42
    |
 LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:172:1
+  --> $DIR/raw-bytes.rs:174:1
    |
 LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.1[0]: encountered 0x03, but expected a boolean
@@ -376,13 +376,13 @@
            }
 
 note: erroneous constant encountered
-  --> $DIR/raw-bytes.rs:172:42
+  --> $DIR/raw-bytes.rs:174:42
    |
 LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:177:1
+  --> $DIR/raw-bytes.rs:179:1
    |
 LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC17<imm>, but expected a vtable pointer
@@ -393,7 +393,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:181:1
+  --> $DIR/raw-bytes.rs:183:1
    |
 LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC19<imm>, but expected a vtable pointer
@@ -404,7 +404,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:185:1
+  --> $DIR/raw-bytes.rs:187:1
    |
 LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0x4[noalloc], but expected a vtable pointer
@@ -415,7 +415,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:188:1
+  --> $DIR/raw-bytes.rs:190:1
    |
 LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC22<imm>, but expected a vtable pointer
@@ -426,7 +426,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:192:1
+  --> $DIR/raw-bytes.rs:194:1
    |
 LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
@@ -437,7 +437,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:196:1
+  --> $DIR/raw-bytes.rs:198:1
    |
 LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer
@@ -448,7 +448,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:199:1
+  --> $DIR/raw-bytes.rs:201:1
    |
 LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC27<imm>, but expected a vtable pointer
@@ -459,7 +459,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:204:1
+  --> $DIR/raw-bytes.rs:206:1
    |
 LL | const _: &[!; 1] = unsafe { &*(1_usize as *const [!; 1]) };
    | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type [!; 1]
@@ -470,7 +470,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:205:1
+  --> $DIR/raw-bytes.rs:207:1
    |
 LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 1]) };
    | ^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a value of the never type `!`
@@ -481,7 +481,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:206:1
+  --> $DIR/raw-bytes.rs:208:1
    |
 LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 42]) };
    | ^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a value of the never type `!`
@@ -492,7 +492,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:210:1
+  --> $DIR/raw-bytes.rs:212:1
    |
 LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) };
    | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized memory, but expected an integer
@@ -503,7 +503,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:213:1
+  --> $DIR/raw-bytes.rs:215:1
    |
 LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, mem::size_of::<&u32>()) };
    | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a pointer, but expected an integer
@@ -516,7 +516,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:216:1
+  --> $DIR/raw-bytes.rs:218:1
    |
 LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) };
    | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
@@ -527,7 +527,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:220:1
+  --> $DIR/raw-bytes.rs:222:1
    |
 LL | pub static S7: &[u16] = unsafe {
    | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[1]: encountered uninitialized memory, but expected an integer
@@ -538,7 +538,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:227:1
+  --> $DIR/raw-bytes.rs:229:1
    |
 LL | pub static R4: &[u8] = unsafe {
    | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized memory, but expected an integer
@@ -549,7 +549,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:232:1
+  --> $DIR/raw-bytes.rs:234:1
    |
 LL | pub static R5: &[u8] = unsafe {
    | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a pointer, but expected an integer
@@ -562,7 +562,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:237:1
+  --> $DIR/raw-bytes.rs:239:1
    |
 LL | pub static R6: &[bool] = unsafe {
    | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
diff --git a/tests/ui/consts/const-eval/raw-bytes.64bit.stderr b/tests/ui/consts/const-eval/raw-bytes.64bit.stderr
index 2b0ce99..d54ad7c 100644
--- a/tests/ui/consts/const-eval/raw-bytes.64bit.stderr
+++ b/tests/ui/consts/const-eval/raw-bytes.64bit.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:21:1
+  --> $DIR/raw-bytes.rs:23:1
    |
 LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
    | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x0000000000000001, but expected a valid enum tag
@@ -10,7 +10,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:29:1
+  --> $DIR/raw-bytes.rs:31:1
    |
 LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x0000000000000000, but expected a valid enum tag
@@ -21,7 +21,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:43:1
+  --> $DIR/raw-bytes.rs:45:1
    |
 LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered an uninhabited enum variant
@@ -32,7 +32,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:45:1
+  --> $DIR/raw-bytes.rs:47:1
    |
 LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered an uninhabited enum variant
@@ -43,7 +43,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:51:1
+  --> $DIR/raw-bytes.rs:53:1
    |
 LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) }));
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
@@ -54,7 +54,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:56:1
+  --> $DIR/raw-bytes.rs:58:1
    |
 LL | const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
@@ -65,7 +65,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:59:1
+  --> $DIR/raw-bytes.rs:61:1
    |
 LL | const NULL_U8: NonZero<u8> = unsafe { mem::transmute(0u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1
@@ -76,7 +76,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:61:1
+  --> $DIR/raw-bytes.rs:63:1
    |
 LL | const NULL_USIZE: NonZero<usize> = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1
@@ -87,7 +87,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:67:1
+  --> $DIR/raw-bytes.rs:69:1
    |
 LL | const BAD_RANGE1: RestrictedRange1 = unsafe { RestrictedRange1(42) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 42, but expected something in the range 10..=30
@@ -98,7 +98,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:73:1
+  --> $DIR/raw-bytes.rs:75:1
    |
 LL | const BAD_RANGE2: RestrictedRange2 = unsafe { RestrictedRange2(20) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 20, but expected something less or equal to 10, or greater or equal to 30
@@ -109,7 +109,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:76:1
+  --> $DIR/raw-bytes.rs:78:1
    |
 LL | const NULL_FAT_PTR: NonNull<dyn Send> = unsafe {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
@@ -120,7 +120,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:84:1
+  --> $DIR/raw-bytes.rs:86:1
    |
 LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
    | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
@@ -131,7 +131,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:88:1
+  --> $DIR/raw-bytes.rs:90:1
    |
 LL | const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
@@ -142,7 +142,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:92:1
+  --> $DIR/raw-bytes.rs:94:1
    |
 LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference
@@ -153,7 +153,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:95:1
+  --> $DIR/raw-bytes.rs:97:1
    |
 LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box
@@ -164,7 +164,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:98:1
+  --> $DIR/raw-bytes.rs:100:1
    |
 LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (0x539[noalloc] has no provenance)
@@ -175,7 +175,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:101:1
+  --> $DIR/raw-bytes.rs:103:1
    |
 LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (0x539[noalloc] has no provenance)
@@ -186,7 +186,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:104:1
+  --> $DIR/raw-bytes.rs:106:1
    |
 LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a function pointer
@@ -197,7 +197,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:106:1
+  --> $DIR/raw-bytes.rs:108:1
    |
 LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0xd[noalloc], but expected a function pointer
@@ -208,7 +208,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:108:1
+  --> $DIR/raw-bytes.rs:110:1
    |
 LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
    | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC3<imm>, but expected a function pointer
@@ -219,7 +219,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:114:1
+  --> $DIR/raw-bytes.rs:116:1
    |
 LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar
@@ -230,7 +230,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:139:1
+  --> $DIR/raw-bytes.rs:141:1
    |
 LL | const STR_TOO_LONG: &str = unsafe { mem::transmute((&42u8, 999usize)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
@@ -241,7 +241,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:141:1
+  --> $DIR/raw-bytes.rs:143:1
    |
 LL | const NESTED_STR_MUCH_TOO_LONG: (&str,) = (unsafe { mem::transmute((&42, usize::MAX)) },);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -252,7 +252,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:143:1
+  --> $DIR/raw-bytes.rs:145:1
    |
 LL | const MY_STR_MUCH_TOO_LONG: &MyStr = unsafe { mem::transmute((&42u8, usize::MAX)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -263,7 +263,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:146:1
+  --> $DIR/raw-bytes.rs:148:1
    |
 LL | const STR_NO_INIT: &str = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
    | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered uninitialized memory, but expected a string
@@ -274,7 +274,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:148:1
+  --> $DIR/raw-bytes.rs:150:1
    |
 LL | const MYSTR_NO_INIT: &MyStr = unsafe { mem::transmute::<&[_], _>(&[MaybeUninit::<u8> { uninit: () }]) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered uninitialized memory, but expected a string
@@ -285,7 +285,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:150:1
+  --> $DIR/raw-bytes.rs:152:1
    |
 LL | const MYSTR_NO_INIT_ISSUE83182: &MyStr = unsafe { mem::transmute::<&[_], _>(&[&()]) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered a pointer, but expected a string
@@ -298,7 +298,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:154:1
+  --> $DIR/raw-bytes.rs:156:1
    |
 LL | const SLICE_TOO_LONG: &[u8] = unsafe { mem::transmute((&42u8, 999usize)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (going beyond the bounds of its allocation)
@@ -309,7 +309,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:156:1
+  --> $DIR/raw-bytes.rs:158:1
    |
 LL | const SLICE_TOO_LONG_OVERFLOW: &[u32] = unsafe { mem::transmute((&42u32, isize::MAX)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered invalid reference metadata: slice is bigger than largest supported object
@@ -320,7 +320,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:159:1
+  --> $DIR/raw-bytes.rs:161:1
    |
 LL | const SLICE_TOO_LONG_BOX: Box<[u8]> = unsafe { mem::transmute((&42u8, 999usize)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (going beyond the bounds of its allocation)
@@ -331,7 +331,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:162:1
+  --> $DIR/raw-bytes.rs:164:1
    |
 LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x03, but expected a boolean
@@ -342,13 +342,13 @@
            }
 
 note: erroneous constant encountered
-  --> $DIR/raw-bytes.rs:162:40
+  --> $DIR/raw-bytes.rs:164:40
    |
 LL | const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
    |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:168:1
+  --> $DIR/raw-bytes.rs:170:1
    |
 LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.0: encountered 0x03, but expected a boolean
@@ -359,13 +359,13 @@
            }
 
 note: erroneous constant encountered
-  --> $DIR/raw-bytes.rs:168:42
+  --> $DIR/raw-bytes.rs:170:42
    |
 LL | const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:172:1
+  --> $DIR/raw-bytes.rs:174:1
    |
 LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.1[0]: encountered 0x03, but expected a boolean
@@ -376,13 +376,13 @@
            }
 
 note: erroneous constant encountered
-  --> $DIR/raw-bytes.rs:172:42
+  --> $DIR/raw-bytes.rs:174:42
    |
 LL | const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:177:1
+  --> $DIR/raw-bytes.rs:179:1
    |
 LL | const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC17<imm>, but expected a vtable pointer
@@ -393,7 +393,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:181:1
+  --> $DIR/raw-bytes.rs:183:1
    |
 LL | const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC19<imm>, but expected a vtable pointer
@@ -404,7 +404,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:185:1
+  --> $DIR/raw-bytes.rs:187:1
    |
 LL | const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0x4[noalloc], but expected a vtable pointer
@@ -415,7 +415,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:188:1
+  --> $DIR/raw-bytes.rs:190:1
    |
 LL | const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered ALLOC22<imm>, but expected a vtable pointer
@@ -426,7 +426,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:192:1
+  --> $DIR/raw-bytes.rs:194:1
    |
 LL | const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>: encountered 0x03, but expected a boolean
@@ -437,7 +437,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:196:1
+  --> $DIR/raw-bytes.rs:198:1
    |
 LL | const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a vtable pointer
@@ -448,7 +448,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:199:1
+  --> $DIR/raw-bytes.rs:201:1
    |
 LL | const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC27<imm>, but expected a vtable pointer
@@ -459,7 +459,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:204:1
+  --> $DIR/raw-bytes.rs:206:1
    |
 LL | const _: &[!; 1] = unsafe { &*(1_usize as *const [!; 1]) };
    | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type [!; 1]
@@ -470,7 +470,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:205:1
+  --> $DIR/raw-bytes.rs:207:1
    |
 LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 1]) };
    | ^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a value of the never type `!`
@@ -481,7 +481,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:206:1
+  --> $DIR/raw-bytes.rs:208:1
    |
 LL | const _: &[!] = unsafe { &*(1_usize as *const [!; 42]) };
    | ^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a value of the never type `!`
@@ -492,7 +492,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:210:1
+  --> $DIR/raw-bytes.rs:212:1
    |
 LL | pub static S4: &[u8] = unsafe { from_raw_parts((&D1) as *const _ as _, 1) };
    | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized memory, but expected an integer
@@ -503,7 +503,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:213:1
+  --> $DIR/raw-bytes.rs:215:1
    |
 LL | pub static S5: &[u8] = unsafe { from_raw_parts((&D3) as *const _ as _, mem::size_of::<&u32>()) };
    | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a pointer, but expected an integer
@@ -516,7 +516,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:216:1
+  --> $DIR/raw-bytes.rs:218:1
    |
 LL | pub static S6: &[bool] = unsafe { from_raw_parts((&D0) as *const _ as _, 4) };
    | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
@@ -527,7 +527,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:220:1
+  --> $DIR/raw-bytes.rs:222:1
    |
 LL | pub static S7: &[u16] = unsafe {
    | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[1]: encountered uninitialized memory, but expected an integer
@@ -538,7 +538,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:227:1
+  --> $DIR/raw-bytes.rs:229:1
    |
 LL | pub static R4: &[u8] = unsafe {
    | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered uninitialized memory, but expected an integer
@@ -549,7 +549,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:232:1
+  --> $DIR/raw-bytes.rs:234:1
    |
 LL | pub static R5: &[u8] = unsafe {
    | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered a pointer, but expected an integer
@@ -562,7 +562,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/raw-bytes.rs:237:1
+  --> $DIR/raw-bytes.rs:239:1
    |
 LL | pub static R6: &[bool] = unsafe {
    | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>[0]: encountered 0x11, but expected a boolean
diff --git a/tests/ui/consts/const-eval/raw-bytes.rs b/tests/ui/consts/const-eval/raw-bytes.rs
index 20f1a9a..1a585d5 100644
--- a/tests/ui/consts/const-eval/raw-bytes.rs
+++ b/tests/ui/consts/const-eval/raw-bytes.rs
@@ -2,6 +2,8 @@
 //@ ignore-endian-big
 // ignore-tidy-linelength
 //@ normalize-stderr: "╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼" -> "╾ALLOC_ID$1╼"
+//@ dont-require-annotations: NOTE
+
 #![allow(invalid_value, unnecessary_transmutes)]
 #![feature(never_type, rustc_attrs, ptr_metadata, slice_from_ptr_range, const_slice_from_ptr_range)]
 
@@ -83,11 +85,11 @@ enum UninhDiscriminant {
 
 const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
 //~^ ERROR it is undefined behavior to use this value
-//~| constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
+//~| NOTE constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
 
 const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
 //~^ ERROR it is undefined behavior to use this value
-//~| constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
+//~| NOTE constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
 
 const NULL: &u16 = unsafe { mem::transmute(0usize) };
 //~^ ERROR it is undefined behavior to use this value
@@ -161,44 +163,44 @@ impl Trait for bool {}
 // bad data *inside* the slice
 const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
 //~^ ERROR it is undefined behavior to use this value
-//~| constant
+//~| NOTE constant
 
 
 // bad: sized field is not okay
 const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
 //~^ ERROR it is undefined behavior to use this value
-//~| constant
+//~| NOTE constant
 // bad: unsized part is not okay
 const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
 //~^ ERROR it is undefined behavior to use this value
-//~| constant
+//~| NOTE constant
 
 // bad trait object
 const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
 //~^ ERROR it is undefined behavior to use this value
-//~| expected a vtable
+//~| NOTE expected a vtable
 // bad trait object
 const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
 //~^ ERROR it is undefined behavior to use this value
-//~| expected a vtable
+//~| NOTE expected a vtable
 // bad trait object
 const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
 //~^ ERROR it is undefined behavior to use this value
-//~| expected a vtable
+//~| NOTE expected a vtable
 const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
 //~^ ERROR it is undefined behavior to use this value
-//~| expected a vtable
+//~| NOTE expected a vtable
 // bad data *inside* the trait object
 const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
 //~^ ERROR it is undefined behavior to use this value
-//~| expected a boolean
+//~| NOTE expected a boolean
 
 const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
 //~^ ERROR it is undefined behavior to use this value
-//~| null pointer
+//~| NOTE null pointer
 const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
 //~^ ERROR it is undefined behavior to use this value
-//~| vtable
+//~| NOTE vtable
 
 // Uninhabited types
 const _: &[!; 1] = unsafe { &*(1_usize as *const [!; 1]) }; //~ ERROR undefined behavior
diff --git a/tests/ui/consts/const-eval/ub-enum.rs b/tests/ui/consts/const-eval/ub-enum.rs
index a5255ef..ac54343 100644
--- a/tests/ui/consts/const-eval/ub-enum.rs
+++ b/tests/ui/consts/const-eval/ub-enum.rs
@@ -2,6 +2,8 @@
 //@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
 //@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
 //@ normalize-stderr: "0x0+" -> "0x0"
+//@ dont-require-annotations: NOTE
+
 #![feature(never_type)]
 #![allow(invalid_value, unnecessary_transmutes)]
 
@@ -58,7 +60,7 @@ union MaybeUninit<T: Copy> {
 }
 const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init };
 //~^ ERROR evaluation of constant value failed
-//~| uninitialized
+//~| NOTE uninitialized
 
 // Pointer value in an enum with a niche that is not just 0.
 const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
diff --git a/tests/ui/consts/const-eval/ub-enum.stderr b/tests/ui/consts/const-eval/ub-enum.stderr
index cfb7eaf..faec412 100644
--- a/tests/ui/consts/const-eval/ub-enum.stderr
+++ b/tests/ui/consts/const-eval/ub-enum.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:27:1
+  --> $DIR/ub-enum.rs:29:1
    |
 LL | const BAD_ENUM: Enum = unsafe { mem::transmute(1usize) };
    | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x01, but expected a valid enum tag
@@ -10,7 +10,7 @@
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-enum.rs:30:1
+  --> $DIR/ub-enum.rs:32:1
    |
 LL | const BAD_ENUM_PTR: Enum = unsafe { mem::transmute(&1) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -19,7 +19,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-enum.rs:33:1
+  --> $DIR/ub-enum.rs:35:1
    |
 LL | const BAD_ENUM_WRAPPED: Wrap<Enum> = unsafe { mem::transmute(&1) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -28,7 +28,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:45:1
+  --> $DIR/ub-enum.rs:47:1
    |
 LL | const BAD_ENUM2: Enum2 = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered 0x0, but expected a valid enum tag
@@ -39,7 +39,7 @@
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-enum.rs:47:1
+  --> $DIR/ub-enum.rs:49:1
    |
 LL | const BAD_ENUM2_PTR: Enum2 = unsafe { mem::transmute(&0) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -48,7 +48,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-enum.rs:50:1
+  --> $DIR/ub-enum.rs:52:1
    |
 LL | const BAD_ENUM2_WRAPPED: Wrap<Enum2> = unsafe { mem::transmute(&0) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -57,13 +57,13 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-enum.rs:59:42
+  --> $DIR/ub-enum.rs:61:42
    |
 LL | const BAD_ENUM2_UNDEF : Enum2 = unsafe { MaybeUninit { uninit: () }.init };
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-enum.rs:64:1
+  --> $DIR/ub-enum.rs:66:1
    |
 LL | const BAD_ENUM2_OPTION_PTR: Option<Enum2> = unsafe { mem::transmute(&0) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -72,7 +72,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:81:1
+  --> $DIR/ub-enum.rs:83:1
    |
 LL | const BAD_UNINHABITED_VARIANT1: UninhDiscriminant = unsafe { mem::transmute(1u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered an uninhabited enum variant
@@ -83,7 +83,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:83:1
+  --> $DIR/ub-enum.rs:85:1
    |
 LL | const BAD_UNINHABITED_VARIANT2: UninhDiscriminant = unsafe { mem::transmute(3u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered an uninhabited enum variant
@@ -94,7 +94,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-enum.rs:91:1
+  --> $DIR/ub-enum.rs:93:1
    |
 LL | const BAD_OPTION_CHAR: Option<(char, char)> = Some(('x', unsafe { mem::transmute(!0u32) }));
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0.1: encountered 0xffffffff, but expected a valid unicode scalar value (in `0..=0x10FFFF` but not in `0xD800..=0xDFFF`)
@@ -105,19 +105,19 @@
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-enum.rs:96:77
+  --> $DIR/ub-enum.rs:98:77
    |
 LL | const BAD_UNINHABITED_WITH_DATA1: Result<(i32, Never), (i32, !)> = unsafe { mem::transmute(0u64) };
    |                                                                             ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered an uninhabited enum variant
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-enum.rs:98:77
+  --> $DIR/ub-enum.rs:100:77
    |
 LL | const BAD_UNINHABITED_WITH_DATA2: Result<(i32, !), (i32, Never)> = unsafe { mem::transmute(0u64) };
    |                                                                             ^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-tag>: encountered an uninhabited enum variant
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-enum.rs:103:14
+  --> $DIR/ub-enum.rs:105:14
    |
 LL |     unsafe { std::mem::discriminant(&*(&() as *const () as *const Never)); };
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ read discriminant of an uninhabited enum variant
diff --git a/tests/ui/consts/const-eval/ub-incorrect-vtable.rs b/tests/ui/consts/const-eval/ub-incorrect-vtable.rs
index 8058f76..30c0ae3 100644
--- a/tests/ui/consts/const-eval/ub-incorrect-vtable.rs
+++ b/tests/ui/consts/const-eval/ub-incorrect-vtable.rs
@@ -11,19 +11,19 @@
 // errors are emitted instead of ICEs.
 
 //@ stderr-per-bitwidth
-
+//@ dont-require-annotations: NOTE
 
 trait Trait {}
 
 const INVALID_VTABLE_ALIGNMENT: &dyn Trait =
     unsafe { std::mem::transmute((&92u8, &[0usize, 1usize, 1000usize])) };
 //~^^ ERROR it is undefined behavior to use this value
-//~| vtable
+//~| NOTE vtable
 
 const INVALID_VTABLE_SIZE: &dyn Trait =
     unsafe { std::mem::transmute((&92u8, &[1usize, usize::MAX, 1usize])) };
 //~^^ ERROR it is undefined behavior to use this value
-//~| vtable
+//~| NOTE vtable
 
 #[repr(transparent)]
 struct W<T>(T);
@@ -33,18 +33,18 @@ fn drop_me(_: *mut usize) {}
 const INVALID_VTABLE_ALIGNMENT_UB: W<&dyn Trait> =
     unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), 1usize, 1000usize))) };
 //~^^ ERROR it is undefined behavior to use this value
-//~| expected a vtable pointer
+//~| NOTE expected a vtable pointer
 
 const INVALID_VTABLE_SIZE_UB: W<&dyn Trait> =
     unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), usize::MAX, 1usize))) };
 //~^^ ERROR it is undefined behavior to use this value
-//~| expected a vtable pointer
+//~| NOTE expected a vtable pointer
 
 // Even if the vtable has a fn ptr and a reasonable size+align, it still does not work.
 const INVALID_VTABLE_UB: W<&dyn Trait> =
     unsafe { std::mem::transmute((&92u8, &(drop_me as fn(*mut usize), 1usize, 1usize))) };
 //~^^ ERROR it is undefined behavior to use this value
-//~| expected a vtable pointer
+//~| NOTE expected a vtable pointer
 
 // Trying to access the data in a vtable does not work, either.
 
@@ -90,7 +90,7 @@ union Transmute<T: Copy, U: Copy> {
 const FOO: &dyn Bar = &Foo { foo: 128, bar: false };
 const G: Wide = unsafe { Transmute { t: FOO }.u };
 //~^ ERROR it is undefined behavior to use this value
-//~| encountered a dangling reference
+//~| NOTE encountered a dangling reference
 // (it is dangling because vtables do not contain memory that can be dereferenced)
 
 fn main() {}
diff --git a/tests/ui/consts/const-eval/ub-int-array.rs b/tests/ui/consts/const-eval/ub-int-array.rs
index cde0749..169ac7f 100644
--- a/tests/ui/consts/const-eval/ub-int-array.rs
+++ b/tests/ui/consts/const-eval/ub-int-array.rs
@@ -1,6 +1,8 @@
 //! Test the "array of int" fast path in validity checking, and in particular whether it
 //! points at the right array element.
 
+//@ dont-require-annotations: NOTE
+
 use std::mem;
 
 #[repr(C)]
@@ -17,7 +19,7 @@ const fn new(t: T) -> Self {
 
 const UNINIT_INT_0: [u32; 3] = unsafe {
     //~^ ERROR it is undefined behavior to use this value
-    //~| invalid value at [0]
+    //~| NOTE invalid value at [0]
     mem::transmute([
         MaybeUninit { uninit: () },
         // Constants chosen to achieve endianness-independent hex dump.
@@ -27,7 +29,7 @@ const fn new(t: T) -> Self {
 };
 const UNINIT_INT_1: [u32; 3] = unsafe {
     //~^ ERROR it is undefined behavior to use this value
-    //~| invalid value at [1]
+    //~| NOTE invalid value at [1]
     mem::transmute([
         MaybeUninit::new(0u8),
         MaybeUninit::new(0u8),
@@ -45,7 +47,7 @@ const fn new(t: T) -> Self {
 };
 const UNINIT_INT_2: [u32; 3] = unsafe {
     //~^ ERROR it is undefined behavior to use this value
-    //~| invalid value at [2]
+    //~| NOTE invalid value at [2]
     mem::transmute([
         MaybeUninit::new(0u8),
         MaybeUninit::new(0u8),
diff --git a/tests/ui/consts/const-eval/ub-int-array.stderr b/tests/ui/consts/const-eval/ub-int-array.stderr
index c8efd7e..d6ef9bc 100644
--- a/tests/ui/consts/const-eval/ub-int-array.stderr
+++ b/tests/ui/consts/const-eval/ub-int-array.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-int-array.rs:18:1
+  --> $DIR/ub-int-array.rs:20:1
    |
 LL | const UNINIT_INT_0: [u32; 3] = unsafe {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered uninitialized memory, but expected an integer
@@ -10,7 +10,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-int-array.rs:28:1
+  --> $DIR/ub-int-array.rs:30:1
    |
 LL | const UNINIT_INT_1: [u32; 3] = unsafe {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [1]: encountered uninitialized memory, but expected an integer
@@ -21,7 +21,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-int-array.rs:46:1
+  --> $DIR/ub-int-array.rs:48:1
    |
 LL | const UNINIT_INT_2: [u32; 3] = unsafe {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [2]: encountered uninitialized memory, but expected an integer
diff --git a/tests/ui/consts/const-eval/ub-nonnull.rs b/tests/ui/consts/const-eval/ub-nonnull.rs
index b8e3127..8ae913d 100644
--- a/tests/ui/consts/const-eval/ub-nonnull.rs
+++ b/tests/ui/consts/const-eval/ub-nonnull.rs
@@ -1,6 +1,8 @@
 // Strip out raw byte dumps to make comparison platform-independent:
 //@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
 //@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?─*╼ )+ *│.*" -> "HEX_DUMP"
+//@ dont-require-annotations: NOTE
+
 #![allow(invalid_value)] // make sure we cannot allow away the errors tested here
 #![feature(rustc_attrs, ptr_metadata)]
 
@@ -33,7 +35,7 @@ union MaybeUninit<T: Copy> {
 }
 const UNINIT: NonZero<u8> = unsafe { MaybeUninit { uninit: () }.init };
 //~^ ERROR evaluation of constant value failed
-//~| uninitialized
+//~| NOTE uninitialized
 
 // Also test other uses of rustc_layout_scalar_valid_range_start
 
diff --git a/tests/ui/consts/const-eval/ub-nonnull.stderr b/tests/ui/consts/const-eval/ub-nonnull.stderr
index 0e4926e..c2cafbf 100644
--- a/tests/ui/consts/const-eval/ub-nonnull.stderr
+++ b/tests/ui/consts/const-eval/ub-nonnull.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-nonnull.rs:14:1
+  --> $DIR/ub-nonnull.rs:16:1
    |
 LL | const NULL_PTR: NonNull<u8> = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
@@ -10,13 +10,13 @@
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-nonnull.rs:20:29
+  --> $DIR/ub-nonnull.rs:22:29
    |
 LL |     let out_of_bounds_ptr = &ptr[255];
    |                             ^^^^^^^^^ out-of-bounds pointer arithmetic: expected a pointer to 255 bytes of memory, but got ALLOC1 which is only 1 byte from the end of the allocation
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-nonnull.rs:24:1
+  --> $DIR/ub-nonnull.rs:26:1
    |
 LL | const NULL_U8: NonZero<u8> = unsafe { mem::transmute(0u8) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1
@@ -27,7 +27,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-nonnull.rs:26:1
+  --> $DIR/ub-nonnull.rs:28:1
    |
 LL | const NULL_USIZE: NonZero<usize> = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered 0, but expected something greater or equal to 1
@@ -38,13 +38,13 @@
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-nonnull.rs:34:38
+  --> $DIR/ub-nonnull.rs:36:38
    |
 LL | const UNINIT: NonZero<u8> = unsafe { MaybeUninit { uninit: () }.init };
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-nonnull.rs:43:1
+  --> $DIR/ub-nonnull.rs:45:1
    |
 LL | const BAD_RANGE1: RestrictedRange1 = unsafe { RestrictedRange1(42) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 42, but expected something in the range 10..=30
@@ -55,7 +55,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-nonnull.rs:49:1
+  --> $DIR/ub-nonnull.rs:51:1
    |
 LL | const BAD_RANGE2: RestrictedRange2 = unsafe { RestrictedRange2(20) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 20, but expected something less or equal to 10, or greater or equal to 30
@@ -66,7 +66,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-nonnull.rs:52:1
+  --> $DIR/ub-nonnull.rs:54:1
    |
 LL | const NULL_FAT_PTR: NonNull<dyn Send> = unsafe {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0, but expected something greater or equal to 1
diff --git a/tests/ui/consts/const-eval/ub-ref-ptr.rs b/tests/ui/consts/const-eval/ub-ref-ptr.rs
index 50e510a..988e6c6 100644
--- a/tests/ui/consts/const-eval/ub-ref-ptr.rs
+++ b/tests/ui/consts/const-eval/ub-ref-ptr.rs
@@ -2,6 +2,8 @@
 // Strip out raw byte dumps to make comparison platform-independent:
 //@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
 //@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
+//@ dont-require-annotations: NOTE
+
 #![allow(invalid_value)]
 
 use std::mem;
@@ -14,11 +16,11 @@ union MaybeUninit<T: Copy> {
 
 const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
 //~^ ERROR it is undefined behavior to use this value
-//~| constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
+//~| NOTE constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
 
 const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
 //~^ ERROR it is undefined behavior to use this value
-//~| constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
+//~| NOTE constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
 
 const NULL: &u16 = unsafe { mem::transmute(0usize) };
 //~^ ERROR it is undefined behavior to use this value
@@ -47,13 +49,13 @@ union MaybeUninit<T: Copy> {
 
 const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
 //~^ ERROR evaluation of constant value failed
-//~| uninitialized
+//~| NOTE uninitialized
 
 const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
 //~^ ERROR it is undefined behavior to use this value
 const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
 //~^ ERROR evaluation of constant value failed
-//~| uninitialized
+//~| NOTE uninitialized
 const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
 //~^ ERROR it is undefined behavior to use this value
 const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
diff --git a/tests/ui/consts/const-eval/ub-ref-ptr.stderr b/tests/ui/consts/const-eval/ub-ref-ptr.stderr
index 72a5232..de5e721 100644
--- a/tests/ui/consts/const-eval/ub-ref-ptr.stderr
+++ b/tests/ui/consts/const-eval/ub-ref-ptr.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:15:1
+  --> $DIR/ub-ref-ptr.rs:17:1
    |
 LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
    | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned reference (required 2 byte alignment but found 1)
@@ -10,7 +10,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:19:1
+  --> $DIR/ub-ref-ptr.rs:21:1
    |
 LL | const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered an unaligned box (required 2 byte alignment but found 1)
@@ -21,7 +21,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:23:1
+  --> $DIR/ub-ref-ptr.rs:25:1
    |
 LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null reference
@@ -32,7 +32,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:26:1
+  --> $DIR/ub-ref-ptr.rs:28:1
    |
 LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a null box
@@ -43,7 +43,7 @@
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-ref-ptr.rs:33:1
+  --> $DIR/ub-ref-ptr.rs:35:1
    |
 LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -52,7 +52,7 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-ref-ptr.rs:36:39
+  --> $DIR/ub-ref-ptr.rs:38:39
    |
 LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
    |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -61,13 +61,13 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 note: erroneous constant encountered
-  --> $DIR/ub-ref-ptr.rs:36:38
+  --> $DIR/ub-ref-ptr.rs:38:38
    |
 LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-ref-ptr.rs:39:86
+  --> $DIR/ub-ref-ptr.rs:41:86
    |
 LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
    |                                                                                      ^^^^^^^^^^^^^^^^^^^^ unable to turn pointer into integer
@@ -76,13 +76,13 @@
    = help: the absolute address of a pointer is not known at compile-time, so such operations are not supported
 
 note: erroneous constant encountered
-  --> $DIR/ub-ref-ptr.rs:39:85
+  --> $DIR/ub-ref-ptr.rs:41:85
    |
 LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
    |                                                                                     ^^^^^^^^^^^^^^^^^^^^^
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:42:1
+  --> $DIR/ub-ref-ptr.rs:44:1
    |
 LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling reference (0x539[noalloc] has no provenance)
@@ -93,7 +93,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:45:1
+  --> $DIR/ub-ref-ptr.rs:47:1
    |
 LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a dangling box (0x539[noalloc] has no provenance)
@@ -104,13 +104,13 @@
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-ref-ptr.rs:48:41
+  --> $DIR/ub-ref-ptr.rs:50:41
    |
 LL | const UNINIT_PTR: *const i32 = unsafe { MaybeUninit { uninit: () }.init };
    |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:52:1
+  --> $DIR/ub-ref-ptr.rs:54:1
    |
 LL | const NULL_FN_PTR: fn() = unsafe { mem::transmute(0usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered null pointer, but expected a function pointer
@@ -121,13 +121,13 @@
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-ref-ptr.rs:54:38
+  --> $DIR/ub-ref-ptr.rs:56:38
    |
 LL | const UNINIT_FN_PTR: fn() = unsafe { MaybeUninit { uninit: () }.init };
    |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:57:1
+  --> $DIR/ub-ref-ptr.rs:59:1
    |
 LL | const DANGLING_FN_PTR: fn() = unsafe { mem::transmute(13usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0xd[noalloc], but expected a function pointer
@@ -138,7 +138,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-ref-ptr.rs:59:1
+  --> $DIR/ub-ref-ptr.rs:61:1
    |
 LL | const DATA_FN_PTR: fn() = unsafe { mem::transmute(&13) };
    | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered ALLOC2<imm>, but expected a function pointer
@@ -149,7 +149,7 @@
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-ref-ptr.rs:66:5
+  --> $DIR/ub-ref-ptr.rs:68:5
    |
 LL |     ptr.read();
    |     ^^^^^^^^^^ accessing memory based on pointer with alignment 1, but alignment 4 is required
diff --git a/tests/ui/consts/const-eval/ub-uninhabit.rs b/tests/ui/consts/const-eval/ub-uninhabit.rs
index d0515a4..3a5e291 100644
--- a/tests/ui/consts/const-eval/ub-uninhabit.rs
+++ b/tests/ui/consts/const-eval/ub-uninhabit.rs
@@ -1,6 +1,8 @@
 // Strip out raw byte dumps to make comparison platform-independent:
 //@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
 //@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
+//@ dont-require-annotations: NOTE
+
 #![feature(core_intrinsics)]
 #![feature(never_type)]
 
@@ -18,15 +20,15 @@ union MaybeUninit<T: Copy> {
 
 const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init };
 //~^ ERROR evaluation of constant value failed
-//~| constructing invalid value
+//~| NOTE constructing invalid value
 
 const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
 //~^ ERROR it is undefined behavior to use this value
-//~| constructing invalid value
+//~| NOTE constructing invalid value
 
 const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init };
 //~^ ERROR evaluation of constant value failed
-//~| constructing invalid value
+//~| NOTE constructing invalid value
 
 
 const READ_NEVER: () = unsafe {
@@ -34,7 +36,7 @@ union MaybeUninit<T: Copy> {
     let ptr = mem.as_ptr().cast::<!>();
     let _val = intrinsics::read_via_copy(ptr);
     //~^ ERROR evaluation of constant value failed
-    //~| constructing invalid value
+    //~| NOTE constructing invalid value
 };
 
 
diff --git a/tests/ui/consts/const-eval/ub-uninhabit.stderr b/tests/ui/consts/const-eval/ub-uninhabit.stderr
index d26f4e0..9d3f932 100644
--- a/tests/ui/consts/const-eval/ub-uninhabit.stderr
+++ b/tests/ui/consts/const-eval/ub-uninhabit.stderr
@@ -1,11 +1,11 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-uninhabit.rs:19:35
+  --> $DIR/ub-uninhabit.rs:21:35
    |
 LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init };
    |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of uninhabited type `Bar`
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/ub-uninhabit.rs:23:1
+  --> $DIR/ub-uninhabit.rs:25:1
    |
 LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
    | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a reference pointing to uninhabited type Bar
@@ -16,13 +16,13 @@
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-uninhabit.rs:27:42
+  --> $DIR/ub-uninhabit.rs:29:42
    |
 LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init };
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at [0]: encountered a value of uninhabited type `Bar`
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/ub-uninhabit.rs:35:16
+  --> $DIR/ub-uninhabit.rs:37:16
    |
 LL |     let _val = intrinsics::read_via_copy(ptr);
    |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered a value of the never type `!`
diff --git a/tests/ui/consts/const-eval/ub-wide-ptr.rs b/tests/ui/consts/const-eval/ub-wide-ptr.rs
index 4e2defc..4b9bbb8 100644
--- a/tests/ui/consts/const-eval/ub-wide-ptr.rs
+++ b/tests/ui/consts/const-eval/ub-wide-ptr.rs
@@ -9,7 +9,7 @@
 //@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
 //@ normalize-stderr: "offset \d+" -> "offset N"
 //@ normalize-stderr: "size \d+" -> "size N"
-
+//@ dont-require-annotations: NOTE
 
 /// A newtype wrapper to prevent MIR generation from inserting reborrows that would affect the error
 /// message.
@@ -62,7 +62,7 @@ impl Trait for bool {}
 // bad slice: length uninit
 const SLICE_LENGTH_UNINIT: &[u8] = unsafe {
 //~^ ERROR evaluation of constant value failed
-//~| uninitialized
+//~| NOTE uninitialized
     let uninit_len = MaybeUninit::<usize> { uninit: () };
     mem::transmute((42, uninit_len))
 };
@@ -85,18 +85,18 @@ impl Trait for bool {}
 // bad data *inside* the slice
 const SLICE_CONTENT_INVALID: &[bool] = &[unsafe { mem::transmute(3u8) }];
 //~^ ERROR it is undefined behavior to use this value
-//~| constant
+//~| NOTE constant
 
 // good MySliceBool
 const MYSLICE_GOOD: &MySliceBool = &MySlice(true, [false]);
 // bad: sized field is not okay
 const MYSLICE_PREFIX_BAD: &MySliceBool = &MySlice(unsafe { mem::transmute(3u8) }, [false]);
 //~^ ERROR it is undefined behavior to use this value
-//~| constant
+//~| NOTE constant
 // bad: unsized part is not okay
 const MYSLICE_SUFFIX_BAD: &MySliceBool = &MySlice(true, [unsafe { mem::transmute(3u8) }]);
 //~^ ERROR it is undefined behavior to use this value
-//~| constant
+//~| NOTE constant
 
 // # raw slice
 const RAW_SLICE_VALID: *const [u8] = unsafe { mem::transmute((&42u8, 1usize)) }; // ok
@@ -104,7 +104,7 @@ impl Trait for bool {}
 const RAW_SLICE_MUCH_TOO_LONG: *const [u8] = unsafe { mem::transmute((&42u8, usize::MAX)) }; // ok because raw
 const RAW_SLICE_LENGTH_UNINIT: *const [u8] = unsafe {
 //~^ ERROR evaluation of constant value failed
-//~| uninitialized
+//~| NOTE uninitialized
     let uninit_len = MaybeUninit::<usize> { uninit: () };
     mem::transmute((42, uninit_len))
 };
@@ -113,40 +113,40 @@ impl Trait for bool {}
 // bad trait object
 const TRAIT_OBJ_SHORT_VTABLE_1: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u8))) };
 //~^ ERROR it is undefined behavior to use this value
-//~| vtable
+//~| NOTE vtable
 // bad trait object
 const TRAIT_OBJ_SHORT_VTABLE_2: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &3u64))) };
 //~^ ERROR it is undefined behavior to use this value
-//~| vtable
+//~| NOTE vtable
 // bad trait object
 const TRAIT_OBJ_INT_VTABLE: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, 4usize))) };
 //~^ ERROR it is undefined behavior to use this value
-//~| vtable
+//~| NOTE vtable
 const TRAIT_OBJ_UNALIGNED_VTABLE: &dyn Trait = unsafe { mem::transmute((&92u8, &[0u8; 128])) };
 //~^ ERROR it is undefined behavior to use this value
-//~| vtable
+//~| NOTE vtable
 const TRAIT_OBJ_BAD_DROP_FN_NULL: &dyn Trait = unsafe { mem::transmute((&92u8, &[0usize; 8])) };
 //~^ ERROR it is undefined behavior to use this value
-//~| vtable
+//~| NOTE vtable
 const TRAIT_OBJ_BAD_DROP_FN_INT: &dyn Trait = unsafe { mem::transmute((&92u8, &[1usize; 8])) };
 //~^ ERROR it is undefined behavior to use this value
-//~| vtable
+//~| NOTE vtable
 const TRAIT_OBJ_BAD_DROP_FN_NOT_FN_PTR: W<&dyn Trait> = unsafe { mem::transmute(W((&92u8, &[&42u8; 8]))) };
 //~^ ERROR it is undefined behavior to use this value
-//~| vtable
+//~| NOTE vtable
 
 // bad data *inside* the trait object
 const TRAIT_OBJ_CONTENT_INVALID: &dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) };
 //~^ ERROR it is undefined behavior to use this value
-//~| expected a boolean
+//~| NOTE expected a boolean
 
 // # raw trait object
 const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92u8, 0usize)) };
 //~^ ERROR it is undefined behavior to use this value
-//~| null pointer
+//~| NOTE null pointer
 const RAW_TRAIT_OBJ_VTABLE_INVALID: *const dyn Trait = unsafe { mem::transmute((&92u8, &3u64)) };
 //~^ ERROR it is undefined behavior to use this value
-//~| vtable
+//~| NOTE vtable
 const RAW_TRAIT_OBJ_CONTENT_INVALID: *const dyn Trait = unsafe { mem::transmute::<_, &bool>(&3u8) } as *const dyn Trait; // ok because raw
 // Officially blessed way to get the vtable
 const DYN_METADATA: ptr::DynMetadata<dyn Send> = ptr::metadata::<dyn Send>(ptr::null::<i32>());
@@ -155,12 +155,12 @@ impl Trait for bool {}
 static mut RAW_TRAIT_OBJ_VTABLE_NULL_THROUGH_REF: *const dyn Trait = unsafe {
     mem::transmute::<_, &dyn Trait>((&92u8, 0usize))
     //~^^ ERROR it is undefined behavior to use this value
-    //~| null pointer
+    //~| NOTE null pointer
 };
 static mut RAW_TRAIT_OBJ_VTABLE_INVALID_THROUGH_REF: *const dyn Trait = unsafe {
     mem::transmute::<_, &dyn Trait>((&92u8, &3u64))
     //~^^ ERROR it is undefined behavior to use this value
-    //~| vtable
+    //~| NOTE vtable
 };
 
 fn main() {}
diff --git a/tests/ui/consts/const-eval/union-const-eval-field.rs b/tests/ui/consts/const-eval/union-const-eval-field.rs
index c979998..55e9abe 100644
--- a/tests/ui/consts/const-eval/union-const-eval-field.rs
+++ b/tests/ui/consts/const-eval/union-const-eval-field.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 type Field1 = i32;
 type Field2 = f32;
 type Field3 = i64;
@@ -25,7 +27,7 @@ const fn read_field2() -> Field2 {
 const fn read_field3() -> Field3 {
     const FIELD3: Field3 = unsafe { UNION.field3 };
     //~^ ERROR evaluation of constant value failed
-    //~| uninitialized
+    //~| NOTE uninitialized
     FIELD3
 }
 
diff --git a/tests/ui/consts/const-eval/union-const-eval-field.stderr b/tests/ui/consts/const-eval/union-const-eval-field.stderr
index b1de225..4fd6b80 100644
--- a/tests/ui/consts/const-eval/union-const-eval-field.stderr
+++ b/tests/ui/consts/const-eval/union-const-eval-field.stderr
@@ -1,17 +1,17 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/union-const-eval-field.rs:26:37
+  --> $DIR/union-const-eval-field.rs:28:37
    |
 LL |     const FIELD3: Field3 = unsafe { UNION.field3 };
    |                                     ^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
 
 note: erroneous constant encountered
-  --> $DIR/union-const-eval-field.rs:29:5
+  --> $DIR/union-const-eval-field.rs:31:5
    |
 LL |     FIELD3
    |     ^^^^^^
 
 note: erroneous constant encountered
-  --> $DIR/union-const-eval-field.rs:29:5
+  --> $DIR/union-const-eval-field.rs:31:5
    |
 LL |     FIELD3
    |     ^^^^^^
diff --git a/tests/ui/consts/const-eval/union-ub.32bit.stderr b/tests/ui/consts/const-eval/union-ub.32bit.stderr
index e5c8f88..38ded4d 100644
--- a/tests/ui/consts/const-eval/union-ub.32bit.stderr
+++ b/tests/ui/consts/const-eval/union-ub.32bit.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/union-ub.rs:32:1
+  --> $DIR/union-ub.rs:33:1
    |
 LL | const BAD_BOOL: bool = unsafe { DummyUnion { u8: 42 }.bool};
    | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x2a, but expected a boolean
@@ -10,7 +10,7 @@
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/union-ub.rs:34:36
+  --> $DIR/union-ub.rs:35:36
    |
 LL | const UNINIT_BOOL: bool = unsafe { DummyUnion { unit: () }.bool};
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
diff --git a/tests/ui/consts/const-eval/union-ub.64bit.stderr b/tests/ui/consts/const-eval/union-ub.64bit.stderr
index e5c8f88..38ded4d 100644
--- a/tests/ui/consts/const-eval/union-ub.64bit.stderr
+++ b/tests/ui/consts/const-eval/union-ub.64bit.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/union-ub.rs:32:1
+  --> $DIR/union-ub.rs:33:1
    |
 LL | const BAD_BOOL: bool = unsafe { DummyUnion { u8: 42 }.bool};
    | ^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered 0x2a, but expected a boolean
@@ -10,7 +10,7 @@
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/union-ub.rs:34:36
+  --> $DIR/union-ub.rs:35:36
    |
 LL | const UNINIT_BOOL: bool = unsafe { DummyUnion { unit: () }.bool};
    |                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ using uninitialized data, but this operation requires initialized memory
diff --git a/tests/ui/consts/const-eval/union-ub.rs b/tests/ui/consts/const-eval/union-ub.rs
index 5eb4ad4..7d8fd74 100644
--- a/tests/ui/consts/const-eval/union-ub.rs
+++ b/tests/ui/consts/const-eval/union-ub.rs
@@ -1,4 +1,5 @@
 //@ stderr-per-bitwidth
+//@ dont-require-annotations: NOTE
 
 #[repr(C)]
 union DummyUnion {
@@ -33,7 +34,7 @@ union Bar {
 //~^ ERROR it is undefined behavior to use this value
 const UNINIT_BOOL: bool = unsafe { DummyUnion { unit: () }.bool};
 //~^ ERROR evaluation of constant value failed
-//~| uninitialized
+//~| NOTE uninitialized
 
 // The value is not valid for any union variant, but that's fine
 // unions are just a convenient way to transmute bits around
diff --git a/tests/ui/consts/const-eval/unwind-abort.rs b/tests/ui/consts/const-eval/unwind-abort.rs
index fee53f8..b239dba 100644
--- a/tests/ui/consts/const-eval/unwind-abort.rs
+++ b/tests/ui/consts/const-eval/unwind-abort.rs
@@ -1,5 +1,7 @@
+//@ dont-require-annotations: NOTE
+
 const extern "C" fn foo() {
-    panic!() //~ inside `foo`
+    panic!() //~ NOTE inside `foo`
 }
 
 const _: () = foo(); //~ ERROR evaluation of constant value failed
diff --git a/tests/ui/consts/const-eval/unwind-abort.stderr b/tests/ui/consts/const-eval/unwind-abort.stderr
index 7d096c5..5ed7467 100644
--- a/tests/ui/consts/const-eval/unwind-abort.stderr
+++ b/tests/ui/consts/const-eval/unwind-abort.stderr
@@ -1,11 +1,11 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/unwind-abort.rs:5:15
+  --> $DIR/unwind-abort.rs:7:15
    |
 LL | const _: () = foo();
    |               ^^^^^ evaluation panicked: explicit panic
    |
 note: inside `foo`
-  --> $DIR/unwind-abort.rs:2:5
+  --> $DIR/unwind-abort.rs:4:5
    |
 LL |     panic!()
    |     ^^^^^^^^ the failure occurred here
diff --git a/tests/ui/consts/const-eval/validate_uninhabited_zsts.rs b/tests/ui/consts/const-eval/validate_uninhabited_zsts.rs
index c4df93b..5f1d27b 100644
--- a/tests/ui/consts/const-eval/validate_uninhabited_zsts.rs
+++ b/tests/ui/consts/const-eval/validate_uninhabited_zsts.rs
@@ -1,5 +1,7 @@
+//@ dont-require-annotations: NOTE
+
 const fn foo() -> ! {
-    unsafe { std::mem::transmute(()) } //~ inside `foo`
+    unsafe { std::mem::transmute(()) } //~ NOTE inside `foo`
 }
 
 // Type defined in a submodule, so that it is not "visibly"
diff --git a/tests/ui/consts/const-eval/validate_uninhabited_zsts.stderr b/tests/ui/consts/const-eval/validate_uninhabited_zsts.stderr
index 29311fd..0407ae5 100644
--- a/tests/ui/consts/const-eval/validate_uninhabited_zsts.stderr
+++ b/tests/ui/consts/const-eval/validate_uninhabited_zsts.stderr
@@ -1,17 +1,17 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/validate_uninhabited_zsts.rs:15:33
+  --> $DIR/validate_uninhabited_zsts.rs:17:33
    |
 LL | const FOO: [empty::Empty; 3] = [foo(); 3];
    |                                 ^^^^^ constructing invalid value: encountered a value of the never type `!`
    |
 note: inside `foo`
-  --> $DIR/validate_uninhabited_zsts.rs:2:14
+  --> $DIR/validate_uninhabited_zsts.rs:4:14
    |
 LL |     unsafe { std::mem::transmute(()) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^ the failure occurred here
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/validate_uninhabited_zsts.rs:18:42
+  --> $DIR/validate_uninhabited_zsts.rs:20:42
    |
 LL | const BAR: [empty::Empty; 3] = [unsafe { std::mem::transmute(()) }; 3];
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .0: encountered a value of uninhabited type `Void`
diff --git a/tests/ui/consts/const-len-underflow-separate-spans.next.stderr b/tests/ui/consts/const-len-underflow-separate-spans.next.stderr
index bd2a81f..aacd746 100644
--- a/tests/ui/consts/const-len-underflow-separate-spans.next.stderr
+++ b/tests/ui/consts/const-len-underflow-separate-spans.next.stderr
@@ -5,7 +5,7 @@
    |                    ^^^^^^^^^ attempt to compute `1_usize - 2_usize`, which would overflow
 
 note: erroneous constant encountered
-  --> $DIR/const-len-underflow-separate-spans.rs:14:17
+  --> $DIR/const-len-underflow-separate-spans.rs:15:17
    |
 LL |     let a: [i8; LEN] = unimplemented!();
    |                 ^^^
diff --git a/tests/ui/consts/const-len-underflow-separate-spans.old.stderr b/tests/ui/consts/const-len-underflow-separate-spans.old.stderr
index bd2a81f..aacd746 100644
--- a/tests/ui/consts/const-len-underflow-separate-spans.old.stderr
+++ b/tests/ui/consts/const-len-underflow-separate-spans.old.stderr
@@ -5,7 +5,7 @@
    |                    ^^^^^^^^^ attempt to compute `1_usize - 2_usize`, which would overflow
 
 note: erroneous constant encountered
-  --> $DIR/const-len-underflow-separate-spans.rs:14:17
+  --> $DIR/const-len-underflow-separate-spans.rs:15:17
    |
 LL |     let a: [i8; LEN] = unimplemented!();
    |                 ^^^
diff --git a/tests/ui/consts/const-len-underflow-separate-spans.rs b/tests/ui/consts/const-len-underflow-separate-spans.rs
index 42314ee..14eb88b 100644
--- a/tests/ui/consts/const-len-underflow-separate-spans.rs
+++ b/tests/ui/consts/const-len-underflow-separate-spans.rs
@@ -9,8 +9,9 @@
 const TWO: usize = 2;
 const LEN: usize = ONE - TWO;
 //~^ ERROR constant
+//~| NOTE attempt to compute `1_usize - 2_usize`, which would overflow
 
 fn main() {
     let a: [i8; LEN] = unimplemented!();
-//~^ constant
+//~^ NOTE constant
 }
diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs b/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs
index 283c122..bc534be 100644
--- a/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs
+++ b/tests/ui/consts/const-mut-refs/mut_ref_in_final.rs
@@ -1,6 +1,7 @@
 //@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
 //@ normalize-stderr: "( 0x[0-9a-f][0-9a-f] │)? ([0-9a-f][0-9a-f] |__ |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> " HEX_DUMP"
 //@ normalize-stderr: "HEX_DUMP\s*\n\s*HEX_DUMP" -> "HEX_DUMP"
+//@ dont-require-annotations: NOTE
 
 use std::cell::UnsafeCell;
 use std::mem;
@@ -25,7 +26,7 @@ const fn helper(x: &mut i32) -> Option<&mut i32> { Some(x) }
 // Not ok, since it points to read-only memory.
 const IMMUT_MUT_REF: &mut u16 = unsafe { mem::transmute(&13) };
 //~^ ERROR undefined behavior to use this value
-//~| pointing to read-only memory
+//~| NOTE pointing to read-only memory
 
 // Ok, because no references to mutable data exist here, since the `{}` moves
 // its value and then takes a reference to that.
diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final.stderr b/tests/ui/consts/const-mut-refs/mut_ref_in_final.stderr
index 4f50ae3..1f49f08 100644
--- a/tests/ui/consts/const-mut-refs/mut_ref_in_final.stderr
+++ b/tests/ui/consts/const-mut-refs/mut_ref_in_final.stderr
@@ -1,11 +1,11 @@
 error[E0764]: mutable references are not allowed in the final value of constants
-  --> $DIR/mut_ref_in_final.rs:14:21
+  --> $DIR/mut_ref_in_final.rs:15:21
    |
 LL | const B: *mut i32 = &mut 4;
    |                     ^^^^^^
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/mut_ref_in_final.rs:20:40
+  --> $DIR/mut_ref_in_final.rs:21:40
    |
 LL | const B3: Option<&mut i32> = Some(&mut 42);
    |                              ----------^^-
@@ -15,7 +15,7 @@
    |                              using this value as a constant requires that borrow lasts for `'static`
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/mut_ref_in_final.rs:23:42
+  --> $DIR/mut_ref_in_final.rs:24:42
    |
 LL | const B4: Option<&mut i32> = helper(&mut 42);
    |                              ------------^^-
@@ -25,7 +25,7 @@
    |                              using this value as a constant requires that borrow lasts for `'static`
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mut_ref_in_final.rs:26:1
+  --> $DIR/mut_ref_in_final.rs:27:1
    |
 LL | const IMMUT_MUT_REF: &mut u16 = unsafe { mem::transmute(&13) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference or box pointing to read-only memory
@@ -36,7 +36,7 @@
            }
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/mut_ref_in_final.rs:50:65
+  --> $DIR/mut_ref_in_final.rs:51:65
    |
 LL | const FOO: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
    |                                  -------------------------------^^--
@@ -46,7 +46,7 @@
    |                                  using this value as a constant requires that borrow lasts for `'static`
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/mut_ref_in_final.rs:53:67
+  --> $DIR/mut_ref_in_final.rs:54:67
    |
 LL | static FOO2: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
    |                                    -------------------------------^^--
@@ -56,7 +56,7 @@
    |                                    using this value as a static requires that borrow lasts for `'static`
 
 error[E0716]: temporary value dropped while borrowed
-  --> $DIR/mut_ref_in_final.rs:56:71
+  --> $DIR/mut_ref_in_final.rs:57:71
    |
 LL | static mut FOO3: NotAMutex<&mut i32> = NotAMutex(UnsafeCell::new(&mut 42));
    |                                        -------------------------------^^--
@@ -66,25 +66,25 @@
    |                                        using this value as a static requires that borrow lasts for `'static`
 
 error[E0764]: mutable references are not allowed in the final value of statics
-  --> $DIR/mut_ref_in_final.rs:69:53
+  --> $DIR/mut_ref_in_final.rs:70:53
    |
 LL | static RAW_MUT_CAST_S: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
    |                                                     ^^^^^^^
 
 error[E0764]: mutable references are not allowed in the final value of statics
-  --> $DIR/mut_ref_in_final.rs:71:54
+  --> $DIR/mut_ref_in_final.rs:72:54
    |
 LL | static RAW_MUT_COERCE_S: SyncPtr<i32> = SyncPtr { x: &mut 0 };
    |                                                      ^^^^^^
 
 error[E0764]: mutable references are not allowed in the final value of constants
-  --> $DIR/mut_ref_in_final.rs:73:52
+  --> $DIR/mut_ref_in_final.rs:74:52
    |
 LL | const RAW_MUT_CAST_C: SyncPtr<i32> = SyncPtr { x : &mut 42 as *mut _ as *const _ };
    |                                                    ^^^^^^^
 
 error[E0764]: mutable references are not allowed in the final value of constants
-  --> $DIR/mut_ref_in_final.rs:75:53
+  --> $DIR/mut_ref_in_final.rs:76:53
    |
 LL | const RAW_MUT_COERCE_C: SyncPtr<i32> = SyncPtr { x: &mut 0 };
    |                                                     ^^^^^^
diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs
index ac903fc..a58c443 100644
--- a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs
+++ b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.rs
@@ -1,6 +1,7 @@
 //@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
 //@ normalize-stderr: "( 0x[0-9a-f][0-9a-f] │)? ([0-9a-f][0-9a-f] |__ |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> " HEX_DUMP"
 //@ normalize-stderr: "HEX_DUMP\s*\n\s*HEX_DUMP" -> "HEX_DUMP"
+//@ dont-require-annotations: NOTE
 
 use std::sync::Mutex;
 
@@ -16,16 +17,16 @@ const fn helper() -> Option<&'static mut i32> { unsafe {
     Some(&mut *std::ptr::addr_of_mut!(BUFFER))
 } }
 const MUT: Option<&mut i32> = helper(); //~ ERROR it is undefined behavior to use this value
-//~^ encountered reference to mutable
+//~^ NOTE encountered reference to mutable
 
 const fn helper_int2ptr() -> Option<&'static mut i32> { unsafe {
     // Undefined behaviour (integer as pointer), who doesn't love tests like this.
     Some(&mut *(42 as *mut i32))
 } }
 const INT2PTR: Option<&mut i32> = helper_int2ptr(); //~ ERROR it is undefined behavior to use this value
-//~^  encountered a dangling reference
+//~^ NOTE encountered a dangling reference
 static INT2PTR_STATIC: Option<&mut i32> = helper_int2ptr(); //~ ERROR it is undefined behavior to use this value
-//~^  encountered a dangling reference
+//~^ NOTE encountered a dangling reference
 
 const fn helper_dangling() -> Option<&'static mut i32> { unsafe {
     // Undefined behaviour (dangling pointer), who doesn't love tests like this.
diff --git a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr
index aebac56..4ea6fa6 100644
--- a/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr
+++ b/tests/ui/consts/const-mut-refs/mut_ref_in_final_dynamic_check.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mut_ref_in_final_dynamic_check.rs:18:1
+  --> $DIR/mut_ref_in_final_dynamic_check.rs:19:1
    |
 LL | const MUT: Option<&mut i32> = helper();
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered reference to mutable memory in `const`
@@ -10,7 +10,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mut_ref_in_final_dynamic_check.rs:25:1
+  --> $DIR/mut_ref_in_final_dynamic_check.rs:26:1
    |
 LL | const INT2PTR: Option<&mut i32> = helper_int2ptr();
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (0x2a[noalloc] has no provenance)
@@ -21,7 +21,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mut_ref_in_final_dynamic_check.rs:27:1
+  --> $DIR/mut_ref_in_final_dynamic_check.rs:28:1
    |
 LL | static INT2PTR_STATIC: Option<&mut i32> = helper_int2ptr();
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (0x2a[noalloc] has no provenance)
@@ -32,7 +32,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mut_ref_in_final_dynamic_check.rs:34:1
+  --> $DIR/mut_ref_in_final_dynamic_check.rs:35:1
    |
 LL | const DANGLING: Option<&mut i32> = helper_dangling();
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (use-after-free)
@@ -43,7 +43,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mut_ref_in_final_dynamic_check.rs:35:1
+  --> $DIR/mut_ref_in_final_dynamic_check.rs:36:1
    |
 LL | static DANGLING_STATIC: Option<&mut i32> = helper_dangling();
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<enum-variant(Some)>.0: encountered a dangling reference (use-after-free)
diff --git a/tests/ui/consts/const-pattern-irrefutable.rs b/tests/ui/consts/const-pattern-irrefutable.rs
index 759d2e8..e131fd2 100644
--- a/tests/ui/consts/const-pattern-irrefutable.rs
+++ b/tests/ui/consts/const-pattern-irrefutable.rs
@@ -1,15 +1,17 @@
+//@ dont-require-annotations: NOTE
+
 mod foo {
     pub const b: u8 = 2;
-    //~^ missing patterns are not covered because `b` is interpreted as a constant pattern, not a new variable
+    //~^ NOTE missing patterns are not covered because `b` is interpreted as a constant pattern, not a new variable
     pub const d: (u8, u8) = (2, 1);
-    //~^ missing patterns are not covered because `d` is interpreted as a constant pattern, not a new variable
+    //~^ NOTE missing patterns are not covered because `d` is interpreted as a constant pattern, not a new variable
 }
 
 use foo::b as c;
 use foo::d;
 
 const a: u8 = 2;
-//~^ missing patterns are not covered because `a` is interpreted as a constant pattern, not a new variable
+//~^ NOTE missing patterns are not covered because `a` is interpreted as a constant pattern, not a new variable
 
 #[derive(PartialEq)]
 struct S {
@@ -23,19 +25,19 @@ struct S {
 fn main() {
     let a = 4;
     //~^ ERROR refutable pattern in local binding
-    //~| patterns `0_u8..=1_u8` and `3_u8..=u8::MAX` not covered
+    //~| NOTE patterns `0_u8..=1_u8` and `3_u8..=u8::MAX` not covered
     //~| HELP introduce a variable instead
     let c = 4;
     //~^ ERROR refutable pattern in local binding
-    //~| patterns `0_u8..=1_u8` and `3_u8..=u8::MAX` not covered
+    //~| NOTE patterns `0_u8..=1_u8` and `3_u8..=u8::MAX` not covered
     //~| HELP introduce a variable instead
     let d = (4, 4);
     //~^ ERROR refutable pattern in local binding
-    //~| patterns `(0_u8..=1_u8, _)` and `(3_u8..=u8::MAX, _)` not covered
+    //~| NOTE patterns `(0_u8..=1_u8, _)` and `(3_u8..=u8::MAX, _)` not covered
     //~| HELP introduce a variable instead
     let e = S {
     //~^ ERROR refutable pattern in local binding
-    //~| pattern `S { foo: 1_u8..=u8::MAX }` not covered
+    //~| NOTE pattern `S { foo: 1_u8..=u8::MAX }` not covered
     //~| HELP introduce a variable instead
         foo: 1,
     };
diff --git a/tests/ui/consts/const-pattern-irrefutable.stderr b/tests/ui/consts/const-pattern-irrefutable.stderr
index 06bd01b..f52ebc3 100644
--- a/tests/ui/consts/const-pattern-irrefutable.stderr
+++ b/tests/ui/consts/const-pattern-irrefutable.stderr
@@ -1,5 +1,5 @@
 error[E0005]: refutable pattern in local binding
-  --> $DIR/const-pattern-irrefutable.rs:24:9
+  --> $DIR/const-pattern-irrefutable.rs:26:9
    |
 LL | const a: u8 = 2;
    | ----------- missing patterns are not covered because `a` is interpreted as a constant pattern, not a new variable
@@ -16,7 +16,7 @@
    |          ++++
 
 error[E0005]: refutable pattern in local binding
-  --> $DIR/const-pattern-irrefutable.rs:28:9
+  --> $DIR/const-pattern-irrefutable.rs:30:9
    |
 LL |     pub const b: u8 = 2;
    |     --------------- missing patterns are not covered because `b` is interpreted as a constant pattern, not a new variable
@@ -34,7 +34,7 @@
    |
 
 error[E0005]: refutable pattern in local binding
-  --> $DIR/const-pattern-irrefutable.rs:32:9
+  --> $DIR/const-pattern-irrefutable.rs:34:9
    |
 LL |     pub const d: (u8, u8) = (2, 1);
    |     --------------------- missing patterns are not covered because `d` is interpreted as a constant pattern, not a new variable
@@ -51,7 +51,7 @@
    |          ++++
 
 error[E0005]: refutable pattern in local binding
-  --> $DIR/const-pattern-irrefutable.rs:36:9
+  --> $DIR/const-pattern-irrefutable.rs:38:9
    |
 LL | const e: S = S {
    | ---------- missing patterns are not covered because `e` is interpreted as a constant pattern, not a new variable
@@ -62,7 +62,7 @@
    = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
 note: `S` defined here
-  --> $DIR/const-pattern-irrefutable.rs:15:8
+  --> $DIR/const-pattern-irrefutable.rs:17:8
    |
 LL | struct S {
    |        ^
diff --git a/tests/ui/consts/const-tup-index-span.rs b/tests/ui/consts/const-tup-index-span.rs
index e77d392..4cb7143 100644
--- a/tests/ui/consts/const-tup-index-span.rs
+++ b/tests/ui/consts/const-tup-index-span.rs
@@ -2,7 +2,8 @@
 
 const TUP: (usize,) = 5usize << 64;
 //~^ ERROR mismatched types
-//~| expected `(usize,)`, found `usize`
+//~| NOTE expected `(usize,)`, found `usize`
+//~| NOTE expected tuple `(usize,)`
 const ARR: [i32; TUP.0] = [];
 
 fn main() {
diff --git a/tests/ui/consts/const_refs_to_static_fail.rs b/tests/ui/consts/const_refs_to_static_fail.rs
index 596ed50..e1f2262 100644
--- a/tests/ui/consts/const_refs_to_static_fail.rs
+++ b/tests/ui/consts/const_refs_to_static_fail.rs
@@ -1,5 +1,6 @@
 //@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
 //@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
+//@ dont-require-annotations: NOTE
 
 #![feature(sync_unsafe_cell)]
 
@@ -9,14 +10,14 @@
 static mut S_MUT: i32 = 0;
 
 const C1: &SyncUnsafeCell<i32> = &S; //~ERROR undefined behavior
-//~| encountered reference to mutable memory
+//~| NOTE encountered reference to mutable memory
 const C1_READ: () = unsafe {
     assert!(*C1.get() == 0);
 };
 const C2: *const i32 = unsafe { std::ptr::addr_of!(S_MUT) };
 const C2_READ: () = unsafe {
     assert!(*C2 == 0); //~ERROR evaluation of constant value failed
-    //~^ constant accesses mutable global memory
+    //~^ NOTE constant accesses mutable global memory
 };
 
 fn main() {
diff --git a/tests/ui/consts/const_refs_to_static_fail.stderr b/tests/ui/consts/const_refs_to_static_fail.stderr
index 297561d..245806d 100644
--- a/tests/ui/consts/const_refs_to_static_fail.stderr
+++ b/tests/ui/consts/const_refs_to_static_fail.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const_refs_to_static_fail.rs:11:1
+  --> $DIR/const_refs_to_static_fail.rs:12:1
    |
 LL | const C1: &SyncUnsafeCell<i32> = &S;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
@@ -10,13 +10,13 @@
            }
 
 note: erroneous constant encountered
-  --> $DIR/const_refs_to_static_fail.rs:14:14
+  --> $DIR/const_refs_to_static_fail.rs:15:14
    |
 LL |     assert!(*C1.get() == 0);
    |              ^^
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const_refs_to_static_fail.rs:18:13
+  --> $DIR/const_refs_to_static_fail.rs:19:13
    |
 LL |     assert!(*C2 == 0);
    |             ^^^ constant accesses mutable global memory
diff --git a/tests/ui/consts/const_refs_to_static_fail_invalid.rs b/tests/ui/consts/const_refs_to_static_fail_invalid.rs
index 3383a20..f6ccfbf 100644
--- a/tests/ui/consts/const_refs_to_static_fail_invalid.rs
+++ b/tests/ui/consts/const_refs_to_static_fail_invalid.rs
@@ -1,5 +1,7 @@
 //@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
 //@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
+//@ dont-require-annotations: NOTE
+
 #![allow(static_mut_refs)]
 
 fn invalid() {
@@ -7,7 +9,7 @@ fn invalid() {
 
     const C: &bool = unsafe { std::mem::transmute(&S) };
     //~^ERROR: undefined behavior
-    //~| expected a boolean
+    //~| NOTE expected a boolean
 
     // This must be rejected here (or earlier), since it's not a valid `&bool`.
     match &true {
@@ -23,7 +25,7 @@ fn extern_() {
 
     const C: &i8 = unsafe { &S };
     //~^ERROR: undefined behavior
-    //~| `extern` static
+    //~| NOTE `extern` static
 
     // This must be rejected here (or earlier), since the pattern cannot be read.
     match &0 {
@@ -37,7 +39,7 @@ fn mutable() {
 
     const C: &i32 = unsafe { &S_MUT };
     //~^ERROR: undefined behavior
-    //~| encountered reference to mutable memory
+    //~| NOTE encountered reference to mutable memory
 
     // This *must not build*, the constant we are matching against
     // could change its value!
diff --git a/tests/ui/consts/const_refs_to_static_fail_invalid.stderr b/tests/ui/consts/const_refs_to_static_fail_invalid.stderr
index c9d5cb6..e0086e0 100644
--- a/tests/ui/consts/const_refs_to_static_fail_invalid.stderr
+++ b/tests/ui/consts/const_refs_to_static_fail_invalid.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const_refs_to_static_fail_invalid.rs:8:5
+  --> $DIR/const_refs_to_static_fail_invalid.rs:10:5
    |
 LL |     const C: &bool = unsafe { std::mem::transmute(&S) };
    |     ^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered 0x0a, but expected a boolean
@@ -10,7 +10,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const_refs_to_static_fail_invalid.rs:24:5
+  --> $DIR/const_refs_to_static_fail_invalid.rs:26:5
    |
 LL |     const C: &i8 = unsafe { &S };
    |     ^^^^^^^^^^^^ constructing invalid value: encountered reference to `extern` static in `const`
@@ -21,7 +21,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const_refs_to_static_fail_invalid.rs:38:5
+  --> $DIR/const_refs_to_static_fail_invalid.rs:40:5
    |
 LL |     const C: &i32 = unsafe { &S_MUT };
    |     ^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
diff --git a/tests/ui/consts/issue-17718-const-bad-values.rs b/tests/ui/consts/issue-17718-const-bad-values.rs
index c4de7b6..2869723 100644
--- a/tests/ui/consts/issue-17718-const-bad-values.rs
+++ b/tests/ui/consts/issue-17718-const-bad-values.rs
@@ -1,5 +1,6 @@
 //@ normalize-stderr: "\(size: \d+, align: \d+\)" -> "(size: $$PTR, align: $$PTR)"
 //@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*A(LLOC)?[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
+//@ dont-require-annotations: NOTE
 
 #![allow(static_mut_refs)]
 
@@ -9,6 +10,6 @@
 static mut S: i32 = 3;
 const C2: &'static mut i32 = unsafe { &mut S };
 //~^ ERROR: it is undefined behavior to use this value
-//~| reference to mutable memory
+//~| NOTE reference to mutable memory
 
 fn main() {}
diff --git a/tests/ui/consts/issue-17718-const-bad-values.stderr b/tests/ui/consts/issue-17718-const-bad-values.stderr
index 364fa7b..102491e 100644
--- a/tests/ui/consts/issue-17718-const-bad-values.stderr
+++ b/tests/ui/consts/issue-17718-const-bad-values.stderr
@@ -1,11 +1,11 @@
 error[E0764]: mutable references are not allowed in the final value of constants
-  --> $DIR/issue-17718-const-bad-values.rs:6:34
+  --> $DIR/issue-17718-const-bad-values.rs:7:34
    |
 LL | const C1: &'static mut [usize] = &mut [];
    |                                  ^^^^^^^
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/issue-17718-const-bad-values.rs:10:1
+  --> $DIR/issue-17718-const-bad-values.rs:11:1
    |
 LL | const C2: &'static mut i32 = unsafe { &mut S };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
diff --git a/tests/ui/consts/issue-39974.rs b/tests/ui/consts/issue-39974.rs
index 9cb1800..adc65d9 100644
--- a/tests/ui/consts/issue-39974.rs
+++ b/tests/ui/consts/issue-39974.rs
@@ -1,10 +1,11 @@
 const LENGTH: f64 = 2;
 //~^ ERROR mismatched types
+//~| NOTE expected `f64`, found integer
 
 struct Thing {
     f: [[f64; 2]; LENGTH],
     //~^ ERROR mismatched types
-    //~| expected `usize`, found `f64`
+    //~| NOTE expected `usize`, found `f64`
 }
 
 fn main() {
diff --git a/tests/ui/consts/issue-39974.stderr b/tests/ui/consts/issue-39974.stderr
index d03f709..1c15deb 100644
--- a/tests/ui/consts/issue-39974.stderr
+++ b/tests/ui/consts/issue-39974.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-39974.rs:5:19
+  --> $DIR/issue-39974.rs:6:19
    |
 LL |     f: [[f64; 2]; LENGTH],
    |                   ^^^^^^ expected `usize`, found `f64`
diff --git a/tests/ui/consts/miri_unleashed/assoc_const_2.rs b/tests/ui/consts/miri_unleashed/assoc_const_2.rs
index 5490c09..1d8ed20 100644
--- a/tests/ui/consts/miri_unleashed/assoc_const_2.rs
+++ b/tests/ui/consts/miri_unleashed/assoc_const_2.rs
@@ -1,4 +1,5 @@
 //@ build-fail
+//@ dont-require-annotations: NOTE
 
 // a test demonstrating that const qualification cannot prevent monomorphization time errors
 
@@ -24,5 +25,5 @@ impl Bar<String> for String {}
 fn main() {
     let x = <() as Bar<()>>::F;
     // this test only causes errors due to the line below, so post-monomorphization
-    let y = <String as Bar<String>>::F; //~ constant
+    let y = <String as Bar<String>>::F; //~ NOTE constant
 }
diff --git a/tests/ui/consts/miri_unleashed/assoc_const_2.stderr b/tests/ui/consts/miri_unleashed/assoc_const_2.stderr
index e923d95..5503f8e 100644
--- a/tests/ui/consts/miri_unleashed/assoc_const_2.stderr
+++ b/tests/ui/consts/miri_unleashed/assoc_const_2.stderr
@@ -1,17 +1,17 @@
 error[E0080]: evaluation of `<std::string::String as Bar<std::string::String>>::F` failed
-  --> $DIR/assoc_const_2.rs:10:20
+  --> $DIR/assoc_const_2.rs:11:20
    |
 LL |     const F: u32 = 100 / U::X;
    |                    ^^^^^^^^^^ attempt to divide `100_u32` by zero
 
 note: erroneous constant encountered
-  --> $DIR/assoc_const_2.rs:27:13
+  --> $DIR/assoc_const_2.rs:28:13
    |
 LL |     let y = <String as Bar<String>>::F;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 note: erroneous constant encountered
-  --> $DIR/assoc_const_2.rs:27:13
+  --> $DIR/assoc_const_2.rs:28:13
    |
 LL |     let y = <String as Bar<String>>::F;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static.rs b/tests/ui/consts/miri_unleashed/const_refers_to_static.rs
index fdccc17..c66aaec 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static.rs
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static.rs
@@ -1,6 +1,7 @@
 //@ compile-flags: -Zunleash-the-miri-inside-of-you
 //@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
 //@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
+//@ dont-require-annotations: NOTE
 
 use std::sync::atomic::AtomicUsize;
 use std::sync::atomic::Ordering;
@@ -20,7 +21,7 @@
 
 // Evaluating this does not read anything mutable, but validation does, so this should error.
 const REF_INTERIOR_MUT: &usize = { //~ ERROR undefined behavior
-    //~| encountered reference to mutable memory
+    //~| NOTE encountered reference to mutable memory
     static FOO: AtomicUsize = AtomicUsize::new(0);
     unsafe { &*(&FOO as *const _ as *const usize) }
 };
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static.stderr
index f8e0606..f647107 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static.stderr
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static.stderr
@@ -1,23 +1,23 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const_refers_to_static.rs:10:5
+  --> $DIR/const_refers_to_static.rs:11:5
    |
 LL |     FOO.fetch_add(1, Ordering::Relaxed)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ calling non-const function `AtomicUsize::fetch_add`
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const_refers_to_static.rs:15:14
+  --> $DIR/const_refers_to_static.rs:16:14
    |
 LL |     unsafe { *(&FOO as *const _ as *const usize) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses mutable global memory
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const_refers_to_static.rs:19:32
+  --> $DIR/const_refers_to_static.rs:20:32
    |
 LL | const READ_MUT: u32 = unsafe { MUTABLE };
    |                                ^^^^^^^ constant accesses mutable global memory
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const_refers_to_static.rs:22:1
+  --> $DIR/const_refers_to_static.rs:23:1
    |
 LL | const REF_INTERIOR_MUT: &usize = {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
@@ -30,7 +30,7 @@
 warning: skipping const checks
    |
 help: skipping check that does not even have a feature gate
-  --> $DIR/const_refers_to_static.rs:10:5
+  --> $DIR/const_refers_to_static.rs:11:5
    |
 LL |     FOO.fetch_add(1, Ordering::Relaxed)
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs
index b33ebfb..86d23d4 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs
@@ -2,6 +2,8 @@
 //@ aux-build:static_cross_crate.rs
 //@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
 //@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
+//@ dont-require-annotations: NOTE
+
 #![feature(half_open_range_patterns_in_slices)]
 #![allow(static_mut_refs)]
 
@@ -10,25 +12,25 @@
 // Sneaky: reference to a mutable static.
 // Allowing this would be a disaster for pattern matching, we could violate exhaustiveness checking!
 const SLICE_MUT: &[u8; 1] = { //~ ERROR undefined behavior
-    //~| encountered reference to mutable memory
+    //~| NOTE encountered reference to mutable memory
     unsafe { &static_cross_crate::ZERO }
 };
 
 const U8_MUT: &u8 = { //~ ERROR undefined behavior
-    //~| encountered reference to mutable memory
+    //~| NOTE encountered reference to mutable memory
     unsafe { &static_cross_crate::ZERO[0] }
 };
 
 // Also test indirection that reads from other static.
 const U8_MUT2: &u8 = { //~ ERROR undefined behavior
-    //~| encountered reference to mutable memory
+    //~| NOTE encountered reference to mutable memory
     unsafe { &(*static_cross_crate::ZERO_REF)[0] }
 };
 const U8_MUT3: &u8 = {
     unsafe {
         match static_cross_crate::OPT_ZERO {
             //~^ ERROR evaluation of constant value failed
-            //~| constant accesses mutable global memory
+            //~| NOTE constant accesses mutable global memory
             Some(ref u) => u,
             None => panic!(),
         }
diff --git a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr
index 8f8271c..4e5052e 100644
--- a/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr
+++ b/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const_refers_to_static_cross_crate.rs:12:1
+  --> $DIR/const_refers_to_static_cross_crate.rs:14:1
    |
 LL | const SLICE_MUT: &[u8; 1] = {
    | ^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
@@ -10,7 +10,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const_refers_to_static_cross_crate.rs:17:1
+  --> $DIR/const_refers_to_static_cross_crate.rs:19:1
    |
 LL | const U8_MUT: &u8 = {
    | ^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
@@ -21,7 +21,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/const_refers_to_static_cross_crate.rs:23:1
+  --> $DIR/const_refers_to_static_cross_crate.rs:25:1
    |
 LL | const U8_MUT2: &u8 = {
    | ^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
@@ -32,7 +32,7 @@
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/const_refers_to_static_cross_crate.rs:29:15
+  --> $DIR/const_refers_to_static_cross_crate.rs:31:15
    |
 LL |         match static_cross_crate::OPT_ZERO {
    |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constant accesses mutable global memory
diff --git a/tests/ui/consts/miri_unleashed/mutable_references.rs b/tests/ui/consts/miri_unleashed/mutable_references.rs
index e7fc569..02a35487e 100644
--- a/tests/ui/consts/miri_unleashed/mutable_references.rs
+++ b/tests/ui/consts/miri_unleashed/mutable_references.rs
@@ -1,6 +1,7 @@
 //@ compile-flags: -Zunleash-the-miri-inside-of-you
 //@ normalize-stderr: "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
 //@ normalize-stderr: "([0-9a-f][0-9a-f] |╾─*ALLOC[0-9]+(\+[a-z0-9]+)?(<imm>)?─*╼ )+ *│.*" -> "HEX_DUMP"
+//@ dont-require-annotations: NOTE
 
 #![allow(static_mut_refs)]
 use std::cell::UnsafeCell;
@@ -11,10 +12,10 @@
 // This requires walking nested statics.
 static FOO: &&mut u32 = &&mut 42;
 //~^ ERROR it is undefined behavior to use this value
-//~| pointing to read-only memory
+//~| NOTE pointing to read-only memory
 static OH_YES: &mut i32 = &mut 42;
 //~^ ERROR it is undefined behavior to use this value
-//~| pointing to read-only memory
+//~| NOTE pointing to read-only memory
 static BAR: &mut () = &mut ();
 //~^ ERROR encountered mutable pointer in final value of static
 
@@ -25,11 +26,11 @@
 
 const BLUNT: &mut i32 = &mut 42;
 //~^ ERROR: it is undefined behavior to use this value
-//~| pointing to read-only memory
+//~| NOTE pointing to read-only memory
 
 const SUBTLE: &mut i32 = unsafe {
     //~^ ERROR: it is undefined behavior to use this value
-    //~| constructing invalid value: encountered reference to mutable memory in `const`
+    //~| NOTE constructing invalid value: encountered reference to mutable memory in `const`
     static mut STATIC: i32 = 0;
     &mut STATIC
 };
@@ -42,13 +43,13 @@ struct Meh {
 unsafe impl Sync for Meh {}
 static MEH: Meh = Meh { x: &UnsafeCell::new(42) };
 //~^ ERROR it is undefined behavior to use this value
-//~| `UnsafeCell` in read-only memory
+//~| NOTE `UnsafeCell` in read-only memory
 // Same with a const:
 // the following will never be ok! no interior mut behind consts, because
 // all allocs interned here will be marked immutable.
 const MUH: Meh = Meh {
     //~^ ERROR it is undefined behavior to use this value
-    //~| `UnsafeCell` in read-only memory
+    //~| NOTE `UnsafeCell` in read-only memory
     x: &UnsafeCell::new(42),
 };
 
@@ -60,30 +61,30 @@ unsafe impl Sync for Synced {}
 // Make sure we also catch this behind a type-erased `dyn Trait` reference.
 const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
 //~^ ERROR: it is undefined behavior to use this value
-//~| `UnsafeCell` in read-only memory
+//~| NOTE `UnsafeCell` in read-only memory
 
 // # Check for mutable references to read-only memory
 
 static READONLY: i32 = 0;
 static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) };
 //~^ ERROR: it is undefined behavior to use this value
-//~| pointing to read-only memory
+//~| NOTE pointing to read-only memory
 
 // # Check for consts pointing to mutable memory
 
 static mut MUTABLE: i32 = 42;
-const POINTS_TO_MUTABLE: &i32 = unsafe { &MUTABLE }; //~ERROR: undefined behavior
-//~| encountered reference to mutable memory
+const POINTS_TO_MUTABLE: &i32 = unsafe { &MUTABLE }; //~ ERROR undefined behavior
+//~| NOTE encountered reference to mutable memory
 static mut MUTABLE_REF: &mut i32 = &mut 42;
 const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF };
-//~^ ERROR: evaluation of constant value failed
-//~| accesses mutable global memory
+//~^ ERROR evaluation of constant value failed
+//~| NOTE accesses mutable global memory
 
 const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _;
-//~^ ERROR: mutable pointer in final value
+//~^ ERROR mutable pointer in final value
 
 const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _;
-//~^ ERROR: mutable pointer in final value
+//~^ ERROR mutable pointer in final value
 
 // This does *not* error since it uses a shared reference, and we have to ignore
 // those. See <https://github.com/rust-lang/rust/pull/128543>.
diff --git a/tests/ui/consts/miri_unleashed/mutable_references.stderr b/tests/ui/consts/miri_unleashed/mutable_references.stderr
index ce5ceda..3049be8 100644
--- a/tests/ui/consts/miri_unleashed/mutable_references.stderr
+++ b/tests/ui/consts/miri_unleashed/mutable_references.stderr
@@ -1,5 +1,5 @@
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mutable_references.rs:12:1
+  --> $DIR/mutable_references.rs:13:1
    |
 LL | static FOO: &&mut u32 = &&mut 42;
    | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>: encountered mutable reference or box pointing to read-only memory
@@ -10,7 +10,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mutable_references.rs:15:1
+  --> $DIR/mutable_references.rs:16:1
    |
 LL | static OH_YES: &mut i32 = &mut 42;
    | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference or box pointing to read-only memory
@@ -21,19 +21,19 @@
            }
 
 error: encountered mutable pointer in final value of static
-  --> $DIR/mutable_references.rs:18:1
+  --> $DIR/mutable_references.rs:19:1
    |
 LL | static BAR: &mut () = &mut ();
    | ^^^^^^^^^^^^^^^^^^^
 
 error: encountered mutable pointer in final value of static
-  --> $DIR/mutable_references.rs:23:1
+  --> $DIR/mutable_references.rs:24:1
    |
 LL | static BOO: &mut Foo<()> = &mut Foo(());
    | ^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mutable_references.rs:26:1
+  --> $DIR/mutable_references.rs:27:1
    |
 LL | const BLUNT: &mut i32 = &mut 42;
    | ^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference or box pointing to read-only memory
@@ -44,7 +44,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mutable_references.rs:30:1
+  --> $DIR/mutable_references.rs:31:1
    |
 LL | const SUBTLE: &mut i32 = unsafe {
    | ^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
@@ -55,7 +55,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mutable_references.rs:43:1
+  --> $DIR/mutable_references.rs:44:1
    |
 LL | static MEH: Meh = Meh { x: &UnsafeCell::new(42) };
    | ^^^^^^^^^^^^^^^ constructing invalid value at .x.<deref>: encountered `UnsafeCell` in read-only memory
@@ -66,7 +66,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mutable_references.rs:49:1
+  --> $DIR/mutable_references.rs:50:1
    |
 LL | const MUH: Meh = Meh {
    | ^^^^^^^^^^^^^^ constructing invalid value at .x.<deref>: encountered `UnsafeCell` in read-only memory
@@ -77,7 +77,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mutable_references.rs:61:1
+  --> $DIR/mutable_references.rs:62:1
    |
 LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
    | ^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value at .<deref>.<dyn-downcast>.x: encountered `UnsafeCell` in read-only memory
@@ -88,7 +88,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mutable_references.rs:68:1
+  --> $DIR/mutable_references.rs:69:1
    |
 LL | static mut MUT_TO_READONLY: &mut i32 = unsafe { &mut *(&READONLY as *const _ as *mut _) };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered mutable reference or box pointing to read-only memory
@@ -99,7 +99,7 @@
            }
 
 error[E0080]: it is undefined behavior to use this value
-  --> $DIR/mutable_references.rs:75:1
+  --> $DIR/mutable_references.rs:76:1
    |
 LL | const POINTS_TO_MUTABLE: &i32 = unsafe { &MUTABLE };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructing invalid value: encountered reference to mutable memory in `const`
@@ -110,37 +110,37 @@
            }
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/mutable_references.rs:78:43
+  --> $DIR/mutable_references.rs:79:43
    |
 LL | const POINTS_TO_MUTABLE2: &i32 = unsafe { &*MUTABLE_REF };
    |                                           ^^^^^^^^^^^^^ constant accesses mutable global memory
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references.rs:82:1
+  --> $DIR/mutable_references.rs:83:1
    |
 LL | const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references.rs:85:1
+  --> $DIR/mutable_references.rs:86:1
    |
 LL | const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references.rs:105:1
+  --> $DIR/mutable_references.rs:106:1
    |
 LL | const RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x: &mut 42 as *mut _ as *const _ };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: encountered mutable pointer in final value of constant
-  --> $DIR/mutable_references.rs:108:1
+  --> $DIR/mutable_references.rs:109:1
    |
 LL | const RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error[E0594]: cannot assign to `*OH_YES`, as `OH_YES` is an immutable static item
-  --> $DIR/mutable_references.rs:115:5
+  --> $DIR/mutable_references.rs:116:5
    |
 LL |     *OH_YES = 99;
    |     ^^^^^^^^^^^^ cannot assign
@@ -148,72 +148,72 @@
 warning: skipping const checks
    |
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:12:26
+  --> $DIR/mutable_references.rs:13:26
    |
 LL | static FOO: &&mut u32 = &&mut 42;
    |                          ^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:15:27
+  --> $DIR/mutable_references.rs:16:27
    |
 LL | static OH_YES: &mut i32 = &mut 42;
    |                           ^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:18:23
+  --> $DIR/mutable_references.rs:19:23
    |
 LL | static BAR: &mut () = &mut ();
    |                       ^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:23:28
+  --> $DIR/mutable_references.rs:24:28
    |
 LL | static BOO: &mut Foo<()> = &mut Foo(());
    |                            ^^^^^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:26:25
+  --> $DIR/mutable_references.rs:27:25
    |
 LL | const BLUNT: &mut i32 = &mut 42;
    |                         ^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:43:28
+  --> $DIR/mutable_references.rs:44:28
    |
 LL | static MEH: Meh = Meh { x: &UnsafeCell::new(42) };
    |                            ^^^^^^^^^^^^^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:52:8
+  --> $DIR/mutable_references.rs:53:8
    |
 LL |     x: &UnsafeCell::new(42),
    |        ^^^^^^^^^^^^^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:61:27
+  --> $DIR/mutable_references.rs:62:27
    |
 LL | const SNEAKY: &dyn Sync = &Synced { x: UnsafeCell::new(42) };
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:82:45
+  --> $DIR/mutable_references.rs:83:45
    |
 LL | const POINTS_TO_MUTABLE_INNER: *const i32 = &mut 42 as *mut _ as *const _;
    |                                             ^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:85:46
+  --> $DIR/mutable_references.rs:86:46
    |
 LL | const POINTS_TO_MUTABLE_INNER2: *const i32 = &mut 42 as *const _;
    |                                              ^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:90:47
+  --> $DIR/mutable_references.rs:91:47
    |
 LL | const INTERIOR_MUTABLE_BEHIND_RAW: *mut i32 = &UnsafeCell::new(42) as *const _ as *mut _;
    |                                               ^^^^^^^^^^^^^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:102:51
+  --> $DIR/mutable_references.rs:103:51
    |
 LL | const RAW_SYNC: SyncPtr<AtomicI32> = SyncPtr { x: &AtomicI32::new(42) };
    |                                                   ^^^^^^^^^^^^^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:105:49
+  --> $DIR/mutable_references.rs:106:49
    |
 LL | const RAW_MUT_CAST: SyncPtr<i32> = SyncPtr { x: &mut 42 as *mut _ as *const _ };
    |                                                 ^^^^^^^
 help: skipping check that does not even have a feature gate
-  --> $DIR/mutable_references.rs:108:51
+  --> $DIR/mutable_references.rs:109:51
    |
 LL | const RAW_MUT_COERCE: SyncPtr<i32> = SyncPtr { x: &mut 0 };
    |                                                   ^^^^^^
diff --git a/tests/ui/consts/offset_from_ub.rs b/tests/ui/consts/offset_from_ub.rs
index 53d9c7a..47511c0 100644
--- a/tests/ui/consts/offset_from_ub.rs
+++ b/tests/ui/consts/offset_from_ub.rs
@@ -1,4 +1,6 @@
 //@ normalize-stderr: "\d+ bytes" -> "$$BYTES bytes"
+//@ dont-require-annotations: NOTE
+
 #![feature(core_intrinsics)]
 
 use std::intrinsics::{ptr_offset_from, ptr_offset_from_unsigned};
@@ -16,7 +18,7 @@ struct Struct {
     let uninit2 = std::mem::MaybeUninit::<Struct>::uninit();
     let field_ptr: *const Struct = &uninit2 as *const _ as *const Struct;
     let offset = unsafe { ptr_offset_from(field_ptr, base_ptr) }; //~ERROR evaluation of constant value failed
-    //~| not both derived from the same allocation
+    //~| NOTE not both derived from the same allocation
     offset as usize
 };
 
@@ -29,14 +31,14 @@ struct Struct {
     let base_ptr = data.as_ptr();
     let field_ptr = &data[1] as *const u8 as *const u16;
     unsafe { ptr_offset_from(field_ptr, base_ptr as *const u16) } //~ERROR evaluation of constant value failed
-    //~| 1_isize cannot be divided by 2_isize without remainder
+    //~| NOTE 1_isize cannot be divided by 2_isize without remainder
 };
 
 pub const DIFFERENT_INT: isize = { // offset_from with two different integers: like DIFFERENT_ALLOC
     let ptr1 = 8 as *const u8;
     let ptr2 = 16 as *const u8;
     unsafe { ptr_offset_from(ptr2, ptr1) } //~ERROR evaluation of constant value failed
-    //~| not both derived from the same allocation
+    //~| NOTE not both derived from the same allocation
 };
 
 const OUT_OF_BOUNDS_1: isize = {
@@ -45,7 +47,7 @@ struct Struct {
     let end_ptr = (start_ptr).wrapping_add(length);
     // First ptr is out of bounds
     unsafe { ptr_offset_from(end_ptr, start_ptr) } //~ERROR evaluation of constant value failed
-    //~| the memory range between them is not in-bounds of an allocation
+    //~| NOTE the memory range between them is not in-bounds of an allocation
 };
 
 const OUT_OF_BOUNDS_2: isize = {
@@ -54,7 +56,7 @@ struct Struct {
     let end_ptr = (start_ptr).wrapping_add(length);
     // Second ptr is out of bounds
     unsafe { ptr_offset_from(start_ptr, end_ptr) } //~ERROR evaluation of constant value failed
-    //~| the memory range between them is not in-bounds of an allocation
+    //~| NOTE the memory range between them is not in-bounds of an allocation
 };
 
 pub const DIFFERENT_ALLOC_UNSIGNED: usize = {
@@ -63,20 +65,20 @@ struct Struct {
     let uninit2 = std::mem::MaybeUninit::<Struct>::uninit();
     let field_ptr: *const Struct = &uninit2 as *const _ as *const Struct;
     unsafe { ptr_offset_from_unsigned(field_ptr, base_ptr) } //~ERROR evaluation of constant value failed
-    //~| not both derived from the same allocation
+    //~| NOTE not both derived from the same allocation
 };
 
 pub const TOO_FAR_APART1: isize = {
     let ptr1 = &0u8 as *const u8;
     let ptr2 = ptr1.wrapping_add(isize::MAX as usize + 42);
     unsafe { ptr_offset_from(ptr2, ptr1) } //~ERROR evaluation of constant value failed
-    //~| too far ahead
+    //~| NOTE too far ahead
 };
 pub const TOO_FAR_APART2: isize = {
     let ptr1 = &0u8 as *const u8;
     let ptr2 = ptr1.wrapping_add(isize::MAX as usize + 42);
     unsafe { ptr_offset_from(ptr1, ptr2) } //~ERROR evaluation of constant value failed
-    //~| too far before
+    //~| NOTE too far before
 };
 pub const TOO_FAR_APART3: isize = {
     let ptr1 = &0u8 as *const u8;
@@ -84,21 +86,21 @@ struct Struct {
     // The result of this would be `isize::MIN`, which *does* fit in an `isize`, but its
     // absolute value does not. (Also anyway there cannot be an allocation of that size.)
     unsafe { ptr_offset_from(ptr1, ptr2) } //~ERROR evaluation of constant value failed
-    //~| too far before
+    //~| NOTE too far before
 };
 
 const WRONG_ORDER_UNSIGNED: usize = {
     let a = ['a', 'b', 'c'];
     let p = a.as_ptr();
     unsafe { ptr_offset_from_unsigned(p, p.add(2) ) } //~ERROR evaluation of constant value failed
-    //~| first pointer has smaller offset than second: 0 < 8
+    //~| NOTE first pointer has smaller offset than second: 0 < 8
 };
 pub const TOO_FAR_APART_UNSIGNED: usize = {
     let ptr1 = &0u8 as *const u8;
     let ptr2 = ptr1.wrapping_add(isize::MAX as usize + 42);
     // This would fit into a `usize` but we still don't allow it.
     unsafe { ptr_offset_from_unsigned(ptr2, ptr1) } //~ERROR evaluation of constant value failed
-    //~| too far ahead
+    //~| NOTE too far ahead
 };
 
 // These do NOT complain that pointers are too far apart; they pass that check (to then fail the
diff --git a/tests/ui/consts/offset_from_ub.stderr b/tests/ui/consts/offset_from_ub.stderr
index 08e42c9..5bfb9a11 100644
--- a/tests/ui/consts/offset_from_ub.stderr
+++ b/tests/ui/consts/offset_from_ub.stderr
@@ -1,11 +1,11 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:18:27
+  --> $DIR/offset_from_ub.rs:20:27
    |
 LL |     let offset = unsafe { ptr_offset_from(field_ptr, base_ptr) };
    |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called on two different pointers that are not both derived from the same allocation
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:24:14
+  --> $DIR/offset_from_ub.rs:26:14
    |
 LL |     unsafe { (42 as *const u8).offset_from(&5u8) as usize }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called on two different pointers that are not both derived from the same allocation
@@ -14,67 +14,67 @@
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:31:14
+  --> $DIR/offset_from_ub.rs:33:14
    |
 LL |     unsafe { ptr_offset_from(field_ptr, base_ptr as *const u16) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ exact_div: 1_isize cannot be divided by 2_isize without remainder
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:38:14
+  --> $DIR/offset_from_ub.rs:40:14
    |
 LL |     unsafe { ptr_offset_from(ptr2, ptr1) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called on two different pointers that are not both derived from the same allocation
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:47:14
+  --> $DIR/offset_from_ub.rs:49:14
    |
 LL |     unsafe { ptr_offset_from(end_ptr, start_ptr) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called on two different pointers where the memory range between them is not in-bounds of an allocation
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:56:14
+  --> $DIR/offset_from_ub.rs:58:14
    |
 LL |     unsafe { ptr_offset_from(start_ptr, end_ptr) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called on two different pointers where the memory range between them is not in-bounds of an allocation
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:65:14
+  --> $DIR/offset_from_ub.rs:67:14
    |
 LL |     unsafe { ptr_offset_from_unsigned(field_ptr, base_ptr) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called on two different pointers that are not both derived from the same allocation
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:72:14
+  --> $DIR/offset_from_ub.rs:74:14
    |
 LL |     unsafe { ptr_offset_from(ptr2, ptr1) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far ahead of second
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:78:14
+  --> $DIR/offset_from_ub.rs:80:14
    |
 LL |     unsafe { ptr_offset_from(ptr1, ptr2) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far before second
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:86:14
+  --> $DIR/offset_from_ub.rs:88:14
    |
 LL |     unsafe { ptr_offset_from(ptr1, ptr2) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far before second
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:93:14
+  --> $DIR/offset_from_ub.rs:95:14
    |
 LL |     unsafe { ptr_offset_from_unsigned(p, p.add(2) ) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer has smaller offset than second: 0 < 8
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:100:14
+  --> $DIR/offset_from_ub.rs:102:14
    |
 LL |     unsafe { ptr_offset_from_unsigned(ptr2, ptr1) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from_unsigned` called when first pointer is too far ahead of second
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:109:14
+  --> $DIR/offset_from_ub.rs:111:14
    |
 LL |     unsafe { ptr2.offset_from(ptr1) }
    |              ^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called on two different pointers that are not both derived from the same allocation
@@ -83,7 +83,7 @@
   --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
 
 error[E0080]: evaluation of constant value failed
-  --> $DIR/offset_from_ub.rs:115:14
+  --> $DIR/offset_from_ub.rs:117:14
    |
 LL |     unsafe { ptr1.offset_from(ptr2.wrapping_offset(1)) }
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ptr_offset_from` called when first pointer is too far before second
diff --git a/tests/ui/consts/required-consts/interpret-in-const-called-fn.noopt.stderr b/tests/ui/consts/required-consts/interpret-in-const-called-fn.noopt.stderr
index 9184df4..f98e2c1 100644
--- a/tests/ui/consts/required-consts/interpret-in-const-called-fn.noopt.stderr
+++ b/tests/ui/consts/required-consts/interpret-in-const-called-fn.noopt.stderr
@@ -5,7 +5,7 @@
    |                   ^^^^^^^^ evaluation panicked: explicit panic
 
 note: erroneous constant encountered
-  --> $DIR/interpret-in-const-called-fn.rs:17:9
+  --> $DIR/interpret-in-const-called-fn.rs:18:9
    |
 LL |         Fail::<T>::C;
    |         ^^^^^^^^^^^^
diff --git a/tests/ui/consts/required-consts/interpret-in-const-called-fn.opt.stderr b/tests/ui/consts/required-consts/interpret-in-const-called-fn.opt.stderr
index 9184df4..f98e2c1 100644
--- a/tests/ui/consts/required-consts/interpret-in-const-called-fn.opt.stderr
+++ b/tests/ui/consts/required-consts/interpret-in-const-called-fn.opt.stderr
@@ -5,7 +5,7 @@
    |                   ^^^^^^^^ evaluation panicked: explicit panic
 
 note: erroneous constant encountered
-  --> $DIR/interpret-in-const-called-fn.rs:17:9
+  --> $DIR/interpret-in-const-called-fn.rs:18:9
    |
 LL |         Fail::<T>::C;
    |         ^^^^^^^^^^^^
diff --git a/tests/ui/consts/required-consts/interpret-in-const-called-fn.rs b/tests/ui/consts/required-consts/interpret-in-const-called-fn.rs
index f2e83f5..1ed6853 100644
--- a/tests/ui/consts/required-consts/interpret-in-const-called-fn.rs
+++ b/tests/ui/consts/required-consts/interpret-in-const-called-fn.rs
@@ -6,6 +6,7 @@
 struct Fail<T>(T);
 impl<T> Fail<T> {
     const C: () = panic!(); //~ERROR evaluation of `Fail::<i32>::C` failed
+                            //~| NOTE in this expansion of panic!
 }
 
 #[inline(never)]
@@ -14,7 +15,7 @@ const fn no_codegen<T>() {
         // This bad constant is only used in dead code in a no-codegen function... and yet we still
         // must make sure that the build fails.
         // This relies on const-eval evaluating all `required_consts` of `const fn`.
-        Fail::<T>::C; //~ constant
+        Fail::<T>::C; //~ NOTE constant
     }
 }
 
diff --git a/tests/ui/consts/required-consts/interpret-in-promoted.noopt.stderr b/tests/ui/consts/required-consts/interpret-in-promoted.noopt.stderr
index 2bd0b92..f70e262 100644
--- a/tests/ui/consts/required-consts/interpret-in-promoted.noopt.stderr
+++ b/tests/ui/consts/required-consts/interpret-in-promoted.noopt.stderr
@@ -1,11 +1,11 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/interpret-in-promoted.rs:13:28
+  --> $DIR/interpret-in-promoted.rs:15:28
    |
 LL |     let _x: &'static () = &ub();
    |                            ^^^^ entering unreachable code
    |
 note: inside `ub`
-  --> $DIR/interpret-in-promoted.rs:7:5
+  --> $DIR/interpret-in-promoted.rs:9:5
    |
 LL |     std::hint::unreachable_unchecked();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -13,7 +13,7 @@
   --> $SRC_DIR/core/src/hint.rs:LL:COL
 
 note: erroneous constant encountered
-  --> $DIR/interpret-in-promoted.rs:13:27
+  --> $DIR/interpret-in-promoted.rs:15:27
    |
 LL |     let _x: &'static () = &ub();
    |                           ^^^^^
diff --git a/tests/ui/consts/required-consts/interpret-in-promoted.opt.stderr b/tests/ui/consts/required-consts/interpret-in-promoted.opt.stderr
index 2bd0b92..f70e262 100644
--- a/tests/ui/consts/required-consts/interpret-in-promoted.opt.stderr
+++ b/tests/ui/consts/required-consts/interpret-in-promoted.opt.stderr
@@ -1,11 +1,11 @@
 error[E0080]: evaluation of constant value failed
-  --> $DIR/interpret-in-promoted.rs:13:28
+  --> $DIR/interpret-in-promoted.rs:15:28
    |
 LL |     let _x: &'static () = &ub();
    |                            ^^^^ entering unreachable code
    |
 note: inside `ub`
-  --> $DIR/interpret-in-promoted.rs:7:5
+  --> $DIR/interpret-in-promoted.rs:9:5
    |
 LL |     std::hint::unreachable_unchecked();
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -13,7 +13,7 @@
   --> $SRC_DIR/core/src/hint.rs:LL:COL
 
 note: erroneous constant encountered
-  --> $DIR/interpret-in-promoted.rs:13:27
+  --> $DIR/interpret-in-promoted.rs:15:27
    |
 LL |     let _x: &'static () = &ub();
    |                           ^^^^^
diff --git a/tests/ui/consts/required-consts/interpret-in-promoted.rs b/tests/ui/consts/required-consts/interpret-in-promoted.rs
index 2c7b337..85d2ea3 100644
--- a/tests/ui/consts/required-consts/interpret-in-promoted.rs
+++ b/tests/ui/consts/required-consts/interpret-in-promoted.rs
@@ -1,10 +1,12 @@
 //@revisions: noopt opt
 //@[noopt] compile-flags: -Copt-level=0
 //@[opt] compile-flags: -O
+//@ dont-require-annotations: NOTE
+
 //! Make sure we evaluate const fn calls even if they get promoted and their result ignored.
 
 const unsafe fn ub() {
-    std::hint::unreachable_unchecked(); //~ inside `ub`
+    std::hint::unreachable_unchecked(); //~ NOTE inside `ub`
 }
 
 pub const FOO: () = unsafe {
diff --git a/tests/ui/consts/required-consts/interpret-in-static.noopt.stderr b/tests/ui/consts/required-consts/interpret-in-static.noopt.stderr
index aa778de..28daf26 100644
--- a/tests/ui/consts/required-consts/interpret-in-static.noopt.stderr
+++ b/tests/ui/consts/required-consts/interpret-in-static.noopt.stderr
@@ -5,7 +5,7 @@
    |                   ^^^^^^^^ evaluation panicked: explicit panic
 
 note: erroneous constant encountered
-  --> $DIR/interpret-in-static.rs:16:9
+  --> $DIR/interpret-in-static.rs:17:9
    |
 LL |         Fail::<i32>::C;
    |         ^^^^^^^^^^^^^^
diff --git a/tests/ui/consts/required-consts/interpret-in-static.opt.stderr b/tests/ui/consts/required-consts/interpret-in-static.opt.stderr
index aa778de..28daf26 100644
--- a/tests/ui/consts/required-consts/interpret-in-static.opt.stderr
+++ b/tests/ui/consts/required-consts/interpret-in-static.opt.stderr
@@ -5,7 +5,7 @@
    |                   ^^^^^^^^ evaluation panicked: explicit panic
 
 note: erroneous constant encountered
-  --> $DIR/interpret-in-static.rs:16:9
+  --> $DIR/interpret-in-static.rs:17:9
    |
 LL |         Fail::<i32>::C;
    |         ^^^^^^^^^^^^^^
diff --git a/tests/ui/consts/required-consts/interpret-in-static.rs b/tests/ui/consts/required-consts/interpret-in-static.rs
index 8bacd03..7ddf15f 100644
--- a/tests/ui/consts/required-consts/interpret-in-static.rs
+++ b/tests/ui/consts/required-consts/interpret-in-static.rs
@@ -6,6 +6,7 @@
 struct Fail<T>(T);
 impl<T> Fail<T> {
     const C: () = panic!(); //~ERROR evaluation of `Fail::<i32>::C` failed
+                            //~| NOTE in this expansion of panic!
 }
 
 pub static FOO: () = {
@@ -13,7 +14,7 @@ impl<T> Fail<T> {
         // This bad constant is only used in dead code in a static initializer... and yet we still
         // must make sure that the build fails.
         // This relies on const-eval evaluating all `required_consts` of the `static` MIR body.
-        Fail::<i32>::C; //~ constant
+        Fail::<i32>::C; //~ NOTE constant
     }
 };
 
diff --git a/tests/ui/consts/uninhabited-const-issue-61744.rs b/tests/ui/consts/uninhabited-const-issue-61744.rs
index 743aaf5..802d422 100644
--- a/tests/ui/consts/uninhabited-const-issue-61744.rs
+++ b/tests/ui/consts/uninhabited-const-issue-61744.rs
@@ -1,11 +1,12 @@
 //@ build-fail
+//@ dont-require-annotations: NOTE
 
 pub const unsafe fn fake_type<T>() -> T {
-    hint_unreachable() //~ inside
+    hint_unreachable() //~ NOTE inside
 }
 
 pub const unsafe fn hint_unreachable() -> ! {
-    fake_type() //~ inside
+    fake_type() //~ NOTE inside
 }
 
 trait Const {
diff --git a/tests/ui/consts/uninhabited-const-issue-61744.stderr b/tests/ui/consts/uninhabited-const-issue-61744.stderr
index dd175b9..d0e90f9 100644
--- a/tests/ui/consts/uninhabited-const-issue-61744.stderr
+++ b/tests/ui/consts/uninhabited-const-issue-61744.stderr
@@ -1,641 +1,641 @@
 error[E0080]: evaluation of `fake_type::<!>` failed
-  --> $DIR/uninhabited-const-issue-61744.rs:12:36
+  --> $DIR/uninhabited-const-issue-61744.rs:13:36
    |
 LL |     const CONSTANT: i32 = unsafe { fake_type() };
    |                                    ^^^^^^^^^^^ reached the configured maximum number of stack frames
    |
 note: inside `fake_type::<i32>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^
 note: inside `hint_unreachable`
-  --> $DIR/uninhabited-const-issue-61744.rs:8:5
+  --> $DIR/uninhabited-const-issue-61744.rs:9:5
    |
 LL |     fake_type()
    |     ^^^^^^^^^^^
 note: inside `fake_type::<!>`
-  --> $DIR/uninhabited-const-issue-61744.rs:4:5
+  --> $DIR/uninhabited-const-issue-61744.rs:5:5
    |
 LL |     hint_unreachable()
    |     ^^^^^^^^^^^^^^^^^^ the failure occurred here
diff --git a/tests/ui/coroutine/drop-tracking-parent-expression.rs b/tests/ui/coroutine/drop-tracking-parent-expression.rs
index 0f4d99c..702cbc8 100644
--- a/tests/ui/coroutine/drop-tracking-parent-expression.rs
+++ b/tests/ui/coroutine/drop-tracking-parent-expression.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 #![feature(coroutines, negative_impls, rustc_attrs, stmt_expr_attributes)]
 
 macro_rules! type_combinations {
@@ -15,9 +17,9 @@ impl !Send for Client {}
         // dropped *after* the yield.
         {
             let g = #[coroutine] move || match drop($name::Client { ..$name::Client::default() }) {
-            //~^ `significant_drop::Client` which is not `Send`
-            //~| `insignificant_dtor::Client` which is not `Send`
-            //~| `derived_drop::Client` which is not `Send`
+            //~^ NOTE `significant_drop::Client` which is not `Send`
+            //~| NOTE `insignificant_dtor::Client` which is not `Send`
+            //~| NOTE `derived_drop::Client` which is not `Send`
                 _ => yield,
             };
             assert_send(g);
diff --git a/tests/ui/coroutine/drop-tracking-parent-expression.stderr b/tests/ui/coroutine/drop-tracking-parent-expression.stderr
index dc2f976..2f5fe88 100644
--- a/tests/ui/coroutine/drop-tracking-parent-expression.stderr
+++ b/tests/ui/coroutine/drop-tracking-parent-expression.stderr
@@ -1,5 +1,5 @@
 error: coroutine cannot be sent between threads safely
-  --> $DIR/drop-tracking-parent-expression.rs:23:13
+  --> $DIR/drop-tracking-parent-expression.rs:25:13
    |
 LL |               assert_send(g);
    |               ^^^^^^^^^^^^^^ coroutine is not `Send`
@@ -12,9 +12,9 @@
 LL | |     );
    | |_____- in this macro invocation
    |
-   = help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `derived_drop::Client`
+   = help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:19:34: 19:41}`, the trait `Send` is not implemented for `derived_drop::Client`
 note: coroutine is not `Send` as this value is used across a yield
-  --> $DIR/drop-tracking-parent-expression.rs:21:22
+  --> $DIR/drop-tracking-parent-expression.rs:23:22
    |
 LL |               let g = #[coroutine] move || match drop($name::Client { ..$name::Client::default() }) {
    |                                                                         ------------------------ has type `derived_drop::Client` which is not `Send`
@@ -30,14 +30,14 @@
 LL | |     );
    | |_____- in this macro invocation
 note: required by a bound in `assert_send`
-  --> $DIR/drop-tracking-parent-expression.rs:40:19
+  --> $DIR/drop-tracking-parent-expression.rs:42:19
    |
 LL | fn assert_send<T: Send>(_thing: T) {}
    |                   ^^^^ required by this bound in `assert_send`
    = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: coroutine cannot be sent between threads safely
-  --> $DIR/drop-tracking-parent-expression.rs:23:13
+  --> $DIR/drop-tracking-parent-expression.rs:25:13
    |
 LL |               assert_send(g);
    |               ^^^^^^^^^^^^^^ coroutine is not `Send`
@@ -50,9 +50,9 @@
 LL | |     );
    | |_____- in this macro invocation
    |
-   = help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `significant_drop::Client`
+   = help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:19:34: 19:41}`, the trait `Send` is not implemented for `significant_drop::Client`
 note: coroutine is not `Send` as this value is used across a yield
-  --> $DIR/drop-tracking-parent-expression.rs:21:22
+  --> $DIR/drop-tracking-parent-expression.rs:23:22
    |
 LL |               let g = #[coroutine] move || match drop($name::Client { ..$name::Client::default() }) {
    |                                                                         ------------------------ has type `significant_drop::Client` which is not `Send`
@@ -68,14 +68,14 @@
 LL | |     );
    | |_____- in this macro invocation
 note: required by a bound in `assert_send`
-  --> $DIR/drop-tracking-parent-expression.rs:40:19
+  --> $DIR/drop-tracking-parent-expression.rs:42:19
    |
 LL | fn assert_send<T: Send>(_thing: T) {}
    |                   ^^^^ required by this bound in `assert_send`
    = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: coroutine cannot be sent between threads safely
-  --> $DIR/drop-tracking-parent-expression.rs:23:13
+  --> $DIR/drop-tracking-parent-expression.rs:25:13
    |
 LL |               assert_send(g);
    |               ^^^^^^^^^^^^^^ coroutine is not `Send`
@@ -88,9 +88,9 @@
 LL | |     );
    | |_____- in this macro invocation
    |
-   = help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `insignificant_dtor::Client`
+   = help: within `{coroutine@$DIR/drop-tracking-parent-expression.rs:19:34: 19:41}`, the trait `Send` is not implemented for `insignificant_dtor::Client`
 note: coroutine is not `Send` as this value is used across a yield
-  --> $DIR/drop-tracking-parent-expression.rs:21:22
+  --> $DIR/drop-tracking-parent-expression.rs:23:22
    |
 LL |               let g = #[coroutine] move || match drop($name::Client { ..$name::Client::default() }) {
    |                                                                         ------------------------ has type `insignificant_dtor::Client` which is not `Send`
@@ -106,7 +106,7 @@
 LL | |     );
    | |_____- in this macro invocation
 note: required by a bound in `assert_send`
-  --> $DIR/drop-tracking-parent-expression.rs:40:19
+  --> $DIR/drop-tracking-parent-expression.rs:42:19
    |
 LL | fn assert_send<T: Send>(_thing: T) {}
    |                   ^^^^ required by this bound in `assert_send`
diff --git a/tests/ui/coroutine/parent-expression.rs b/tests/ui/coroutine/parent-expression.rs
index 0f4d99c..702cbc8 100644
--- a/tests/ui/coroutine/parent-expression.rs
+++ b/tests/ui/coroutine/parent-expression.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 #![feature(coroutines, negative_impls, rustc_attrs, stmt_expr_attributes)]
 
 macro_rules! type_combinations {
@@ -15,9 +17,9 @@ impl !Send for Client {}
         // dropped *after* the yield.
         {
             let g = #[coroutine] move || match drop($name::Client { ..$name::Client::default() }) {
-            //~^ `significant_drop::Client` which is not `Send`
-            //~| `insignificant_dtor::Client` which is not `Send`
-            //~| `derived_drop::Client` which is not `Send`
+            //~^ NOTE `significant_drop::Client` which is not `Send`
+            //~| NOTE `insignificant_dtor::Client` which is not `Send`
+            //~| NOTE `derived_drop::Client` which is not `Send`
                 _ => yield,
             };
             assert_send(g);
diff --git a/tests/ui/coroutine/parent-expression.stderr b/tests/ui/coroutine/parent-expression.stderr
index a912577..f14bf05 100644
--- a/tests/ui/coroutine/parent-expression.stderr
+++ b/tests/ui/coroutine/parent-expression.stderr
@@ -1,5 +1,5 @@
 error: coroutine cannot be sent between threads safely
-  --> $DIR/parent-expression.rs:23:13
+  --> $DIR/parent-expression.rs:25:13
    |
 LL |               assert_send(g);
    |               ^^^^^^^^^^^^^^ coroutine is not `Send`
@@ -12,9 +12,9 @@
 LL | |     );
    | |_____- in this macro invocation
    |
-   = help: within `{coroutine@$DIR/parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `derived_drop::Client`
+   = help: within `{coroutine@$DIR/parent-expression.rs:19:34: 19:41}`, the trait `Send` is not implemented for `derived_drop::Client`
 note: coroutine is not `Send` as this value is used across a yield
-  --> $DIR/parent-expression.rs:21:22
+  --> $DIR/parent-expression.rs:23:22
    |
 LL |               let g = #[coroutine] move || match drop($name::Client { ..$name::Client::default() }) {
    |                                                                         ------------------------ has type `derived_drop::Client` which is not `Send`
@@ -30,14 +30,14 @@
 LL | |     );
    | |_____- in this macro invocation
 note: required by a bound in `assert_send`
-  --> $DIR/parent-expression.rs:40:19
+  --> $DIR/parent-expression.rs:42:19
    |
 LL | fn assert_send<T: Send>(_thing: T) {}
    |                   ^^^^ required by this bound in `assert_send`
    = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: coroutine cannot be sent between threads safely
-  --> $DIR/parent-expression.rs:23:13
+  --> $DIR/parent-expression.rs:25:13
    |
 LL |               assert_send(g);
    |               ^^^^^^^^^^^^^^ coroutine is not `Send`
@@ -50,9 +50,9 @@
 LL | |     );
    | |_____- in this macro invocation
    |
-   = help: within `{coroutine@$DIR/parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `significant_drop::Client`
+   = help: within `{coroutine@$DIR/parent-expression.rs:19:34: 19:41}`, the trait `Send` is not implemented for `significant_drop::Client`
 note: coroutine is not `Send` as this value is used across a yield
-  --> $DIR/parent-expression.rs:21:22
+  --> $DIR/parent-expression.rs:23:22
    |
 LL |               let g = #[coroutine] move || match drop($name::Client { ..$name::Client::default() }) {
    |                                                                         ------------------------ has type `significant_drop::Client` which is not `Send`
@@ -68,14 +68,14 @@
 LL | |     );
    | |_____- in this macro invocation
 note: required by a bound in `assert_send`
-  --> $DIR/parent-expression.rs:40:19
+  --> $DIR/parent-expression.rs:42:19
    |
 LL | fn assert_send<T: Send>(_thing: T) {}
    |                   ^^^^ required by this bound in `assert_send`
    = note: this error originates in the macro `type_combinations` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: coroutine cannot be sent between threads safely
-  --> $DIR/parent-expression.rs:23:13
+  --> $DIR/parent-expression.rs:25:13
    |
 LL |               assert_send(g);
    |               ^^^^^^^^^^^^^^ coroutine is not `Send`
@@ -88,9 +88,9 @@
 LL | |     );
    | |_____- in this macro invocation
    |
-   = help: within `{coroutine@$DIR/parent-expression.rs:17:34: 17:41}`, the trait `Send` is not implemented for `insignificant_dtor::Client`
+   = help: within `{coroutine@$DIR/parent-expression.rs:19:34: 19:41}`, the trait `Send` is not implemented for `insignificant_dtor::Client`
 note: coroutine is not `Send` as this value is used across a yield
-  --> $DIR/parent-expression.rs:21:22
+  --> $DIR/parent-expression.rs:23:22
    |
 LL |               let g = #[coroutine] move || match drop($name::Client { ..$name::Client::default() }) {
    |                                                                         ------------------------ has type `insignificant_dtor::Client` which is not `Send`
@@ -106,7 +106,7 @@
 LL | |     );
    | |_____- in this macro invocation
 note: required by a bound in `assert_send`
-  --> $DIR/parent-expression.rs:40:19
+  --> $DIR/parent-expression.rs:42:19
    |
 LL | fn assert_send<T: Send>(_thing: T) {}
    |                   ^^^^ required by this bound in `assert_send`
diff --git a/tests/ui/coverage-attr/bad-attr-ice.rs b/tests/ui/coverage-attr/bad-attr-ice.rs
index 8d57bbb..aeb4407 100644
--- a/tests/ui/coverage-attr/bad-attr-ice.rs
+++ b/tests/ui/coverage-attr/bad-attr-ice.rs
@@ -10,7 +10,7 @@
 
 #[coverage]
 //~^ ERROR malformed `coverage` attribute input
-//[nofeat]~| the `#[coverage]` attribute is an experimental feature
+//[nofeat]~| ERROR the `#[coverage]` attribute is an experimental feature
 fn main() {}
 
 // FIXME(#130766): When the `#[coverage(..)]` attribute is stabilized,
diff --git a/tests/ui/cross/cross-borrow-trait.rs b/tests/ui/cross/cross-borrow-trait.rs
index 180a75e..88ea78e 100644
--- a/tests/ui/cross/cross-borrow-trait.rs
+++ b/tests/ui/cross/cross-borrow-trait.rs
@@ -1,6 +1,8 @@
 // Test that cross-borrowing (implicitly converting from `Box<T>` to `&T`) is
 // forbidden when `T` is a trait.
 
+//@ dont-require-annotations: NOTE
+
 struct Foo;
 trait Trait { fn foo(&self) {} }
 impl Trait for Foo {}
@@ -8,6 +10,6 @@ impl Trait for Foo {}
 pub fn main() {
     let x: Box<dyn Trait> = Box::new(Foo);
     let _y: &dyn Trait = x; //~ ERROR E0308
-                            //~| expected reference `&dyn Trait`
-                            //~| found struct `Box<dyn Trait>`
+                            //~| NOTE expected reference `&dyn Trait`
+                            //~| NOTE found struct `Box<dyn Trait>`
 }
diff --git a/tests/ui/cross/cross-borrow-trait.stderr b/tests/ui/cross/cross-borrow-trait.stderr
index b670de3..5fe80b5 100644
--- a/tests/ui/cross/cross-borrow-trait.stderr
+++ b/tests/ui/cross/cross-borrow-trait.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/cross-borrow-trait.rs:10:26
+  --> $DIR/cross-borrow-trait.rs:12:26
    |
 LL |     let _y: &dyn Trait = x;
    |             ----------   ^ expected `&dyn Trait`, found `Box<dyn Trait>`
diff --git a/tests/ui/destructure-trait-ref.rs b/tests/ui/destructure-trait-ref.rs
index 50b64ae..daa0ca3 100644
--- a/tests/ui/destructure-trait-ref.rs
+++ b/tests/ui/destructure-trait-ref.rs
@@ -1,6 +1,8 @@
 // The regression test for #15031 to make sure destructuring trait
 // reference work properly.
 
+//@ dont-require-annotations: NOTE
+
 #![feature(box_patterns)]
 
 trait T { fn foo(&self) {} }
@@ -31,14 +33,14 @@ fn main() {
     // n > m
     let &&x = &1isize as &dyn T;
     //~^ ERROR mismatched types
-    //~| expected trait object `dyn T`
-    //~| found reference `&_`
+    //~| NOTE expected trait object `dyn T`
+    //~| NOTE found reference `&_`
     let &&&x = &(&1isize as &dyn T);
     //~^ ERROR mismatched types
-    //~| expected trait object `dyn T`
-    //~| found reference `&_`
+    //~| NOTE expected trait object `dyn T`
+    //~| NOTE found reference `&_`
     let box box x = Box::new(1isize) as Box<dyn T>;
     //~^ ERROR mismatched types
-    //~| expected trait object `dyn T`
-    //~| found struct `Box<_>`
+    //~| NOTE expected trait object `dyn T`
+    //~| NOTE found struct `Box<_>`
 }
diff --git a/tests/ui/destructure-trait-ref.stderr b/tests/ui/destructure-trait-ref.stderr
index 38d2018..0b5ea55 100644
--- a/tests/ui/destructure-trait-ref.stderr
+++ b/tests/ui/destructure-trait-ref.stderr
@@ -1,23 +1,23 @@
 error[E0033]: type `&dyn T` cannot be dereferenced
-  --> $DIR/destructure-trait-ref.rs:26:9
+  --> $DIR/destructure-trait-ref.rs:28:9
    |
 LL |     let &x = &1isize as &dyn T;
    |         ^^ type `&dyn T` cannot be dereferenced
 
 error[E0033]: type `&dyn T` cannot be dereferenced
-  --> $DIR/destructure-trait-ref.rs:27:10
+  --> $DIR/destructure-trait-ref.rs:29:10
    |
 LL |     let &&x = &(&1isize as &dyn T);
    |          ^^ type `&dyn T` cannot be dereferenced
 
 error[E0033]: type `Box<dyn T>` cannot be dereferenced
-  --> $DIR/destructure-trait-ref.rs:28:9
+  --> $DIR/destructure-trait-ref.rs:30:9
    |
 LL |     let box x = Box::new(1isize) as Box<dyn T>;
    |         ^^^^^ type `Box<dyn T>` cannot be dereferenced
 
 error[E0308]: mismatched types
-  --> $DIR/destructure-trait-ref.rs:32:10
+  --> $DIR/destructure-trait-ref.rs:34:10
    |
 LL |     let &&x = &1isize as &dyn T;
    |          ^^   ----------------- this expression has type `&dyn T`
@@ -33,7 +33,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/destructure-trait-ref.rs:36:11
+  --> $DIR/destructure-trait-ref.rs:38:11
    |
 LL |     let &&&x = &(&1isize as &dyn T);
    |           ^^   -------------------- this expression has type `&&dyn T`
@@ -49,7 +49,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/destructure-trait-ref.rs:40:13
+  --> $DIR/destructure-trait-ref.rs:42:13
    |
 LL |     let box box x = Box::new(1isize) as Box<dyn T>;
    |             ^^^^^   ------------------------------ this expression has type `Box<dyn T>`
diff --git a/tests/ui/diagnostic-width/long-E0529.rs b/tests/ui/diagnostic-width/long-E0529.rs
index 759a902..4146d3b 100644
--- a/tests/ui/diagnostic-width/long-E0529.rs
+++ b/tests/ui/diagnostic-width/long-E0529.rs
@@ -1,4 +1,5 @@
 //@ compile-flags: --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
+//@ dont-require-annotations: NOTE
 
 type A = (i32, i32, i32, i32);
 type B = (A, A, A, A);
@@ -7,7 +8,7 @@
 
 fn foo(x: D) {
     let [] = x; //~ ERROR expected an array or slice, found `(...
-    //~^ pattern cannot match with input type `(...
+    //~^ NOTE pattern cannot match with input type `(...
 }
 
 fn main() {}
diff --git a/tests/ui/diagnostic-width/long-E0529.stderr b/tests/ui/diagnostic-width/long-E0529.stderr
index bf3144c..e5b82b5 100644
--- a/tests/ui/diagnostic-width/long-E0529.stderr
+++ b/tests/ui/diagnostic-width/long-E0529.stderr
@@ -1,5 +1,5 @@
 error[E0529]: expected an array or slice, found `(..., ..., ..., ...)`
-  --> $DIR/long-E0529.rs:9:9
+  --> $DIR/long-E0529.rs:10:9
    |
 LL |     let [] = x;
    |         ^^ pattern cannot match with input type `(..., ..., ..., ...)`
diff --git a/tests/ui/diagnostic-width/long-E0618.rs b/tests/ui/diagnostic-width/long-E0618.rs
index b499bed..247061d 100644
--- a/tests/ui/diagnostic-width/long-E0618.rs
+++ b/tests/ui/diagnostic-width/long-E0618.rs
@@ -1,11 +1,12 @@
 //@ compile-flags: --diagnostic-width=60 -Zwrite-long-types-to-disk=yes
+//@ dont-require-annotations: NOTE
 
 type A = (i32, i32, i32, i32);
 type B = (A, A, A, A);
 type C = (B, B, B, B);
 type D = (C, C, C, C);
 
-fn foo(x: D) { //~ `x` has type `(...
+fn foo(x: D) { //~ NOTE `x` has type `(...
     x(); //~ ERROR expected function, found `(...
 }
 
diff --git a/tests/ui/diagnostic-width/long-E0618.stderr b/tests/ui/diagnostic-width/long-E0618.stderr
index 05bf999..7d92b94 100644
--- a/tests/ui/diagnostic-width/long-E0618.stderr
+++ b/tests/ui/diagnostic-width/long-E0618.stderr
@@ -1,5 +1,5 @@
 error[E0618]: expected function, found `(..., ..., ..., ...)`
-  --> $DIR/long-E0618.rs:9:5
+  --> $DIR/long-E0618.rs:10:5
    |
 LL | fn foo(x: D) {
    |        - `x` has type `(..., ..., ..., ...)`
diff --git a/tests/ui/diagnostic_namespace/on_unimplemented/custom-on-unimplemented-diagnostic.rs b/tests/ui/diagnostic_namespace/on_unimplemented/custom-on-unimplemented-diagnostic.rs
index 3bb0939..44a84f4 100644
--- a/tests/ui/diagnostic_namespace/on_unimplemented/custom-on-unimplemented-diagnostic.rs
+++ b/tests/ui/diagnostic_namespace/on_unimplemented/custom-on-unimplemented-diagnostic.rs
@@ -1,5 +1,7 @@
 //@ reference: attributes.diagnostic.on_unimplemented.intro
 //@ reference: attributes.diagnostic.on_unimplemented.keys
+//@ dont-require-annotations: NOTE
+
 #[diagnostic::on_unimplemented(message = "my message", label = "my label", note = "my note")]
 pub trait ProviderLt {}
 
@@ -16,6 +18,6 @@ impl<T: ?Sized + ProviderLt> ProviderExt for T {}
 fn main() {
     B.request();
     //~^ ERROR my message [E0599]
-    //~| my label
-    //~| my note
+    //~| NOTE my label
+    //~| NOTE my note
 }
diff --git a/tests/ui/diagnostic_namespace/on_unimplemented/custom-on-unimplemented-diagnostic.stderr b/tests/ui/diagnostic_namespace/on_unimplemented/custom-on-unimplemented-diagnostic.stderr
index 4c18386..1ba2c2e 100644
--- a/tests/ui/diagnostic_namespace/on_unimplemented/custom-on-unimplemented-diagnostic.stderr
+++ b/tests/ui/diagnostic_namespace/on_unimplemented/custom-on-unimplemented-diagnostic.stderr
@@ -1,5 +1,5 @@
 error[E0599]: my message
-  --> $DIR/custom-on-unimplemented-diagnostic.rs:17:7
+  --> $DIR/custom-on-unimplemented-diagnostic.rs:19:7
    |
 LL | struct B;
    | -------- method `request` not found for this struct because it doesn't satisfy `B: ProviderExt` or `B: ProviderLt`
@@ -8,7 +8,7 @@
    |       ^^^^^^^ my label
    |
 note: trait bound `B: ProviderLt` was not satisfied
-  --> $DIR/custom-on-unimplemented-diagnostic.rs:12:18
+  --> $DIR/custom-on-unimplemented-diagnostic.rs:14:18
    |
 LL | impl<T: ?Sized + ProviderLt> ProviderExt for T {}
    |                  ^^^^^^^^^^  -----------     -
@@ -16,13 +16,13 @@
    |                  unsatisfied trait bound introduced here
    = note: my note
 note: the trait `ProviderLt` must be implemented
-  --> $DIR/custom-on-unimplemented-diagnostic.rs:4:1
+  --> $DIR/custom-on-unimplemented-diagnostic.rs:6:1
    |
 LL | pub trait ProviderLt {}
    | ^^^^^^^^^^^^^^^^^^^^
    = help: items from traits can only be used if the trait is implemented and in scope
 note: `ProviderExt` defines an item `request`, perhaps you need to implement it
-  --> $DIR/custom-on-unimplemented-diagnostic.rs:6:1
+  --> $DIR/custom-on-unimplemented-diagnostic.rs:8:1
    |
 LL | pub trait ProviderExt {
    | ^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/diagnostic_namespace/on_impl_trait.rs b/tests/ui/diagnostic_namespace/on_unimplemented/on_impl_trait.rs
similarity index 75%
rename from tests/ui/diagnostic_namespace/on_impl_trait.rs
rename to tests/ui/diagnostic_namespace/on_unimplemented/on_impl_trait.rs
index 32a492c..1ffa604 100644
--- a/tests/ui/diagnostic_namespace/on_impl_trait.rs
+++ b/tests/ui/diagnostic_namespace/on_unimplemented/on_impl_trait.rs
@@ -1,5 +1,6 @@
-// used to ICE, see <https://github.com/rust-lang/rust/issues/130627>
-// Instead it should just ignore the diagnostic attribute
+//! used to ICE, see <https://github.com/rust-lang/rust/issues/130627>
+//! Instead it should just ignore the diagnostic attribute
+
 #![feature(trait_alias)]
 
 trait Test {}
diff --git a/tests/ui/diagnostic_namespace/on_impl_trait.stderr b/tests/ui/diagnostic_namespace/on_unimplemented/on_impl_trait.stderr
similarity index 88%
rename from tests/ui/diagnostic_namespace/on_impl_trait.stderr
rename to tests/ui/diagnostic_namespace/on_unimplemented/on_impl_trait.stderr
index 59b9c31..5eee647 100644
--- a/tests/ui/diagnostic_namespace/on_impl_trait.stderr
+++ b/tests/ui/diagnostic_namespace/on_unimplemented/on_impl_trait.stderr
@@ -1,5 +1,5 @@
 warning: `#[diagnostic::on_unimplemented]` can only be applied to trait definitions
-  --> $DIR/on_impl_trait.rs:7:1
+  --> $DIR/on_impl_trait.rs:8:1
    |
 LL | #[diagnostic::on_unimplemented(message = "blah", label = "blah", note = "blah")]
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -7,7 +7,7 @@
    = note: `#[warn(unknown_or_malformed_diagnostic_attributes)]` on by default
 
 error[E0277]: the trait bound `{integer}: Alias` is not satisfied
-  --> $DIR/on_impl_trait.rs:15:9
+  --> $DIR/on_impl_trait.rs:16:9
    |
 LL |     foo(&1);
    |     --- ^^ the trait `Test` is not implemented for `{integer}`
@@ -15,13 +15,13 @@
    |     required by a bound introduced by this call
    |
 help: this trait has no implementations, consider adding one
-  --> $DIR/on_impl_trait.rs:5:1
+  --> $DIR/on_impl_trait.rs:6:1
    |
 LL | trait Test {}
    | ^^^^^^^^^^
    = note: required for `{integer}` to implement `Alias`
 note: required by a bound in `foo`
-  --> $DIR/on_impl_trait.rs:12:11
+  --> $DIR/on_impl_trait.rs:13:11
    |
 LL | fn foo<T: Alias>(v: &T) {}
    |           ^^^^^ required by this bound in `foo`
diff --git a/tests/ui/dst/dst-bad-assign-3.rs b/tests/ui/dst/dst-bad-assign-3.rs
index f96ecf7..e9e6913 100644
--- a/tests/ui/dst/dst-bad-assign-3.rs
+++ b/tests/ui/dst/dst-bad-assign-3.rs
@@ -1,5 +1,7 @@
 // Forbid assignment into a dynamically sized type.
 
+//@ dont-require-annotations: NOTE
+
 struct Fat<T: ?Sized>(isize, &'static str, T);
 
 #[derive(PartialEq,Eq)]
@@ -30,8 +32,8 @@ pub fn main() {
     let z: Box<dyn ToBar> = Box::new(Bar1 {f: 36});
     f5.2 = Bar1 {f: 36};
     //~^ ERROR mismatched types
-    //~| expected `dyn ToBar`, found `Bar1`
-    //~| expected trait object `dyn ToBar`
-    //~| found struct `Bar1`
+    //~| NOTE expected `dyn ToBar`, found `Bar1`
+    //~| NOTE expected trait object `dyn ToBar`
+    //~| NOTE found struct `Bar1`
     //~| ERROR the size for values of type
 }
diff --git a/tests/ui/dst/dst-bad-assign-3.stderr b/tests/ui/dst/dst-bad-assign-3.stderr
index 4aa1677..007f6b8 100644
--- a/tests/ui/dst/dst-bad-assign-3.stderr
+++ b/tests/ui/dst/dst-bad-assign-3.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/dst-bad-assign-3.rs:31:12
+  --> $DIR/dst-bad-assign-3.rs:33:12
    |
 LL |     f5.2 = Bar1 {f: 36};
    |     ----   ^^^^^^^^^^^^ expected `dyn ToBar`, found `Bar1`
@@ -11,7 +11,7 @@
    = help: `Bar1` implements `ToBar` so you could box the found value and coerce it to the trait object `Box<dyn ToBar>`, you will have to change the expected type as well
 
 error[E0277]: the size for values of type `dyn ToBar` cannot be known at compilation time
-  --> $DIR/dst-bad-assign-3.rs:31:5
+  --> $DIR/dst-bad-assign-3.rs:33:5
    |
 LL |     f5.2 = Bar1 {f: 36};
    |     ^^^^ doesn't have a size known at compile-time
diff --git a/tests/ui/dst/dst-bad-assign.rs b/tests/ui/dst/dst-bad-assign.rs
index c55fb2c..79a3f5c 100644
--- a/tests/ui/dst/dst-bad-assign.rs
+++ b/tests/ui/dst/dst-bad-assign.rs
@@ -1,5 +1,7 @@
 // Forbid assignment into a dynamically sized type.
 
+//@ dont-require-annotations: NOTE
+
 struct Fat<T: ?Sized> {
     f1: isize,
     f2: &'static str,
@@ -34,8 +36,8 @@ pub fn main() {
     let z: Box<dyn ToBar> = Box::new(Bar1 {f: 36});
     f5.ptr = Bar1 {f: 36};
     //~^ ERROR mismatched types
-    //~| expected `dyn ToBar`, found `Bar1`
-    //~| expected trait object `dyn ToBar`
-    //~| found struct `Bar1`
+    //~| NOTE expected `dyn ToBar`, found `Bar1`
+    //~| NOTE expected trait object `dyn ToBar`
+    //~| NOTE found struct `Bar1`
     //~| ERROR the size for values of type
 }
diff --git a/tests/ui/dst/dst-bad-assign.stderr b/tests/ui/dst/dst-bad-assign.stderr
index f935d27..fc73069 100644
--- a/tests/ui/dst/dst-bad-assign.stderr
+++ b/tests/ui/dst/dst-bad-assign.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/dst-bad-assign.rs:35:14
+  --> $DIR/dst-bad-assign.rs:37:14
    |
 LL |     f5.ptr = Bar1 {f: 36};
    |     ------   ^^^^^^^^^^^^ expected `dyn ToBar`, found `Bar1`
@@ -11,7 +11,7 @@
    = help: `Bar1` implements `ToBar` so you could box the found value and coerce it to the trait object `Box<dyn ToBar>`, you will have to change the expected type as well
 
 error[E0277]: the size for values of type `dyn ToBar` cannot be known at compilation time
-  --> $DIR/dst-bad-assign.rs:35:5
+  --> $DIR/dst-bad-assign.rs:37:5
    |
 LL |     f5.ptr = Bar1 {f: 36};
    |     ^^^^^^ doesn't have a size known at compile-time
diff --git a/tests/ui/dst/dst-bad-coerce4.rs b/tests/ui/dst/dst-bad-coerce4.rs
index 25410aa..b5288d5 100644
--- a/tests/ui/dst/dst-bad-coerce4.rs
+++ b/tests/ui/dst/dst-bad-coerce4.rs
@@ -9,7 +9,8 @@ pub fn main() {
     let f1: &Fat<[isize]> = &Fat { ptr: [1, 2, 3] };
     let f2: &Fat<[isize; 3]> = f1;
     //~^ ERROR mismatched types
-    //~| expected `&Fat<[isize; 3]>`, found `&Fat<[isize]>`
-    //~| expected reference `&Fat<[isize; 3]>`
-    //~| found reference `&Fat<[isize]>`
+    //~| NOTE expected `&Fat<[isize; 3]>`, found `&Fat<[isize]>`
+    //~| NOTE expected reference `&Fat<[isize; 3]>`
+    //~| NOTE found reference `&Fat<[isize]>`
+    //~| NOTE expected due to this
 }
diff --git a/tests/ui/empty/empty-never-array.rs b/tests/ui/empty/empty-never-array.rs
index fd93346..c84d9bd 100644
--- a/tests/ui/empty/empty-never-array.rs
+++ b/tests/ui/empty/empty-never-array.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 #![feature(never_type)]
 
 enum Helper<T, U> {
@@ -9,7 +11,7 @@ enum Helper<T, U> {
 fn transmute<T, U>(t: T) -> U {
     let Helper::U(u) = Helper::T(t, []);
     //~^ ERROR refutable pattern in local binding
-    //~| `Helper::T(_, _)` not covered
+    //~| NOTE `Helper::T(_, _)` not covered
     u
 }
 
diff --git a/tests/ui/empty/empty-never-array.stderr b/tests/ui/empty/empty-never-array.stderr
index f9f39a6..ee04ff1 100644
--- a/tests/ui/empty/empty-never-array.stderr
+++ b/tests/ui/empty/empty-never-array.stderr
@@ -1,5 +1,5 @@
 error[E0005]: refutable pattern in local binding
-  --> $DIR/empty-never-array.rs:10:9
+  --> $DIR/empty-never-array.rs:12:9
    |
 LL |     let Helper::U(u) = Helper::T(t, []);
    |         ^^^^^^^^^^^^ pattern `Helper::T(_, _)` not covered
@@ -7,7 +7,7 @@
    = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
 note: `Helper<T, U>` defined here
-  --> $DIR/empty-never-array.rs:3:6
+  --> $DIR/empty-never-array.rs:5:6
    |
 LL | enum Helper<T, U> {
    |      ^^^^^^
diff --git a/tests/ui/enum-discriminant/discriminant-overflow.rs b/tests/ui/enum-discriminant/discriminant-overflow.rs
index 774ced9..aa3f4c1 100644
--- a/tests/ui/enum-discriminant/discriminant-overflow.rs
+++ b/tests/ui/enum-discriminant/discriminant-overflow.rs
@@ -1,8 +1,9 @@
 // Issue 23030: Detect overflowing discriminant
-
 // See also run-pass/discrim-explicit-23030.rs where the suggested
 // workaround is tested.
 
+//@ dont-require-annotations: NOTE
+
 fn f_i8() {
     #[repr(i8)]
     enum A {
@@ -42,7 +43,7 @@ enum A {
         Ok = u16::MAX - 1,
         Ok2,
         OhNo, //~ ERROR enum discriminant overflowed [E0370]
-              //~| overflowed on value after 65535
+              //~| NOTE overflowed on value after 65535
     }
 
     let x = A::Ok;
@@ -54,7 +55,7 @@ enum A {
         Ok = i32::MAX - 1,
         Ok2,
         OhNo, //~ ERROR enum discriminant overflowed [E0370]
-              //~| overflowed on value after 2147483647
+              //~| NOTE overflowed on value after 2147483647
     }
 
     let x = A::Ok;
@@ -66,7 +67,7 @@ enum A {
         Ok = u32::MAX - 1,
         Ok2,
         OhNo, //~ ERROR enum discriminant overflowed [E0370]
-              //~| overflowed on value after 4294967295
+              //~| NOTE overflowed on value after 4294967295
     }
 
     let x = A::Ok;
@@ -78,7 +79,7 @@ enum A {
         Ok = i64::MAX - 1,
         Ok2,
         OhNo, //~ ERROR enum discriminant overflowed [E0370]
-              //~| overflowed on value after 9223372036854775807
+              //~| NOTE overflowed on value after 9223372036854775807
     }
 
     let x = A::Ok;
@@ -90,7 +91,7 @@ enum A {
         Ok = u64::MAX - 1,
         Ok2,
         OhNo, //~ ERROR enum discriminant overflowed [E0370]
-              //~| overflowed on value after 18446744073709551615
+              //~| NOTE overflowed on value after 18446744073709551615
     }
 
     let x = A::Ok;
diff --git a/tests/ui/enum-discriminant/discriminant-overflow.stderr b/tests/ui/enum-discriminant/discriminant-overflow.stderr
index 2ecc183..2662ddb 100644
--- a/tests/ui/enum-discriminant/discriminant-overflow.stderr
+++ b/tests/ui/enum-discriminant/discriminant-overflow.stderr
@@ -1,5 +1,5 @@
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discriminant-overflow.rs:11:9
+  --> $DIR/discriminant-overflow.rs:12:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 127
@@ -7,7 +7,7 @@
    = note: explicitly set `OhNo = -128` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discriminant-overflow.rs:22:9
+  --> $DIR/discriminant-overflow.rs:23:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 255
@@ -15,7 +15,7 @@
    = note: explicitly set `OhNo = 0` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discriminant-overflow.rs:33:9
+  --> $DIR/discriminant-overflow.rs:34:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 32767
@@ -23,7 +23,7 @@
    = note: explicitly set `OhNo = -32768` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discriminant-overflow.rs:44:9
+  --> $DIR/discriminant-overflow.rs:45:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 65535
@@ -31,7 +31,7 @@
    = note: explicitly set `OhNo = 0` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discriminant-overflow.rs:56:9
+  --> $DIR/discriminant-overflow.rs:57:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 2147483647
@@ -39,7 +39,7 @@
    = note: explicitly set `OhNo = -2147483648` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discriminant-overflow.rs:68:9
+  --> $DIR/discriminant-overflow.rs:69:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 4294967295
@@ -47,7 +47,7 @@
    = note: explicitly set `OhNo = 0` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discriminant-overflow.rs:80:9
+  --> $DIR/discriminant-overflow.rs:81:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 9223372036854775807
@@ -55,7 +55,7 @@
    = note: explicitly set `OhNo = -9223372036854775808` if that is desired outcome
 
 error[E0370]: enum discriminant overflowed
-  --> $DIR/discriminant-overflow.rs:92:9
+  --> $DIR/discriminant-overflow.rs:93:9
    |
 LL |         OhNo,
    |         ^^^^ overflowed on value after 18446744073709551615
diff --git a/tests/ui/error-codes/E0080.rs b/tests/ui/error-codes/E0080.rs
index ea3264b..55f4505 100644
--- a/tests/ui/error-codes/E0080.rs
+++ b/tests/ui/error-codes/E0080.rs
@@ -1,7 +1,8 @@
 enum Enum {
     X = (1 << 500), //~ ERROR E0080
-    //~| attempt to shift left by `500_i32`, which would overflow
+    //~| NOTE attempt to shift left by `500_i32`, which would overflow
     Y = (1 / 0) //~ ERROR E0080
+                //~| NOTE attempt to divide `1_isize` by zero
 }
 
 fn main() {
diff --git a/tests/ui/error-codes/E0106.rs b/tests/ui/error-codes/E0106.rs
index cc34387..c803049 100644
--- a/tests/ui/error-codes/E0106.rs
+++ b/tests/ui/error-codes/E0106.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 struct Foo {
     x: &bool,
     //~^ ERROR E0106
@@ -16,10 +18,10 @@ enum Bar {
 struct Quux {
     baz: Baz,
     //~^ ERROR E0106
-    //~| expected named lifetime parameter
+    //~| NOTE expected named lifetime parameter
     buzz: Buzz,
     //~^ ERROR E0106
-    //~| expected 2 lifetime parameters
+    //~| NOTE expected 2 lifetime parameters
 }
 
 fn main() {
diff --git a/tests/ui/error-codes/E0106.stderr b/tests/ui/error-codes/E0106.stderr
index d11a24f..97ae1df9 100644
--- a/tests/ui/error-codes/E0106.stderr
+++ b/tests/ui/error-codes/E0106.stderr
@@ -1,5 +1,5 @@
 error[E0106]: missing lifetime specifier
-  --> $DIR/E0106.rs:2:8
+  --> $DIR/E0106.rs:4:8
    |
 LL |     x: &bool,
    |        ^ expected named lifetime parameter
@@ -11,7 +11,7 @@
    |
 
 error[E0106]: missing lifetime specifier
-  --> $DIR/E0106.rs:7:7
+  --> $DIR/E0106.rs:9:7
    |
 LL |     B(&bool),
    |       ^ expected named lifetime parameter
@@ -24,7 +24,7 @@
    |
 
 error[E0106]: missing lifetime specifier
-  --> $DIR/E0106.rs:10:14
+  --> $DIR/E0106.rs:12:14
    |
 LL | type MyStr = &str;
    |              ^ expected named lifetime parameter
@@ -35,7 +35,7 @@
    |           ++++    ++
 
 error[E0106]: missing lifetime specifier
-  --> $DIR/E0106.rs:17:10
+  --> $DIR/E0106.rs:19:10
    |
 LL |     baz: Baz,
    |          ^^^ expected named lifetime parameter
@@ -47,7 +47,7 @@
    |
 
 error[E0106]: missing lifetime specifiers
-  --> $DIR/E0106.rs:20:11
+  --> $DIR/E0106.rs:22:11
    |
 LL |     buzz: Buzz,
    |           ^^^^ expected 2 lifetime parameters
diff --git a/tests/ui/error-codes/E0428.rs b/tests/ui/error-codes/E0428.rs
index eb9594f..08393b0 100644
--- a/tests/ui/error-codes/E0428.rs
+++ b/tests/ui/error-codes/E0428.rs
@@ -1,4 +1,6 @@
-struct Bar; //~ previous definition of the type `Bar` here
+//@ dont-require-annotations: NOTE
+
+struct Bar; //~ NOTE previous definition of the type `Bar` here
 struct Bar; //~ ERROR E0428
 
 fn main () {
diff --git a/tests/ui/error-codes/E0428.stderr b/tests/ui/error-codes/E0428.stderr
index b5bb84e..78f5706 100644
--- a/tests/ui/error-codes/E0428.stderr
+++ b/tests/ui/error-codes/E0428.stderr
@@ -1,5 +1,5 @@
 error[E0428]: the name `Bar` is defined multiple times
-  --> $DIR/E0428.rs:2:1
+  --> $DIR/E0428.rs:4:1
    |
 LL | struct Bar;
    | ----------- previous definition of the type `Bar` here
diff --git a/tests/ui/explicit/explicit-self-lifetime-mismatch.rs b/tests/ui/explicit/explicit-self-lifetime-mismatch.rs
index a9a6f50..aa5e352 100644
--- a/tests/ui/explicit/explicit-self-lifetime-mismatch.rs
+++ b/tests/ui/explicit/explicit-self-lifetime-mismatch.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 struct Foo<'a,'b> {
     x: &'a isize,
     y: &'b isize,
@@ -7,13 +9,13 @@ impl<'a,'b> Foo<'a,'b> {
     fn bar(self:
            Foo<'b,'a>
     //~^ ERROR mismatched `self` parameter type
-    //~| expected struct `Foo<'a, 'b>`
-    //~| found struct `Foo<'b, 'a>`
-    //~| lifetime mismatch
+    //~| NOTE expected struct `Foo<'a, 'b>`
+    //~| NOTE found struct `Foo<'b, 'a>`
+    //~| NOTE lifetime mismatch
     //~| ERROR mismatched `self` parameter type
-    //~| expected struct `Foo<'a, 'b>`
-    //~| found struct `Foo<'b, 'a>`
-    //~| lifetime mismatch
+    //~| NOTE expected struct `Foo<'a, 'b>`
+    //~| NOTE found struct `Foo<'b, 'a>`
+    //~| NOTE lifetime mismatch
            ) {}
 }
 
diff --git a/tests/ui/explicit/explicit-self-lifetime-mismatch.stderr b/tests/ui/explicit/explicit-self-lifetime-mismatch.stderr
index d5ffa8f1..a20901e 100644
--- a/tests/ui/explicit/explicit-self-lifetime-mismatch.stderr
+++ b/tests/ui/explicit/explicit-self-lifetime-mismatch.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched `self` parameter type
-  --> $DIR/explicit-self-lifetime-mismatch.rs:8:12
+  --> $DIR/explicit-self-lifetime-mismatch.rs:10:12
    |
 LL |            Foo<'b,'a>
    |            ^^^^^^^^^^ lifetime mismatch
@@ -7,18 +7,18 @@
    = note: expected struct `Foo<'a, 'b>`
               found struct `Foo<'b, 'a>`
 note: the lifetime `'b` as defined here...
-  --> $DIR/explicit-self-lifetime-mismatch.rs:6:9
+  --> $DIR/explicit-self-lifetime-mismatch.rs:8:9
    |
 LL | impl<'a,'b> Foo<'a,'b> {
    |         ^^
 note: ...does not necessarily outlive the lifetime `'a` as defined here
-  --> $DIR/explicit-self-lifetime-mismatch.rs:6:6
+  --> $DIR/explicit-self-lifetime-mismatch.rs:8:6
    |
 LL | impl<'a,'b> Foo<'a,'b> {
    |      ^^
 
 error[E0308]: mismatched `self` parameter type
-  --> $DIR/explicit-self-lifetime-mismatch.rs:8:12
+  --> $DIR/explicit-self-lifetime-mismatch.rs:10:12
    |
 LL |            Foo<'b,'a>
    |            ^^^^^^^^^^ lifetime mismatch
@@ -26,12 +26,12 @@
    = note: expected struct `Foo<'a, 'b>`
               found struct `Foo<'b, 'a>`
 note: the lifetime `'a` as defined here...
-  --> $DIR/explicit-self-lifetime-mismatch.rs:6:6
+  --> $DIR/explicit-self-lifetime-mismatch.rs:8:6
    |
 LL | impl<'a,'b> Foo<'a,'b> {
    |      ^^
 note: ...does not necessarily outlive the lifetime `'b` as defined here
-  --> $DIR/explicit-self-lifetime-mismatch.rs:6:9
+  --> $DIR/explicit-self-lifetime-mismatch.rs:8:9
    |
 LL | impl<'a,'b> Foo<'a,'b> {
    |         ^^
diff --git a/tests/ui/expr/if/if-branch-types.rs b/tests/ui/expr/if/if-branch-types.rs
index c125ba306..d6da3ee 100644
--- a/tests/ui/expr/if/if-branch-types.rs
+++ b/tests/ui/expr/if/if-branch-types.rs
@@ -1,5 +1,6 @@
 fn main() {
     let x = if true { 10i32 } else { 10u32 };
     //~^ ERROR `if` and `else` have incompatible types
-    //~| expected `i32`, found `u32`
+    //~| NOTE expected `i32`, found `u32`
+    //~| NOTE expected because of this
 }
diff --git a/tests/ui/expr/if/if-without-else-result.rs b/tests/ui/expr/if/if-without-else-result.rs
index 9560475..29aa3d3 100644
--- a/tests/ui/expr/if/if-without-else-result.rs
+++ b/tests/ui/expr/if/if-without-else-result.rs
@@ -1,6 +1,8 @@
+//@ dont-require-annotations: NOTE
+
 fn main() {
     let a = if true { true };
     //~^ ERROR `if` may be missing an `else` clause [E0317]
-    //~| expected `bool`, found `()`
+    //~| NOTE expected `bool`, found `()`
     println!("{}", a);
 }
diff --git a/tests/ui/expr/if/if-without-else-result.stderr b/tests/ui/expr/if/if-without-else-result.stderr
index 4eaa039..d0a0981 100644
--- a/tests/ui/expr/if/if-without-else-result.stderr
+++ b/tests/ui/expr/if/if-without-else-result.stderr
@@ -1,5 +1,5 @@
 error[E0317]: `if` may be missing an `else` clause
-  --> $DIR/if-without-else-result.rs:2:13
+  --> $DIR/if-without-else-result.rs:4:13
    |
 LL |     let a = if true { true };
    |             ^^^^^^^^^^----^^
diff --git a/tests/ui/expr/if/issue-4201.rs b/tests/ui/expr/if/issue-4201.rs
index 59c465b9..b456673 100644
--- a/tests/ui/expr/if/issue-4201.rs
+++ b/tests/ui/expr/if/issue-4201.rs
@@ -1,9 +1,11 @@
+//@ dont-require-annotations: NOTE
+
 fn main() {
     let a = if true {
         0
     } else if false {
 //~^ ERROR `if` may be missing an `else` clause
-//~| expected integer, found `()`
+//~| NOTE expected integer, found `()`
         1
     };
 }
diff --git a/tests/ui/expr/if/issue-4201.stderr b/tests/ui/expr/if/issue-4201.stderr
index c761d0b..4f5462c 100644
--- a/tests/ui/expr/if/issue-4201.stderr
+++ b/tests/ui/expr/if/issue-4201.stderr
@@ -1,5 +1,5 @@
 error[E0317]: `if` may be missing an `else` clause
-  --> $DIR/issue-4201.rs:4:12
+  --> $DIR/issue-4201.rs:6:12
    |
 LL |       } else if false {
    |  ____________^
diff --git a/tests/ui/feature-gates/feature-gate-cfg-target-thread-local.rs b/tests/ui/feature-gates/feature-gate-cfg-target-thread-local.rs
index 131a10ea..a9d4f6f 100644
--- a/tests/ui/feature-gates/feature-gate-cfg-target-thread-local.rs
+++ b/tests/ui/feature-gates/feature-gate-cfg-target-thread-local.rs
@@ -7,7 +7,7 @@
 
 extern "C" {
     #[cfg_attr(target_thread_local, thread_local)]
-    //~^ `cfg(target_thread_local)` is experimental and subject to change
+    //~^ ERROR `cfg(target_thread_local)` is experimental and subject to change
     static FOO: u32;
 }
 
diff --git a/tests/ui/fn/fn-item-type.rs b/tests/ui/fn/fn-item-type.rs
index c094a34..c4c090b 100644
--- a/tests/ui/fn/fn-item-type.rs
+++ b/tests/ui/fn/fn-item-type.rs
@@ -1,6 +1,8 @@
 // Test that the types of distinct fn items are not compatible by
 // default. See also `run-pass/fn-item-type-*.rs`.
 
+//@ dont-require-annotations: NOTE
+
 fn foo<T>(x: isize) -> isize {
     x * 2
 }
@@ -21,31 +23,31 @@ impl<T> Foo for T {
 fn main() {
     eq(foo::<u8>, bar::<u8>);
     //~^ ERROR mismatched types
-    //~| expected fn item `fn(_) -> _ {foo::<u8>}`
-    //~| found fn item `fn(_) -> _ {bar::<u8>}`
-    //~| expected fn item, found a different fn item
-    //~| different fn items have unique types, even if their signatures are the same
+    //~| NOTE expected fn item `fn(_) -> _ {foo::<u8>}`
+    //~| NOTE found fn item `fn(_) -> _ {bar::<u8>}`
+    //~| NOTE expected fn item, found a different fn item
+    //~| NOTE different fn items have unique types, even if their signatures are the same
 
     eq(foo::<u8>, foo::<i8>);
     //~^ ERROR mismatched types
-    //~| expected `u8`, found `i8`
-    //~| different fn items have unique types, even if their signatures are the same
+    //~| NOTE expected `u8`, found `i8`
+    //~| NOTE different fn items have unique types, even if their signatures are the same
 
     eq(bar::<String>, bar::<Vec<u8>>);
     //~^ ERROR mismatched types
-    //~| found fn item `fn(_) -> _ {bar::<Vec<u8>>}`
-    //~| expected `String`, found `Vec<u8>`
+    //~| NOTE found fn item `fn(_) -> _ {bar::<Vec<u8>>}`
+    //~| NOTE expected `String`, found `Vec<u8>`
 
     // Make sure we distinguish between trait methods correctly.
     eq(<u8 as Foo>::foo, <u16 as Foo>::foo);
     //~^ ERROR mismatched types
-    //~| expected `u8`, found `u16`
-    //~| different fn items have unique types, even if their signatures are the same
+    //~| NOTE expected `u8`, found `u16`
+    //~| NOTE different fn items have unique types, even if their signatures are the same
 
     eq(foo::<u8>, bar::<u8> as fn(isize) -> isize);
     //~^ ERROR mismatched types
-    //~| found fn pointer `fn(_) -> _`
-    //~| expected fn item, found fn pointer
+    //~| NOTE found fn pointer `fn(_) -> _`
+    //~| NOTE expected fn item, found fn pointer
 
     eq(foo::<u8> as fn(isize) -> isize, bar::<u8>); // ok!
 }
diff --git a/tests/ui/fn/fn-item-type.stderr b/tests/ui/fn/fn-item-type.stderr
index 5cc5295..ea202f9 100644
--- a/tests/ui/fn/fn-item-type.stderr
+++ b/tests/ui/fn/fn-item-type.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/fn-item-type.rs:22:19
+  --> $DIR/fn-item-type.rs:24:19
    |
 LL |     eq(foo::<u8>, bar::<u8>);
    |     -- ---------  ^^^^^^^^^ expected fn item, found a different fn item
@@ -11,7 +11,7 @@
               found fn item `fn(_) -> _ {bar::<u8>}`
    = note: different fn items have unique types, even if their signatures are the same
 note: function defined here
-  --> $DIR/fn-item-type.rs:11:4
+  --> $DIR/fn-item-type.rs:13:4
    |
 LL | fn eq<T>(x: T, y: T) {}
    |    ^^ -  ----  ---- this parameter needs to match the fn item type of `x`
@@ -21,7 +21,7 @@
    = help: consider casting both fn items to fn pointers using `as fn(isize) -> isize`
 
 error[E0308]: mismatched types
-  --> $DIR/fn-item-type.rs:29:19
+  --> $DIR/fn-item-type.rs:31:19
    |
 LL |     eq(foo::<u8>, foo::<i8>);
    |     -- ---------  ^^^^^^^^^ expected `u8`, found `i8`
@@ -33,7 +33,7 @@
               found fn item `fn(_) -> _ {foo::<i8>}`
    = note: different fn items have unique types, even if their signatures are the same
 note: function defined here
-  --> $DIR/fn-item-type.rs:11:4
+  --> $DIR/fn-item-type.rs:13:4
    |
 LL | fn eq<T>(x: T, y: T) {}
    |    ^^ -  ----  ---- this parameter needs to match the fn item type of `x`
@@ -43,7 +43,7 @@
    = help: consider casting both fn items to fn pointers using `as fn(isize) -> isize`
 
 error[E0308]: mismatched types
-  --> $DIR/fn-item-type.rs:34:23
+  --> $DIR/fn-item-type.rs:36:23
    |
 LL |     eq(bar::<String>, bar::<Vec<u8>>);
    |     -- -------------  ^^^^^^^^^^^^^^ expected `String`, found `Vec<u8>`
@@ -55,7 +55,7 @@
               found fn item `fn(_) -> _ {bar::<Vec<u8>>}`
    = note: different fn items have unique types, even if their signatures are the same
 note: function defined here
-  --> $DIR/fn-item-type.rs:11:4
+  --> $DIR/fn-item-type.rs:13:4
    |
 LL | fn eq<T>(x: T, y: T) {}
    |    ^^ -  ----  ---- this parameter needs to match the fn item type of `x`
@@ -65,7 +65,7 @@
    = help: consider casting both fn items to fn pointers using `as fn(isize) -> isize`
 
 error[E0308]: mismatched types
-  --> $DIR/fn-item-type.rs:40:26
+  --> $DIR/fn-item-type.rs:42:26
    |
 LL |     eq(<u8 as Foo>::foo, <u16 as Foo>::foo);
    |     -- ----------------  ^^^^^^^^^^^^^^^^^ expected `u8`, found `u16`
@@ -77,7 +77,7 @@
               found fn item `fn() {<u16 as Foo>::foo}`
    = note: different fn items have unique types, even if their signatures are the same
 note: function defined here
-  --> $DIR/fn-item-type.rs:11:4
+  --> $DIR/fn-item-type.rs:13:4
    |
 LL | fn eq<T>(x: T, y: T) {}
    |    ^^ -  ----  ---- this parameter needs to match the fn item type of `x`
@@ -87,7 +87,7 @@
    = help: consider casting both fn items to fn pointers using `as fn()`
 
 error[E0308]: mismatched types
-  --> $DIR/fn-item-type.rs:45:19
+  --> $DIR/fn-item-type.rs:47:19
    |
 LL |     eq(foo::<u8>, bar::<u8> as fn(isize) -> isize);
    |     -- ---------  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found fn pointer
@@ -99,7 +99,7 @@
            found fn pointer `fn(_) -> _`
    = help: consider casting the fn item to a fn pointer: `foo::<u8> as fn(isize) -> isize`
 note: function defined here
-  --> $DIR/fn-item-type.rs:11:4
+  --> $DIR/fn-item-type.rs:13:4
    |
 LL | fn eq<T>(x: T, y: T) {}
    |    ^^ -  ----  ---- this parameter needs to match the fn item type of `x`
diff --git a/tests/ui/fn/fn-pointer-mismatch.rs b/tests/ui/fn/fn-pointer-mismatch.rs
index 1c50d8b..3854c8e 100644
--- a/tests/ui/fn/fn-pointer-mismatch.rs
+++ b/tests/ui/fn/fn-pointer-mismatch.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 fn foo(x: u32) -> u32 {
     x * 2
 }
@@ -10,7 +12,7 @@ fn bar(x: u32) -> u32 {
 fn foobar(n: u32) -> u32 {
     let g = if n % 2 == 0 { &foo } else { &bar };
     //~^ ERROR `if` and `else` have incompatible types
-    //~| different fn items have unique types, even if their signatures are the same
+    //~| NOTE different fn items have unique types, even if their signatures are the same
     g(n)
 }
 
@@ -22,33 +24,33 @@ fn main() {
     let mut a = foo;
     a = bar;
     //~^ ERROR mismatched types
-    //~| expected fn item `fn(_) -> _ {foo}`
-    //~| found fn item `fn(_) -> _ {bar}`
-    //~| different fn items have unique types, even if their signatures are the same
+    //~| NOTE expected fn item `fn(_) -> _ {foo}`
+    //~| NOTE found fn item `fn(_) -> _ {bar}`
+    //~| NOTE different fn items have unique types, even if their signatures are the same
 
     // display note even when boxed
     let mut b = Box::new(foo);
     b = Box::new(bar);
     //~^ ERROR mismatched types
-    //~| different fn items have unique types, even if their signatures are the same
+    //~| NOTE different fn items have unique types, even if their signatures are the same
 
     // suggest removing reference
     let c: fn(u32) -> u32 = &foo;
     //~^ ERROR mismatched types
-    //~| expected fn pointer `fn(_) -> _`
-    //~| found reference `&fn(_) -> _ {foo}`
+    //~| NOTE expected fn pointer `fn(_) -> _`
+    //~| NOTE found reference `&fn(_) -> _ {foo}`
 
     // suggest using reference
     let d: &fn(u32) -> u32 = foo;
     //~^ ERROR mismatched types
-    //~| expected reference `&fn(_) -> _`
-    //~| found fn item `fn(_) -> _ {foo}`
+    //~| NOTE expected reference `&fn(_) -> _`
+    //~| NOTE found fn item `fn(_) -> _ {foo}`
 
     // suggest casting with reference
     let e: &fn(u32) -> u32 = &foo;
     //~^ ERROR mismatched types
-    //~| expected reference `&fn(_) -> _`
-    //~| found reference `&fn(_) -> _ {foo}`
+    //~| NOTE expected reference `&fn(_) -> _`
+    //~| NOTE found reference `&fn(_) -> _ {foo}`
 
     // OK
     let mut z: fn(u32) -> u32 = foo as fn(u32) -> u32;
diff --git a/tests/ui/fn/fn-pointer-mismatch.stderr b/tests/ui/fn/fn-pointer-mismatch.stderr
index 051eb94..87a2e39 100644
--- a/tests/ui/fn/fn-pointer-mismatch.stderr
+++ b/tests/ui/fn/fn-pointer-mismatch.stderr
@@ -1,5 +1,5 @@
 error[E0308]: `if` and `else` have incompatible types
-  --> $DIR/fn-pointer-mismatch.rs:11:43
+  --> $DIR/fn-pointer-mismatch.rs:13:43
    |
 LL |     let g = if n % 2 == 0 { &foo } else { &bar };
    |                             ----          ^^^^ expected `&fn(u32) -> u32 {foo}`, found `&fn(u32) -> u32 {bar}`
@@ -12,7 +12,7 @@
    = help: consider casting both fn items to fn pointers using `as fn(u32) -> u32`
 
 error[E0308]: mismatched types
-  --> $DIR/fn-pointer-mismatch.rs:23:9
+  --> $DIR/fn-pointer-mismatch.rs:25:9
    |
 LL |     let mut a = foo;
    |                 --- expected due to this value
@@ -25,7 +25,7 @@
    = help: consider casting both fn items to fn pointers using `as fn(u32) -> u32`
 
 error[E0308]: mismatched types
-  --> $DIR/fn-pointer-mismatch.rs:31:18
+  --> $DIR/fn-pointer-mismatch.rs:33:18
    |
 LL |     b = Box::new(bar);
    |         -------- ^^^ expected fn item, found a different fn item
@@ -40,7 +40,7 @@
    = help: consider casting both fn items to fn pointers using `as fn(u32) -> u32`
 
 error[E0308]: mismatched types
-  --> $DIR/fn-pointer-mismatch.rs:36:29
+  --> $DIR/fn-pointer-mismatch.rs:38:29
    |
 LL |     let c: fn(u32) -> u32 = &foo;
    |            --------------   ^^^^ expected fn pointer, found `&fn(u32) -> u32 {foo}`
@@ -56,7 +56,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/fn-pointer-mismatch.rs:42:30
+  --> $DIR/fn-pointer-mismatch.rs:44:30
    |
 LL |     let d: &fn(u32) -> u32 = foo;
    |            ---------------   ^^^ expected `&fn(u32) -> u32`, found fn item
@@ -71,7 +71,7 @@
    |                              +
 
 error[E0308]: mismatched types
-  --> $DIR/fn-pointer-mismatch.rs:48:30
+  --> $DIR/fn-pointer-mismatch.rs:50:30
    |
 LL |     let e: &fn(u32) -> u32 = &foo;
    |            ---------------   ^^^^ expected `&fn(u32) -> u32`, found `&fn(u32) -> u32 {foo}`
diff --git a/tests/ui/fn/fn-trait-formatting.rs b/tests/ui/fn/fn-trait-formatting.rs
index 61a8791..be74d1c 100644
--- a/tests/ui/fn/fn-trait-formatting.rs
+++ b/tests/ui/fn/fn-trait-formatting.rs
@@ -1,20 +1,20 @@
+//@ dont-require-annotations: NOTE
+
 fn needs_fn<F>(x: F) where F: Fn(isize) -> isize {}
 
-
-
 fn main() {
     let _: () = Box::new(|_: isize| {}) as Box<dyn FnOnce(isize)>;
     //~^ ERROR mismatched types
-    //~| expected unit type `()`
-    //~| found struct `Box<dyn FnOnce(isize)>`
+    //~| NOTE expected unit type `()`
+    //~| NOTE found struct `Box<dyn FnOnce(isize)>`
     let _: () = Box::new(|_: isize, isize| {}) as Box<dyn Fn(isize, isize)>;
     //~^ ERROR mismatched types
-    //~| expected unit type `()`
-    //~| found struct `Box<dyn Fn(isize, isize)>`
+    //~| NOTE expected unit type `()`
+    //~| NOTE found struct `Box<dyn Fn(isize, isize)>`
     let _: () = Box::new(|| -> isize { unimplemented!() }) as Box<dyn FnMut() -> isize>;
     //~^ ERROR mismatched types
-    //~| expected unit type `()`
-    //~| found struct `Box<dyn FnMut() -> isize>`
+    //~| NOTE expected unit type `()`
+    //~| NOTE found struct `Box<dyn FnMut() -> isize>`
 
     needs_fn(1);
     //~^ ERROR expected a `Fn(isize)` closure, found `{integer}`
diff --git a/tests/ui/fn/fn-trait-formatting.stderr b/tests/ui/fn/fn-trait-formatting.stderr
index 9fdef49..bfd8610 100644
--- a/tests/ui/fn/fn-trait-formatting.stderr
+++ b/tests/ui/fn/fn-trait-formatting.stderr
@@ -49,7 +49,7 @@
    |
    = help: the trait `Fn(isize)` is not implemented for `{integer}`
 note: required by a bound in `needs_fn`
-  --> $DIR/fn-trait-formatting.rs:1:31
+  --> $DIR/fn-trait-formatting.rs:3:31
    |
 LL | fn needs_fn<F>(x: F) where F: Fn(isize) -> isize {}
    |                               ^^^^^^^^^^^^^^^^^^ required by this bound in `needs_fn`
diff --git a/tests/ui/foreign/issue-91370-foreign-fn-block-impl.rs b/tests/ui/foreign/issue-91370-foreign-fn-block-impl.rs
index 23e08e0..5317531 100644
--- a/tests/ui/foreign/issue-91370-foreign-fn-block-impl.rs
+++ b/tests/ui/foreign/issue-91370-foreign-fn-block-impl.rs
@@ -1,10 +1,11 @@
 // Regression test for issue #91370.
 
 extern "C" {
-    //~^ `extern` blocks define existing foreign functions
+    //~^ NOTE `extern` blocks define existing foreign functions
     fn f() {
         //~^ ERROR incorrect function inside `extern` block
-        //~| cannot have a body
+        //~| NOTE cannot have a body
+        //~| NOTE for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
         impl Copy for u8 {}
     }
 }
diff --git a/tests/ui/foreign/issue-91370-foreign-fn-block-impl.stderr b/tests/ui/foreign/issue-91370-foreign-fn-block-impl.stderr
index 155fdf9..ad6aff5 100644
--- a/tests/ui/foreign/issue-91370-foreign-fn-block-impl.stderr
+++ b/tests/ui/foreign/issue-91370-foreign-fn-block-impl.stderr
@@ -8,9 +8,7 @@
    |  ________^___-
    | |        |
    | |        cannot have a body
-LL | |
-LL | |
-LL | |         impl Copy for u8 {}
+...  |
 LL | |     }
    | |_____- help: remove the invalid body: `;`
    |
diff --git a/tests/ui/fully-qualified-type/fully-qualified-type-name2.rs b/tests/ui/fully-qualified-type/fully-qualified-type-name2.rs
index f26d3be..983d694 100644
--- a/tests/ui/fully-qualified-type/fully-qualified-type-name2.rs
+++ b/tests/ui/fully-qualified-type/fully-qualified-type-name2.rs
@@ -1,5 +1,7 @@
 // Test that we use fully-qualified type names in error messages.
 
+//@ dont-require-annotations: NOTE
+
 mod x {
     pub enum Foo { }
 }
@@ -11,7 +13,7 @@ pub enum Foo { }
 fn bar(x: x::Foo) -> y::Foo {
     return x;
     //~^ ERROR mismatched types
-    //~| expected `y::Foo`, found `x::Foo`
+    //~| NOTE expected `y::Foo`, found `x::Foo`
 }
 
 fn main() {
diff --git a/tests/ui/fully-qualified-type/fully-qualified-type-name2.stderr b/tests/ui/fully-qualified-type/fully-qualified-type-name2.stderr
index af71691..90e54df 100644
--- a/tests/ui/fully-qualified-type/fully-qualified-type-name2.stderr
+++ b/tests/ui/fully-qualified-type/fully-qualified-type-name2.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/fully-qualified-type-name2.rs:12:12
+  --> $DIR/fully-qualified-type-name2.rs:14:12
    |
 LL | fn bar(x: x::Foo) -> y::Foo {
    |                      ------ expected `y::Foo` because of return type
@@ -8,12 +8,12 @@
    |
    = note: `x::Foo` and `y::Foo` have similar names, but are actually distinct types
 note: `x::Foo` is defined in module `crate::x` of the current crate
-  --> $DIR/fully-qualified-type-name2.rs:4:5
+  --> $DIR/fully-qualified-type-name2.rs:6:5
    |
 LL |     pub enum Foo { }
    |     ^^^^^^^^^^^^
 note: `y::Foo` is defined in module `crate::y` of the current crate
-  --> $DIR/fully-qualified-type-name2.rs:8:5
+  --> $DIR/fully-qualified-type-name2.rs:10:5
    |
 LL |     pub enum Foo { }
    |     ^^^^^^^^^^^^
diff --git a/tests/ui/fully-qualified-type/fully-qualified-type-name4.rs b/tests/ui/fully-qualified-type/fully-qualified-type-name4.rs
index 41f07ba..4fb4bb3 100644
--- a/tests/ui/fully-qualified-type/fully-qualified-type-name4.rs
+++ b/tests/ui/fully-qualified-type/fully-qualified-type-name4.rs
@@ -2,12 +2,12 @@
 
 use std::option::Option;
 
-fn bar(x: usize) -> Option<usize> {
+fn bar(x: usize) -> Option<usize> { //~ NOTE expected `Option<usize>` because of return type
     return x;
     //~^ ERROR mismatched types
-    //~| expected enum `Option<usize>`
-    //~| found type `usize`
-    //~| expected `Option<usize>`, found `usize`
+    //~| NOTE expected enum `Option<usize>`
+    //~| NOTE found type `usize`
+    //~| NOTE expected `Option<usize>`, found `usize`
 }
 
 fn main() {
diff --git a/tests/ui/generics/generic-type-params-name-repr.rs b/tests/ui/generics/generic-type-params-name-repr.rs
index d60856b..bee8405 100644
--- a/tests/ui/generics/generic-type-params-name-repr.rs
+++ b/tests/ui/generics/generic-type-params-name-repr.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 use std::marker;
 
 struct A;
@@ -12,40 +14,40 @@ fn main() {
     // Ensure that the printed type doesn't include the default type params...
     let _: Foo<isize> = ();
     //~^ ERROR mismatched types
-    //~| expected `Foo<isize>`, found `()`
-    //~| expected struct `Foo<isize>`
-    //~| found unit type `()`
+    //~| NOTE expected `Foo<isize>`, found `()`
+    //~| NOTE expected struct `Foo<isize>`
+    //~| NOTE found unit type `()`
 
     // ...even when they're present, but the same types as the defaults.
     let _: Foo<isize, B, C> = ();
     //~^ ERROR mismatched types
-    //~| expected `Foo<isize>`, found `()`
-    //~| expected struct `Foo<isize>`
-    //~| found unit type `()`
+    //~| NOTE expected `Foo<isize>`, found `()`
+    //~| NOTE expected struct `Foo<isize>`
+    //~| NOTE found unit type `()`
 
     // Including cases where the default is using previous type params.
     let _: HashMap<String, isize> = ();
     //~^ ERROR mismatched types
-    //~| expected `HashMap<String, isize>`, found `()`
-    //~| expected struct `HashMap<String, isize>`
-    //~| found unit type `()`
+    //~| NOTE expected `HashMap<String, isize>`, found `()`
+    //~| NOTE expected struct `HashMap<String, isize>`
+    //~| NOTE found unit type `()`
     let _: HashMap<String, isize, Hash<String>> = ();
     //~^ ERROR mismatched types
-    //~| expected `HashMap<String, isize>`, found `()`
-    //~| expected struct `HashMap<String, isize>`
-    //~| found unit type `()`
+    //~| NOTE expected `HashMap<String, isize>`, found `()`
+    //~| NOTE expected struct `HashMap<String, isize>`
+    //~| NOTE found unit type `()`
 
     // But not when there's a different type in between.
     let _: Foo<A, isize, C> = ();
     //~^ ERROR mismatched types
-    //~| expected `Foo<A, isize>`, found `()`
-    //~| expected struct `Foo<A, isize>`
-    //~| found unit type `()`
+    //~| NOTE expected `Foo<A, isize>`, found `()`
+    //~| NOTE expected struct `Foo<A, isize>`
+    //~| NOTE found unit type `()`
 
     // And don't print <> at all when there's just defaults.
     let _: Foo<A, B, C> = ();
     //~^ ERROR mismatched types
-    //~| expected `Foo`, found `()`
-    //~| expected struct `Foo`
-    //~| found unit type `()`
+    //~| NOTE expected `Foo`, found `()`
+    //~| NOTE expected struct `Foo`
+    //~| NOTE found unit type `()`
 }
diff --git a/tests/ui/generics/generic-type-params-name-repr.stderr b/tests/ui/generics/generic-type-params-name-repr.stderr
index 946f14c..ab03e81 100644
--- a/tests/ui/generics/generic-type-params-name-repr.stderr
+++ b/tests/ui/generics/generic-type-params-name-repr.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/generic-type-params-name-repr.rs:13:25
+  --> $DIR/generic-type-params-name-repr.rs:15:25
    |
 LL |     let _: Foo<isize> = ();
    |            ----------   ^^ expected `Foo<isize>`, found `()`
@@ -10,7 +10,7 @@
            found unit type `()`
 
 error[E0308]: mismatched types
-  --> $DIR/generic-type-params-name-repr.rs:20:31
+  --> $DIR/generic-type-params-name-repr.rs:22:31
    |
 LL |     let _: Foo<isize, B, C> = ();
    |            ----------------   ^^ expected `Foo<isize>`, found `()`
@@ -21,7 +21,7 @@
            found unit type `()`
 
 error[E0308]: mismatched types
-  --> $DIR/generic-type-params-name-repr.rs:27:37
+  --> $DIR/generic-type-params-name-repr.rs:29:37
    |
 LL |     let _: HashMap<String, isize> = ();
    |            ----------------------   ^^ expected `HashMap<String, isize>`, found `()`
@@ -32,7 +32,7 @@
            found unit type `()`
 
 error[E0308]: mismatched types
-  --> $DIR/generic-type-params-name-repr.rs:32:51
+  --> $DIR/generic-type-params-name-repr.rs:34:51
    |
 LL |     let _: HashMap<String, isize, Hash<String>> = ();
    |            ------------------------------------   ^^ expected `HashMap<String, isize>`, found `()`
@@ -43,7 +43,7 @@
            found unit type `()`
 
 error[E0308]: mismatched types
-  --> $DIR/generic-type-params-name-repr.rs:39:31
+  --> $DIR/generic-type-params-name-repr.rs:41:31
    |
 LL |     let _: Foo<A, isize, C> = ();
    |            ----------------   ^^ expected `Foo<A, isize>`, found `()`
@@ -54,7 +54,7 @@
            found unit type `()`
 
 error[E0308]: mismatched types
-  --> $DIR/generic-type-params-name-repr.rs:46:27
+  --> $DIR/generic-type-params-name-repr.rs:48:27
    |
 LL |     let _: Foo<A, B, C> = ();
    |            ------------   ^^ expected `Foo`, found `()`
diff --git a/tests/ui/generics/slightly-nice-generic-literal-messages.rs b/tests/ui/generics/slightly-nice-generic-literal-messages.rs
index 268009f..83c08e9 100644
--- a/tests/ui/generics/slightly-nice-generic-literal-messages.rs
+++ b/tests/ui/generics/slightly-nice-generic-literal-messages.rs
@@ -3,12 +3,12 @@
 struct Foo<T,U>(T, marker::PhantomData<U>);
 
 fn main() {
-    match Foo(1.1, marker::PhantomData) {
+    match Foo(1.1, marker::PhantomData) { //~ NOTE this expression has type `Foo<{float}, _>`
         1 => {}
     //~^ ERROR mismatched types
-    //~| expected struct `Foo<{float}, _>`
-    //~| found type `{integer}`
-    //~| expected `Foo<{float}, _>`, found integer
+    //~| NOTE expected struct `Foo<{float}, _>`
+    //~| NOTE found type `{integer}`
+    //~| NOTE expected `Foo<{float}, _>`, found integer
     }
 
 }
diff --git a/tests/ui/impl-trait/equality.rs b/tests/ui/impl-trait/equality.rs
index 828b5aa..07fc4a5 100644
--- a/tests/ui/impl-trait/equality.rs
+++ b/tests/ui/impl-trait/equality.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 #![feature(specialization)] //~ WARN the feature `specialization` is incomplete
 
 trait Foo: Copy + ToString {}
@@ -14,7 +16,7 @@ fn two(x: bool) -> impl Foo {
     }
     0_u32
     //~^ ERROR mismatched types
-    //~| expected `i32`, found `u32`
+    //~| NOTE expected `i32`, found `u32`
 }
 
 fn sum_to(n: u32) -> impl Foo {
diff --git a/tests/ui/impl-trait/equality.stderr b/tests/ui/impl-trait/equality.stderr
index 8106bab..424d56f 100644
--- a/tests/ui/impl-trait/equality.stderr
+++ b/tests/ui/impl-trait/equality.stderr
@@ -1,5 +1,5 @@
 warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
-  --> $DIR/equality.rs:1:12
+  --> $DIR/equality.rs:3:12
    |
 LL | #![feature(specialization)]
    |            ^^^^^^^^^^^^^^
@@ -9,7 +9,7 @@
    = note: `#[warn(incomplete_features)]` on by default
 
 error[E0308]: mismatched types
-  --> $DIR/equality.rs:15:5
+  --> $DIR/equality.rs:17:5
    |
 LL | fn two(x: bool) -> impl Foo {
    |                    -------- expected `i32` because of return type
@@ -24,7 +24,7 @@
    |
 
 error[E0277]: cannot add `impl Foo` to `u32`
-  --> $DIR/equality.rs:24:11
+  --> $DIR/equality.rs:26:11
    |
 LL |         n + sum_to(n - 1)
    |           ^ no implementation for `u32 + impl Foo`
diff --git a/tests/ui/impl-trait/equality2.rs b/tests/ui/impl-trait/equality2.rs
index 2e32586..808c600 100644
--- a/tests/ui/impl-trait/equality2.rs
+++ b/tests/ui/impl-trait/equality2.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 #![feature(specialization)] //~ WARN the feature `specialization` is incomplete
 
 trait Foo: Copy + ToString {}
@@ -24,21 +26,21 @@ fn leak(self) -> i32 { self }
 fn main() {
     let _: u32 = hide(0_u32);
     //~^ ERROR mismatched types
-    //~| expected type `u32`
-    //~| found opaque type `impl Foo`
-    //~| expected `u32`, found opaque type
+    //~| NOTE expected type `u32`
+    //~| NOTE found opaque type `impl Foo`
+    //~| NOTE expected `u32`, found opaque type
 
     let _: i32 = Leak::leak(hide(0_i32));
     //~^ ERROR mismatched types
-    //~| expected type `i32`
-    //~| found associated type `<impl Foo as Leak>::T`
-    //~| expected `i32`, found associated type
+    //~| NOTE expected type `i32`
+    //~| NOTE found associated type `<impl Foo as Leak>::T`
+    //~| NOTE expected `i32`, found associated type
 
     let mut x = (hide(0_u32), hide(0_i32));
     x = (x.1,
     //~^ ERROR mismatched types
-    //~| expected `u32`, found `i32`
+    //~| NOTE expected `u32`, found `i32`
          x.0);
     //~^ ERROR mismatched types
-    //~| expected `i32`, found `u32`
+    //~| NOTE expected `i32`, found `u32`
 }
diff --git a/tests/ui/impl-trait/equality2.stderr b/tests/ui/impl-trait/equality2.stderr
index 52f25d2..2fa7eb2 100644
--- a/tests/ui/impl-trait/equality2.stderr
+++ b/tests/ui/impl-trait/equality2.stderr
@@ -1,5 +1,5 @@
 warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
-  --> $DIR/equality2.rs:1:12
+  --> $DIR/equality2.rs:3:12
    |
 LL | #![feature(specialization)]
    |            ^^^^^^^^^^^^^^
@@ -9,7 +9,7 @@
    = note: `#[warn(incomplete_features)]` on by default
 
 error[E0308]: mismatched types
-  --> $DIR/equality2.rs:25:18
+  --> $DIR/equality2.rs:27:18
    |
 LL | fn hide<T: Foo>(x: T) -> impl Foo {
    |                          -------- the found opaque type
@@ -23,7 +23,7 @@
            found opaque type `impl Foo`
 
 error[E0308]: mismatched types
-  --> $DIR/equality2.rs:31:18
+  --> $DIR/equality2.rs:33:18
    |
 LL | fn hide<T: Foo>(x: T) -> impl Foo {
    |                          -------- the found opaque type
@@ -41,7 +41,7 @@
    |                                  +++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/equality2.rs:38:10
+  --> $DIR/equality2.rs:40:10
    |
 LL | fn hide<T: Foo>(x: T) -> impl Foo {
    |                          --------
@@ -57,7 +57,7 @@
    = note: distinct uses of `impl Trait` result in different opaque types
 
 error[E0308]: mismatched types
-  --> $DIR/equality2.rs:41:10
+  --> $DIR/equality2.rs:43:10
    |
 LL | fn hide<T: Foo>(x: T) -> impl Foo {
    |                          --------
diff --git a/tests/ui/impl-trait/no-method-suggested-traits.rs b/tests/ui/impl-trait/no-method-suggested-traits.rs
index 6fc96f2..5a93613 100644
--- a/tests/ui/impl-trait/no-method-suggested-traits.rs
+++ b/tests/ui/impl-trait/no-method-suggested-traits.rs
@@ -1,4 +1,6 @@
 //@ aux-build:no_method_suggested_traits.rs
+//@ dont-require-annotations: HELP
+
 extern crate no_method_suggested_traits;
 
 struct Foo;
@@ -22,9 +24,9 @@ fn main() {
 
     1u32.method();
     //~^ ERROR no method named
-    //~|items from traits can only be used if the trait is in scope
+    //~| HELP items from traits can only be used if the trait is in scope
     std::rc::Rc::new(&mut Box::new(&1u32)).method();
-    //~^items from traits can only be used if the trait is in scope
+    //~^ HELP items from traits can only be used if the trait is in scope
     //~| ERROR no method named `method` found for struct
 
     'a'.method();
diff --git a/tests/ui/impl-trait/no-method-suggested-traits.stderr b/tests/ui/impl-trait/no-method-suggested-traits.stderr
index 0a97466..6420251 100644
--- a/tests/ui/impl-trait/no-method-suggested-traits.stderr
+++ b/tests/ui/impl-trait/no-method-suggested-traits.stderr
@@ -1,5 +1,5 @@
 error[E0599]: no method named `method` found for type `u32` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:23:10
+  --> $DIR/no-method-suggested-traits.rs:25:10
    |
 LL |     1u32.method();
    |          ^^^^^^
@@ -21,7 +21,7 @@
    |                +
 
 error[E0599]: no method named `method` found for struct `Rc<&mut Box<&u32>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:26:44
+  --> $DIR/no-method-suggested-traits.rs:28:44
    |
 LL |     std::rc::Rc::new(&mut Box::new(&1u32)).method();
    |                                            ^^^^^^
@@ -43,7 +43,7 @@
    |                                                  +
 
 error[E0599]: no method named `method` found for type `char` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:30:9
+  --> $DIR/no-method-suggested-traits.rs:32:9
    |
 LL |         fn method(&self) {}
    |            ------ the method is available for `char` here
@@ -62,7 +62,7 @@
    |               +
 
 error[E0599]: no method named `method` found for struct `Rc<&mut Box<&char>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:32:43
+  --> $DIR/no-method-suggested-traits.rs:34:43
    |
 LL |     std::rc::Rc::new(&mut Box::new(&'a')).method();
    |                                           ^^^^^^
@@ -78,7 +78,7 @@
    |                                                 +
 
 error[E0599]: no method named `method` found for type `i32` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:35:10
+  --> $DIR/no-method-suggested-traits.rs:37:10
    |
 LL |     1i32.method();
    |          ^^^^^^
@@ -99,7 +99,7 @@
    |                +
 
 error[E0599]: no method named `method` found for struct `Rc<&mut Box<&i32>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:37:44
+  --> $DIR/no-method-suggested-traits.rs:39:44
    |
 LL |     std::rc::Rc::new(&mut Box::new(&1i32)).method();
    |                                            ^^^^^^
@@ -115,7 +115,7 @@
    |                                                  +
 
 error[E0599]: no method named `method` found for struct `Foo` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:40:9
+  --> $DIR/no-method-suggested-traits.rs:42:9
    |
 LL | struct Foo;
    | ---------- method `method` not found for this struct
@@ -131,7 +131,7 @@
            candidate #4: `no_method_suggested_traits::qux::PrivPub`
 
 error[E0599]: no method named `method` found for struct `Rc<&mut Box<&Foo>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:42:43
+  --> $DIR/no-method-suggested-traits.rs:44:43
    |
 LL |     std::rc::Rc::new(&mut Box::new(&Foo)).method();
    |                                           ^^^^^^ method not found in `Rc<&mut Box<&Foo>>`
@@ -144,85 +144,85 @@
            candidate #4: `no_method_suggested_traits::qux::PrivPub`
 
 error[E0599]: no method named `method2` found for type `u64` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:45:10
+  --> $DIR/no-method-suggested-traits.rs:47:10
    |
 LL |     1u64.method2();
    |          ^^^^^^^ method not found in `u64`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
 note: `foo::Bar` defines an item `method2`, perhaps you need to implement it
-  --> $DIR/no-method-suggested-traits.rs:8:5
+  --> $DIR/no-method-suggested-traits.rs:10:5
    |
 LL |     pub trait Bar {
    |     ^^^^^^^^^^^^^
 
 error[E0599]: no method named `method2` found for struct `Rc<&mut Box<&u64>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:47:44
+  --> $DIR/no-method-suggested-traits.rs:49:44
    |
 LL |     std::rc::Rc::new(&mut Box::new(&1u64)).method2();
    |                                            ^^^^^^^ method not found in `Rc<&mut Box<&u64>>`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
 note: `foo::Bar` defines an item `method2`, perhaps you need to implement it
-  --> $DIR/no-method-suggested-traits.rs:8:5
+  --> $DIR/no-method-suggested-traits.rs:10:5
    |
 LL |     pub trait Bar {
    |     ^^^^^^^^^^^^^
 
 error[E0599]: no method named `method2` found for struct `no_method_suggested_traits::Foo` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:50:37
+  --> $DIR/no-method-suggested-traits.rs:52:37
    |
 LL |     no_method_suggested_traits::Foo.method2();
    |                                     ^^^^^^^ method not found in `Foo`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
 note: `foo::Bar` defines an item `method2`, perhaps you need to implement it
-  --> $DIR/no-method-suggested-traits.rs:8:5
+  --> $DIR/no-method-suggested-traits.rs:10:5
    |
 LL |     pub trait Bar {
    |     ^^^^^^^^^^^^^
 
 error[E0599]: no method named `method2` found for struct `Rc<&mut Box<&no_method_suggested_traits::Foo>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:52:71
+  --> $DIR/no-method-suggested-traits.rs:54:71
    |
 LL |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method2();
    |                                                                       ^^^^^^^ method not found in `Rc<&mut Box<&Foo>>`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
 note: `foo::Bar` defines an item `method2`, perhaps you need to implement it
-  --> $DIR/no-method-suggested-traits.rs:8:5
+  --> $DIR/no-method-suggested-traits.rs:10:5
    |
 LL |     pub trait Bar {
    |     ^^^^^^^^^^^^^
 
 error[E0599]: no method named `method2` found for enum `no_method_suggested_traits::Bar` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:54:40
+  --> $DIR/no-method-suggested-traits.rs:56:40
    |
 LL |     no_method_suggested_traits::Bar::X.method2();
    |                                        ^^^^^^^ method not found in `Bar`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
 note: `foo::Bar` defines an item `method2`, perhaps you need to implement it
-  --> $DIR/no-method-suggested-traits.rs:8:5
+  --> $DIR/no-method-suggested-traits.rs:10:5
    |
 LL |     pub trait Bar {
    |     ^^^^^^^^^^^^^
 
 error[E0599]: no method named `method2` found for struct `Rc<&mut Box<&no_method_suggested_traits::Bar>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:56:74
+  --> $DIR/no-method-suggested-traits.rs:58:74
    |
 LL |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method2();
    |                                                                          ^^^^^^^ method not found in `Rc<&mut Box<&Bar>>`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
 note: `foo::Bar` defines an item `method2`, perhaps you need to implement it
-  --> $DIR/no-method-suggested-traits.rs:8:5
+  --> $DIR/no-method-suggested-traits.rs:10:5
    |
 LL |     pub trait Bar {
    |     ^^^^^^^^^^^^^
 
 error[E0599]: no method named `method3` found for struct `Foo` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:59:9
+  --> $DIR/no-method-suggested-traits.rs:61:9
    |
 LL | struct Foo;
    | ---------- method `method3` not found for this struct
@@ -235,7 +235,7 @@
            candidate #1: `PubPub`
 
 error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&Foo>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:61:43
+  --> $DIR/no-method-suggested-traits.rs:63:43
    |
 LL |     std::rc::Rc::new(&mut Box::new(&Foo)).method3();
    |                                           ^^^^^^^ method not found in `Rc<&mut Box<&Foo>>`
@@ -245,7 +245,7 @@
            candidate #1: `PubPub`
 
 error[E0599]: no method named `method3` found for enum `Bar` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:63:12
+  --> $DIR/no-method-suggested-traits.rs:65:12
    |
 LL | enum Bar { X }
    | -------- method `method3` not found for this enum
@@ -258,7 +258,7 @@
            candidate #1: `PubPub`
 
 error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&Bar>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:65:46
+  --> $DIR/no-method-suggested-traits.rs:67:46
    |
 LL |     std::rc::Rc::new(&mut Box::new(&Bar::X)).method3();
    |                                              ^^^^^^^ method not found in `Rc<&mut Box<&Bar>>`
@@ -268,37 +268,37 @@
            candidate #1: `PubPub`
 
 error[E0599]: no method named `method3` found for type `usize` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:69:13
+  --> $DIR/no-method-suggested-traits.rs:71:13
    |
 LL |     1_usize.method3();
    |             ^^^^^^^ method not found in `usize`
 
 error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&usize>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:70:47
+  --> $DIR/no-method-suggested-traits.rs:72:47
    |
 LL |     std::rc::Rc::new(&mut Box::new(&1_usize)).method3();
    |                                               ^^^^^^^ method not found in `Rc<&mut Box<&usize>>`
 
 error[E0599]: no method named `method3` found for struct `no_method_suggested_traits::Foo` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:71:37
+  --> $DIR/no-method-suggested-traits.rs:73:37
    |
 LL |     no_method_suggested_traits::Foo.method3();
    |                                     ^^^^^^^ method not found in `Foo`
 
 error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&no_method_suggested_traits::Foo>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:72:71
+  --> $DIR/no-method-suggested-traits.rs:74:71
    |
 LL |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method3();
    |                                                                       ^^^^^^^ method not found in `Rc<&mut Box<&Foo>>`
 
 error[E0599]: no method named `method3` found for enum `no_method_suggested_traits::Bar` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:74:40
+  --> $DIR/no-method-suggested-traits.rs:76:40
    |
 LL |     no_method_suggested_traits::Bar::X.method3();
    |                                        ^^^^^^^ method not found in `Bar`
 
 error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&no_method_suggested_traits::Bar>>` in the current scope
-  --> $DIR/no-method-suggested-traits.rs:75:74
+  --> $DIR/no-method-suggested-traits.rs:77:74
    |
 LL |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method3();
    |                                                                          ^^^^^^^ method not found in `Rc<&mut Box<&Bar>>`
diff --git a/tests/ui/implied-bounds/sod_service_chain.rs b/tests/ui/implied-bounds/sod_service_chain.rs
index 73dce2f..df1d430 100644
--- a/tests/ui/implied-bounds/sod_service_chain.rs
+++ b/tests/ui/implied-bounds/sod_service_chain.rs
@@ -1,5 +1,7 @@
 // Found in a crater run on #118553
 
+//@ dont-require-annotations: NOTE
+
 pub trait Debug {}
 
 pub trait Service {
@@ -30,16 +32,16 @@ pub fn next<NS: Service<Input = S::Output>>(
         //~^ ERROR the associated type
         //~| ERROR the associated type
         //~| ERROR the associated type
-        //~| the associated type
-        //~| the associated type
-        //~| the associated type
+        //~| NOTE the associated type
+        //~| NOTE the associated type
+        //~| NOTE the associated type
         //~| ERROR may not live long enough
         self,
     ) -> ServiceChainBuilder<ServiceChain<P, S>, NS> {
         //~^ ERROR the associated type
         //~| ERROR the associated type
-        //~| the associated type
-        //~| the associated type
+        //~| NOTE the associated type
+        //~| NOTE the associated type
         panic!();
     }
 }
diff --git a/tests/ui/implied-bounds/sod_service_chain.stderr b/tests/ui/implied-bounds/sod_service_chain.stderr
index f5221fc..a3cc131 100644
--- a/tests/ui/implied-bounds/sod_service_chain.stderr
+++ b/tests/ui/implied-bounds/sod_service_chain.stderr
@@ -1,5 +1,5 @@
 error[E0310]: the associated type `<P as Service>::Error` may not live long enough
-  --> $DIR/sod_service_chain.rs:29:5
+  --> $DIR/sod_service_chain.rs:31:5
    |
 LL | /     pub fn next<NS: Service<Input = S::Output>>(
 ...  |
@@ -16,7 +16,7 @@
    |                                                      ++++++++++++++++++++++++++++++++++++
 
 error[E0310]: the associated type `<S as Service>::Error` may not live long enough
-  --> $DIR/sod_service_chain.rs:29:5
+  --> $DIR/sod_service_chain.rs:31:5
    |
 LL | /     pub fn next<NS: Service<Input = S::Output>>(
 ...  |
@@ -33,7 +33,7 @@
    |                                                      ++++++++++++++++++++++++++++++++++++
 
 error[E0310]: the associated type `<P as Service>::Error` may not live long enough
-  --> $DIR/sod_service_chain.rs:38:10
+  --> $DIR/sod_service_chain.rs:40:10
    |
 LL |     ) -> ServiceChainBuilder<ServiceChain<P, S>, NS> {
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -47,7 +47,7 @@
    |                                                      ++++++++++++++++++++++++++++++++++++
 
 error[E0310]: the associated type `<S as Service>::Error` may not live long enough
-  --> $DIR/sod_service_chain.rs:38:10
+  --> $DIR/sod_service_chain.rs:40:10
    |
 LL |     ) -> ServiceChainBuilder<ServiceChain<P, S>, NS> {
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -61,7 +61,7 @@
    |                                                      ++++++++++++++++++++++++++++++++++++
 
 error[E0310]: the associated type `<P as Service>::Error` may not live long enough
-  --> $DIR/sod_service_chain.rs:29:5
+  --> $DIR/sod_service_chain.rs:31:5
    |
 LL | /     pub fn next<NS: Service<Input = S::Output>>(
 ...  |
@@ -79,7 +79,7 @@
    |                                                      ++++++++++++++++++++++++++++++++++++
 
 error[E0310]: the associated type `<S as Service>::Error` may not live long enough
-  --> $DIR/sod_service_chain.rs:29:5
+  --> $DIR/sod_service_chain.rs:31:5
    |
 LL | /     pub fn next<NS: Service<Input = S::Output>>(
 ...  |
diff --git a/tests/ui/imports/import.rs b/tests/ui/imports/import.rs
index 3170dd2..39a087c 100644
--- a/tests/ui/imports/import.rs
+++ b/tests/ui/imports/import.rs
@@ -1,6 +1,8 @@
+//@ dont-require-annotations: NOTE
+
 use zed::bar;
 use zed::baz; //~ ERROR unresolved import `zed::baz` [E0432]
-              //~| no `baz` in `zed`
+              //~| NOTE no `baz` in `zed`
               //~| HELP a similar name exists in the module
               //~| SUGGESTION bar
 
@@ -8,7 +10,7 @@
 mod zed {
     pub fn bar() { println!("bar"); }
     use foo; //~ ERROR unresolved import `foo` [E0432]
-             //~^ no `foo` in the root
+             //~^ NOTE no `foo` in the root
 }
 
 fn main() {
diff --git a/tests/ui/imports/import.stderr b/tests/ui/imports/import.stderr
index 797712e..4dae164 100644
--- a/tests/ui/imports/import.stderr
+++ b/tests/ui/imports/import.stderr
@@ -1,5 +1,5 @@
 error[E0432]: unresolved import `zed::baz`
-  --> $DIR/import.rs:2:5
+  --> $DIR/import.rs:4:5
    |
 LL | use zed::baz;
    |     ^^^^^---
@@ -8,19 +8,19 @@
    |     no `baz` in `zed`
 
 error[E0432]: unresolved import `foo`
-  --> $DIR/import.rs:10:9
+  --> $DIR/import.rs:12:9
    |
 LL |     use foo;
    |         ^^^ no `foo` in the root
 
 error[E0603]: unresolved item import `foo` is private
-  --> $DIR/import.rs:15:10
+  --> $DIR/import.rs:17:10
    |
 LL |     zed::foo();
    |          ^^^ private unresolved item import
    |
 note: the unresolved item import `foo` is defined here
-  --> $DIR/import.rs:10:9
+  --> $DIR/import.rs:12:9
    |
 LL |     use foo;
    |         ^^^
diff --git a/tests/ui/imports/issue-19498.rs b/tests/ui/imports/issue-19498.rs
index 5fe6742..5b9ce85 100644
--- a/tests/ui/imports/issue-19498.rs
+++ b/tests/ui/imports/issue-19498.rs
@@ -1,13 +1,15 @@
+//@ dont-require-annotations: NOTE
+
 use self::A;
 use self::B;
 mod A {} //~ ERROR the name `A` is defined multiple times
-//~| `A` redefined here
+//~| NOTE `A` redefined here
 pub mod B {} //~ ERROR the name `B` is defined multiple times
-//~| `B` redefined here
+//~| NOTE `B` redefined here
 mod C {
     use C::D;
     mod D {} //~ ERROR the name `D` is defined multiple times
-    //~| `D` redefined here
+    //~| NOTE `D` redefined here
 }
 
 fn main() {}
diff --git a/tests/ui/imports/issue-19498.stderr b/tests/ui/imports/issue-19498.stderr
index 69bdb67..eb0d68a2 100644
--- a/tests/ui/imports/issue-19498.stderr
+++ b/tests/ui/imports/issue-19498.stderr
@@ -1,5 +1,5 @@
 error[E0255]: the name `A` is defined multiple times
-  --> $DIR/issue-19498.rs:3:1
+  --> $DIR/issue-19498.rs:5:1
    |
 LL | use self::A;
    |     ------- previous import of the module `A` here
@@ -14,7 +14,7 @@
    |             +++++++++
 
 error[E0255]: the name `B` is defined multiple times
-  --> $DIR/issue-19498.rs:5:1
+  --> $DIR/issue-19498.rs:7:1
    |
 LL | use self::B;
    |     ------- previous import of the module `B` here
@@ -29,7 +29,7 @@
    |             +++++++++
 
 error[E0255]: the name `D` is defined multiple times
-  --> $DIR/issue-19498.rs:9:5
+  --> $DIR/issue-19498.rs:11:5
    |
 LL |     use C::D;
    |         ---- previous import of the module `D` here
diff --git a/tests/ui/imports/issue-24081.rs b/tests/ui/imports/issue-24081.rs
index 10983ce..561bbb0 100644
--- a/tests/ui/imports/issue-24081.rs
+++ b/tests/ui/imports/issue-24081.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 use std::ops::Add;
 use std::ops::Sub;
 use std::ops::Mul;
@@ -5,14 +7,14 @@
 use std::ops::Rem;
 
 type Add = bool; //~ ERROR the name `Add` is defined multiple times
-//~| `Add` redefined here
+//~| NOTE `Add` redefined here
 struct Sub { x: f32 } //~ ERROR the name `Sub` is defined multiple times
-//~| `Sub` redefined here
+//~| NOTE `Sub` redefined here
 enum Mul { A, B } //~ ERROR the name `Mul` is defined multiple times
-//~| `Mul` redefined here
+//~| NOTE `Mul` redefined here
 mod Div { } //~ ERROR the name `Div` is defined multiple times
-//~| `Div` redefined here
+//~| NOTE `Div` redefined here
 trait Rem {  } //~ ERROR the name `Rem` is defined multiple times
-//~| `Rem` redefined here
+//~| NOTE `Rem` redefined here
 
 fn main() {}
diff --git a/tests/ui/imports/issue-24081.stderr b/tests/ui/imports/issue-24081.stderr
index 6ceba6c..c2346f5 100644
--- a/tests/ui/imports/issue-24081.stderr
+++ b/tests/ui/imports/issue-24081.stderr
@@ -1,5 +1,5 @@
 error[E0255]: the name `Add` is defined multiple times
-  --> $DIR/issue-24081.rs:7:1
+  --> $DIR/issue-24081.rs:9:1
    |
 LL | use std::ops::Add;
    |     ------------- previous import of the trait `Add` here
@@ -14,7 +14,7 @@
    |                   +++++++++++
 
 error[E0255]: the name `Sub` is defined multiple times
-  --> $DIR/issue-24081.rs:9:1
+  --> $DIR/issue-24081.rs:11:1
    |
 LL | use std::ops::Sub;
    |     ------------- previous import of the trait `Sub` here
@@ -29,7 +29,7 @@
    |                   +++++++++++
 
 error[E0255]: the name `Mul` is defined multiple times
-  --> $DIR/issue-24081.rs:11:1
+  --> $DIR/issue-24081.rs:13:1
    |
 LL | use std::ops::Mul;
    |     ------------- previous import of the trait `Mul` here
@@ -44,7 +44,7 @@
    |                   +++++++++++
 
 error[E0255]: the name `Div` is defined multiple times
-  --> $DIR/issue-24081.rs:13:1
+  --> $DIR/issue-24081.rs:15:1
    |
 LL | use std::ops::Div;
    |     ------------- previous import of the trait `Div` here
@@ -59,7 +59,7 @@
    |                   +++++++++++
 
 error[E0255]: the name `Rem` is defined multiple times
-  --> $DIR/issue-24081.rs:15:1
+  --> $DIR/issue-24081.rs:17:1
    |
 LL | use std::ops::Rem;
    |     ------------- previous import of the trait `Rem` here
diff --git a/tests/ui/imports/issue-26886.rs b/tests/ui/imports/issue-26886.rs
index 6e6d406..91be86ae 100644
--- a/tests/ui/imports/issue-26886.rs
+++ b/tests/ui/imports/issue-26886.rs
@@ -1,8 +1,10 @@
+//@ dont-require-annotations: NOTE
+
 use std::sync::{self, Arc};
 use std::sync::Arc; //~ ERROR the name `Arc` is defined multiple times
-                    //~| `Arc` must be defined only once in the type namespace of this module
+                    //~| NOTE `Arc` must be defined only once in the type namespace of this module
 use std::sync; //~ ERROR the name `sync` is defined multiple times
-               //~| `sync` must be defined only once in the type namespace of this module
+               //~| NOTE `sync` must be defined only once in the type namespace of this module
 
 fn main() {
 }
diff --git a/tests/ui/imports/issue-26886.stderr b/tests/ui/imports/issue-26886.stderr
index e2b925e..a614354 100644
--- a/tests/ui/imports/issue-26886.stderr
+++ b/tests/ui/imports/issue-26886.stderr
@@ -1,5 +1,5 @@
 error[E0252]: the name `Arc` is defined multiple times
-  --> $DIR/issue-26886.rs:2:5
+  --> $DIR/issue-26886.rs:4:5
    |
 LL | use std::sync::{self, Arc};
    |                       --- previous import of the type `Arc` here
@@ -9,7 +9,7 @@
    = note: `Arc` must be defined only once in the type namespace of this module
 
 error[E0252]: the name `sync` is defined multiple times
-  --> $DIR/issue-26886.rs:4:5
+  --> $DIR/issue-26886.rs:6:5
    |
 LL | use std::sync::{self, Arc};
    |                 ---- previous import of the module `sync` here
diff --git a/tests/ui/inference/tutorial-suffix-inference-test.rs b/tests/ui/inference/tutorial-suffix-inference-test.rs
index 849adfd..ca593ff 100644
--- a/tests/ui/inference/tutorial-suffix-inference-test.rs
+++ b/tests/ui/inference/tutorial-suffix-inference-test.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 fn main() {
     let x = 3;
     let y: i32 = 3;
@@ -8,10 +10,10 @@ fn identity_u16(n: u16) -> u16 { n }
     identity_u8(x);  // after this, `x` is assumed to have type `u8`
     identity_u16(x);
     //~^ ERROR mismatched types
-    //~| expected `u16`, found `u8`
+    //~| NOTE expected `u16`, found `u8`
     identity_u16(y);
     //~^ ERROR mismatched types
-    //~| expected `u16`, found `i32`
+    //~| NOTE expected `u16`, found `i32`
 
     let a = 3;
 
@@ -20,5 +22,5 @@ fn identity_i(n: isize) -> isize { n }
     identity_i(a); // ok
     identity_u16(a);
     //~^ ERROR mismatched types
-    //~| expected `u16`, found `isize`
+    //~| NOTE expected `u16`, found `isize`
 }
diff --git a/tests/ui/inference/tutorial-suffix-inference-test.stderr b/tests/ui/inference/tutorial-suffix-inference-test.stderr
index d83a136..39627aa 100644
--- a/tests/ui/inference/tutorial-suffix-inference-test.stderr
+++ b/tests/ui/inference/tutorial-suffix-inference-test.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/tutorial-suffix-inference-test.rs:9:18
+  --> $DIR/tutorial-suffix-inference-test.rs:11:18
    |
 LL |     identity_u16(x);
    |     ------------ ^ expected `u16`, found `u8`
@@ -7,7 +7,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/tutorial-suffix-inference-test.rs:6:8
+  --> $DIR/tutorial-suffix-inference-test.rs:8:8
    |
 LL |     fn identity_u16(n: u16) -> u16 { n }
    |        ^^^^^^^^^^^^ ------
@@ -17,7 +17,7 @@
    |                   +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/tutorial-suffix-inference-test.rs:12:18
+  --> $DIR/tutorial-suffix-inference-test.rs:14:18
    |
 LL |     identity_u16(y);
    |     ------------ ^ expected `u16`, found `i32`
@@ -25,7 +25,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/tutorial-suffix-inference-test.rs:6:8
+  --> $DIR/tutorial-suffix-inference-test.rs:8:8
    |
 LL |     fn identity_u16(n: u16) -> u16 { n }
    |        ^^^^^^^^^^^^ ------
@@ -35,7 +35,7 @@
    |                   ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/tutorial-suffix-inference-test.rs:21:18
+  --> $DIR/tutorial-suffix-inference-test.rs:23:18
    |
 LL |     identity_u16(a);
    |     ------------ ^ expected `u16`, found `isize`
@@ -43,7 +43,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/tutorial-suffix-inference-test.rs:6:8
+  --> $DIR/tutorial-suffix-inference-test.rs:8:8
    |
 LL |     fn identity_u16(n: u16) -> u16 { n }
    |        ^^^^^^^^^^^^ ------
diff --git a/tests/ui/issues/issue-13359.rs b/tests/ui/issues/issue-13359.rs
index 9129790..5d31d7f 100644
--- a/tests/ui/issues/issue-13359.rs
+++ b/tests/ui/issues/issue-13359.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 fn foo(_s: i16) { }
 
 fn bar(_s: u32) { }
@@ -5,9 +7,9 @@ fn bar(_s: u32) { }
 fn main() {
     foo(1*(1 as isize));
     //~^ ERROR mismatched types
-    //~| expected `i16`, found `isize`
+    //~| NOTE expected `i16`, found `isize`
 
     bar(1*(1 as usize));
     //~^ ERROR mismatched types
-    //~| expected `u32`, found `usize`
+    //~| NOTE expected `u32`, found `usize`
 }
diff --git a/tests/ui/issues/issue-13359.stderr b/tests/ui/issues/issue-13359.stderr
index fef6368..91f5de8 100644
--- a/tests/ui/issues/issue-13359.stderr
+++ b/tests/ui/issues/issue-13359.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-13359.rs:6:9
+  --> $DIR/issue-13359.rs:8:9
    |
 LL |     foo(1*(1 as isize));
    |     --- ^^^^^^^^^^^^^^ expected `i16`, found `isize`
@@ -7,7 +7,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/issue-13359.rs:1:4
+  --> $DIR/issue-13359.rs:3:4
    |
 LL | fn foo(_s: i16) { }
    |    ^^^ -------
@@ -17,7 +17,7 @@
    |         +              +++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/issue-13359.rs:10:9
+  --> $DIR/issue-13359.rs:12:9
    |
 LL |     bar(1*(1 as usize));
    |     --- ^^^^^^^^^^^^^^ expected `u32`, found `usize`
@@ -25,7 +25,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/issue-13359.rs:3:4
+  --> $DIR/issue-13359.rs:5:4
    |
 LL | fn bar(_s: u32) { }
    |    ^^^ -------
diff --git a/tests/ui/issues/issue-13466.rs b/tests/ui/issues/issue-13466.rs
index 52d4d75..78ce4c1 100644
--- a/tests/ui/issues/issue-13466.rs
+++ b/tests/ui/issues/issue-13466.rs
@@ -1,5 +1,7 @@
 // Regression test for #13466
 
+//@ dont-require-annotations: NOTE
+
 pub fn main() {
     // The expected arm type `Option<T>` has one type parameter, while
     // the actual arm `Result<T, E>` has two. typeck should not be
@@ -7,14 +9,14 @@ pub fn main() {
     let _x: usize = match Some(1) {
         Ok(u) => u,
         //~^ ERROR mismatched types
-        //~| expected enum `Option<{integer}>`
-        //~| found enum `Result<_, _>`
-        //~| expected `Option<{integer}>`, found `Result<_, _>`
+        //~| NOTE expected enum `Option<{integer}>`
+        //~| NOTE found enum `Result<_, _>`
+        //~| NOTE expected `Option<{integer}>`, found `Result<_, _>`
 
         Err(e) => panic!(e)
         //~^ ERROR mismatched types
-        //~| expected enum `Option<{integer}>`
-        //~| found enum `Result<_, _>`
-        //~| expected `Option<{integer}>`, found `Result<_, _>`
+        //~| NOTE expected enum `Option<{integer}>`
+        //~| NOTE found enum `Result<_, _>`
+        //~| NOTE expected `Option<{integer}>`, found `Result<_, _>`
     };
 }
diff --git a/tests/ui/issues/issue-13466.stderr b/tests/ui/issues/issue-13466.stderr
index fd928e4..68a555a 100644
--- a/tests/ui/issues/issue-13466.stderr
+++ b/tests/ui/issues/issue-13466.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-13466.rs:8:9
+  --> $DIR/issue-13466.rs:10:9
    |
 LL |     let _x: usize = match Some(1) {
    |                           ------- this expression has type `Option<{integer}>`
@@ -10,7 +10,7 @@
               found enum `Result<_, _>`
 
 error[E0308]: mismatched types
-  --> $DIR/issue-13466.rs:14:9
+  --> $DIR/issue-13466.rs:16:9
    |
 LL |     let _x: usize = match Some(1) {
    |                           ------- this expression has type `Option<{integer}>`
diff --git a/tests/ui/issues/issue-14541.rs b/tests/ui/issues/issue-14541.rs
index 2ff1c1f..358d294 100644
--- a/tests/ui/issues/issue-14541.rs
+++ b/tests/ui/issues/issue-14541.rs
@@ -4,7 +4,8 @@ struct Vec3 { y: f32, z: f32 }
 fn make(v: Vec2) {
     let Vec3 { y: _, z: _ } = v;
     //~^ ERROR mismatched types
-    //~| expected `Vec2`, found `Vec3`
+    //~| NOTE expected `Vec2`, found `Vec3`
+    //~| NOTE this expression has type `Vec2`
 }
 
 fn main() { }
diff --git a/tests/ui/issues/issue-15094.rs b/tests/ui/issues/issue-15094.rs
index cb27e2b..408ab82 100644
--- a/tests/ui/issues/issue-15094.rs
+++ b/tests/ui/issues/issue-15094.rs
@@ -10,8 +10,9 @@ impl<T: fmt::Debug> ops::FnOnce<(),> for Debuger<T> {
     type Output = ();
     fn call_once(self, _args: ()) {
     //~^ ERROR `call_once` has an incompatible type for trait
-    //~| expected signature `extern "rust-call" fn
-    //~| found signature `fn
+    //~| NOTE expected signature `extern "rust-call" fn
+    //~| NOTE found signature `fn
+    //~| NOTE expected "rust-call" fn, found "Rust" fn
         println!("{:?}", self.x);
     }
 }
diff --git a/tests/ui/issues/issue-15381.rs b/tests/ui/issues/issue-15381.rs
index 23b266b..bd5f62d 100644
--- a/tests/ui/issues/issue-15381.rs
+++ b/tests/ui/issues/issue-15381.rs
@@ -3,7 +3,8 @@
 
     for &[x,y,z] in values.chunks(3).filter(|&xs| xs.len() == 3) {
         //~^ ERROR refutable pattern in `for` loop binding
-        //~| patterns `&[]`, `&[_]`, `&[_, _]` and 1 more not covered
+        //~| NOTE patterns `&[]`, `&[_]`, `&[_, _]` and 1 more not covered
+        //~| NOTE the matched value is of type `&[u8]`
         println!("y={}", y);
     }
 }
diff --git a/tests/ui/issues/issue-15783.rs b/tests/ui/issues/issue-15783.rs
index ceb37a2..ef948a1 100644
--- a/tests/ui/issues/issue-15783.rs
+++ b/tests/ui/issues/issue-15783.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 pub fn foo(params: Option<&[&str]>) -> usize {
     params.unwrap().first().unwrap().len()
 }
@@ -7,8 +9,8 @@ fn main() {
     let x = Some(&[name]);
     let msg = foo(x);
     //~^ ERROR mismatched types
-    //~| expected enum `Option<&[&str]>`
-    //~| found enum `Option<&[&str; 1]>`
-    //~| expected `Option<&[&str]>`, found `Option<&[&str; 1]>`
+    //~| NOTE expected enum `Option<&[&str]>`
+    //~| NOTE found enum `Option<&[&str; 1]>`
+    //~| NOTE expected `Option<&[&str]>`, found `Option<&[&str; 1]>`
     assert_eq!(msg, 3);
 }
diff --git a/tests/ui/issues/issue-15783.stderr b/tests/ui/issues/issue-15783.stderr
index 7ed2e19..c9c9a72 100644
--- a/tests/ui/issues/issue-15783.stderr
+++ b/tests/ui/issues/issue-15783.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-15783.rs:8:19
+  --> $DIR/issue-15783.rs:10:19
    |
 LL |     let msg = foo(x);
    |               --- ^ expected `Option<&[&str]>`, found `Option<&[&str; 1]>`
@@ -9,7 +9,7 @@
    = note: expected enum `Option<&[&str]>`
               found enum `Option<&[&str; 1]>`
 note: function defined here
-  --> $DIR/issue-15783.rs:1:8
+  --> $DIR/issue-15783.rs:3:8
    |
 LL | pub fn foo(params: Option<&[&str]>) -> usize {
    |        ^^^ -----------------------
diff --git a/tests/ui/issues/issue-16401.rs b/tests/ui/issues/issue-16401.rs
index 19ae7da..0985a68 100644
--- a/tests/ui/issues/issue-16401.rs
+++ b/tests/ui/issues/issue-16401.rs
@@ -4,12 +4,12 @@
 }
 
 fn main() {
-    match () {
+    match () { //~ NOTE this expression has type `()`
         Slice { data: data, len: len } => (),
         //~^ ERROR mismatched types
-        //~| expected unit type `()`
-        //~| found struct `Slice<_>`
-        //~| expected `()`, found `Slice<_>`
+        //~| NOTE expected unit type `()`
+        //~| NOTE found struct `Slice<_>`
+        //~| NOTE expected `()`, found `Slice<_>`
         _ => unreachable!()
     }
 }
diff --git a/tests/ui/issues/issue-17033.rs b/tests/ui/issues/issue-17033.rs
index 72a8cd9..b8eec3b 100644
--- a/tests/ui/issues/issue-17033.rs
+++ b/tests/ui/issues/issue-17033.rs
@@ -1,6 +1,7 @@
 fn f<'r>(p: &'r mut fn(p: &mut ())) {
     (*p)(()) //~  ERROR mismatched types
-             //~| expected `&mut ()`, found `()`
+             //~| NOTE expected `&mut ()`, found `()`
+             //~| NOTE arguments to this function are incorrect
 }
 
 fn main() {}
diff --git a/tests/ui/issues/issue-17740.rs b/tests/ui/issues/issue-17740.rs
index 574d366..20a7375 100644
--- a/tests/ui/issues/issue-17740.rs
+++ b/tests/ui/issues/issue-17740.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 struct Foo<'a> {
     data: &'a[u8],
 }
@@ -5,13 +7,13 @@
 impl <'a> Foo<'a>{
     fn bar(self: &mut Foo) {
     //~^ ERROR mismatched `self` parameter type
-    //~| expected struct `Foo<'a>`
-    //~| found struct `Foo<'_>`
-    //~| lifetime mismatch
+    //~| NOTE expected struct `Foo<'a>`
+    //~| NOTE found struct `Foo<'_>`
+    //~| NOTE lifetime mismatch
     //~| ERROR mismatched `self` parameter type
-    //~| expected struct `Foo<'a>`
-    //~| found struct `Foo<'_>`
-    //~| lifetime mismatch
+    //~| NOTE expected struct `Foo<'a>`
+    //~| NOTE found struct `Foo<'_>`
+    //~| NOTE lifetime mismatch
     }
 }
 
diff --git a/tests/ui/issues/issue-17740.stderr b/tests/ui/issues/issue-17740.stderr
index d177380..198d7d5 100644
--- a/tests/ui/issues/issue-17740.stderr
+++ b/tests/ui/issues/issue-17740.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched `self` parameter type
-  --> $DIR/issue-17740.rs:6:18
+  --> $DIR/issue-17740.rs:8:18
    |
 LL |     fn bar(self: &mut Foo) {
    |                  ^^^^^^^^ lifetime mismatch
@@ -7,18 +7,18 @@
    = note: expected struct `Foo<'a>`
               found struct `Foo<'_>`
 note: the anonymous lifetime defined here...
-  --> $DIR/issue-17740.rs:6:23
+  --> $DIR/issue-17740.rs:8:23
    |
 LL |     fn bar(self: &mut Foo) {
    |                       ^^^
 note: ...does not necessarily outlive the lifetime `'a` as defined here
-  --> $DIR/issue-17740.rs:5:7
+  --> $DIR/issue-17740.rs:7:7
    |
 LL | impl <'a> Foo<'a>{
    |       ^^
 
 error[E0308]: mismatched `self` parameter type
-  --> $DIR/issue-17740.rs:6:18
+  --> $DIR/issue-17740.rs:8:18
    |
 LL |     fn bar(self: &mut Foo) {
    |                  ^^^^^^^^ lifetime mismatch
@@ -26,12 +26,12 @@
    = note: expected struct `Foo<'a>`
               found struct `Foo<'_>`
 note: the lifetime `'a` as defined here...
-  --> $DIR/issue-17740.rs:5:7
+  --> $DIR/issue-17740.rs:7:7
    |
 LL | impl <'a> Foo<'a>{
    |       ^^
 note: ...does not necessarily outlive the anonymous lifetime defined here
-  --> $DIR/issue-17740.rs:6:23
+  --> $DIR/issue-17740.rs:8:23
    |
 LL |     fn bar(self: &mut Foo) {
    |                       ^^^
diff --git a/tests/ui/issues/issue-19991.rs b/tests/ui/issues/issue-19991.rs
index dd0efa9..cb558b5 100644
--- a/tests/ui/issues/issue-19991.rs
+++ b/tests/ui/issues/issue-19991.rs
@@ -1,9 +1,11 @@
 // Test if the sugared `if let` construct correctly prints "missing an else clause" when an else
 // clause does not exist, instead of the unsympathetic "`match` arms have incompatible types"
 
+//@ dont-require-annotations: NOTE
+
 fn main() {
     if let Some(homura) = Some("madoka") { //~  ERROR missing an `else` clause
-                                           //~| expected integer, found `()`
+                                           //~| NOTE expected integer, found `()`
         765
     };
 }
diff --git a/tests/ui/issues/issue-19991.stderr b/tests/ui/issues/issue-19991.stderr
index ff039f3..1449bab 100644
--- a/tests/ui/issues/issue-19991.stderr
+++ b/tests/ui/issues/issue-19991.stderr
@@ -1,5 +1,5 @@
 error[E0317]: `if` may be missing an `else` clause
-  --> $DIR/issue-19991.rs:5:5
+  --> $DIR/issue-19991.rs:7:5
    |
 LL | /     if let Some(homura) = Some("madoka") {
 LL | |
diff --git a/tests/ui/issues/issue-21332.rs b/tests/ui/issues/issue-21332.rs
index 4473d00..ad764f8 100644
--- a/tests/ui/issues/issue-21332.rs
+++ b/tests/ui/issues/issue-21332.rs
@@ -4,7 +4,8 @@ impl Iterator for S {
     type Item = i32;
     fn next(&mut self) -> Result<i32, i32> { Ok(7) }
     //~^ ERROR method `next` has an incompatible type for trait
-    //~| expected `Option<i32>`, found `Result<i32, i32>`
+    //~| NOTE expected `Option<i32>`, found `Result<i32, i32>`
+    //~| NOTE expected signature `fn(&mut S) -> Option<i32>`
 }
 
 fn main() {}
diff --git a/tests/ui/issues/issue-24819.rs b/tests/ui/issues/issue-24819.rs
index fb4cfb7..97d288e 100644
--- a/tests/ui/issues/issue-24819.rs
+++ b/tests/ui/issues/issue-24819.rs
@@ -1,10 +1,12 @@
+//@ dont-require-annotations: NOTE
+
 use std::collections::HashSet;
 
 fn main() {
     let mut v = Vec::new();
     foo(&mut v);
     //~^ ERROR mismatched types
-    //~| expected `&mut HashSet<u32>`, found `&mut Vec<_>`
+    //~| NOTE expected `&mut HashSet<u32>`, found `&mut Vec<_>`
 }
 
 fn foo(h: &mut HashSet<u32>) {
diff --git a/tests/ui/issues/issue-24819.stderr b/tests/ui/issues/issue-24819.stderr
index 8ec34aa..e144f37 100644
--- a/tests/ui/issues/issue-24819.stderr
+++ b/tests/ui/issues/issue-24819.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-24819.rs:5:9
+  --> $DIR/issue-24819.rs:7:9
    |
 LL |     foo(&mut v);
    |     --- ^^^^^^ expected `&mut HashSet<u32>`, found `&mut Vec<_>`
@@ -9,7 +9,7 @@
    = note: expected mutable reference `&mut HashSet<u32>`
               found mutable reference `&mut Vec<_>`
 note: function defined here
-  --> $DIR/issue-24819.rs:10:4
+  --> $DIR/issue-24819.rs:12:4
    |
 LL | fn foo(h: &mut HashSet<u32>) {
    |    ^^^ --------------------
diff --git a/tests/ui/issues/issue-27942.rs b/tests/ui/issues/issue-27942.rs
index 34b34de..1c2e645 100644
--- a/tests/ui/issues/issue-27942.rs
+++ b/tests/ui/issues/issue-27942.rs
@@ -1,12 +1,14 @@
+//@ dont-require-annotations: NOTE
+
 pub trait Resources<'a> {}
 
 pub trait Buffer<'a, R: Resources<'a>> {
 
     fn select(&self) -> BufferViewHandle<R>;
     //~^ ERROR mismatched types
-    //~| lifetime mismatch
+    //~| NOTE lifetime mismatch
     //~| ERROR mismatched types
-    //~| lifetime mismatch
+    //~| NOTE lifetime mismatch
 }
 
 pub struct BufferViewHandle<'a, R: 'a+Resources<'a>>(&'a R);
diff --git a/tests/ui/issues/issue-27942.stderr b/tests/ui/issues/issue-27942.stderr
index 8ea46ba..671875a 100644
--- a/tests/ui/issues/issue-27942.stderr
+++ b/tests/ui/issues/issue-27942.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-27942.rs:5:25
+  --> $DIR/issue-27942.rs:7:25
    |
 LL |     fn select(&self) -> BufferViewHandle<R>;
    |                         ^^^^^^^^^^^^^^^^^^^ lifetime mismatch
@@ -7,18 +7,18 @@
    = note: expected trait `Resources<'_>`
               found trait `Resources<'a>`
 note: the lifetime `'a` as defined here...
-  --> $DIR/issue-27942.rs:3:18
+  --> $DIR/issue-27942.rs:5:18
    |
 LL | pub trait Buffer<'a, R: Resources<'a>> {
    |                  ^^
 note: ...does not necessarily outlive the anonymous lifetime defined here
-  --> $DIR/issue-27942.rs:5:15
+  --> $DIR/issue-27942.rs:7:15
    |
 LL |     fn select(&self) -> BufferViewHandle<R>;
    |               ^^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/issue-27942.rs:5:25
+  --> $DIR/issue-27942.rs:7:25
    |
 LL |     fn select(&self) -> BufferViewHandle<R>;
    |                         ^^^^^^^^^^^^^^^^^^^ lifetime mismatch
@@ -26,12 +26,12 @@
    = note: expected trait `Resources<'_>`
               found trait `Resources<'a>`
 note: the anonymous lifetime defined here...
-  --> $DIR/issue-27942.rs:5:15
+  --> $DIR/issue-27942.rs:7:15
    |
 LL |     fn select(&self) -> BufferViewHandle<R>;
    |               ^^^^^
 note: ...does not necessarily outlive the lifetime `'a` as defined here
-  --> $DIR/issue-27942.rs:3:18
+  --> $DIR/issue-27942.rs:5:18
    |
 LL | pub trait Buffer<'a, R: Resources<'a>> {
    |                  ^^
diff --git a/tests/ui/issues/issue-2823.rs b/tests/ui/issues/issue-2823.rs
deleted file mode 100644
index 7b443b4..0000000
--- a/tests/ui/issues/issue-2823.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-struct C {
-    x: isize,
-}
-
-impl Drop for C {
-    fn drop(&mut self) {
-        println!("dropping: {}", self.x);
-    }
-}
-
-fn main() {
-    let c = C{ x: 2};
-    let _d = c.clone(); //~ ERROR no method named `clone` found
-}
diff --git a/tests/ui/issues/issue-2823.stderr b/tests/ui/issues/issue-2823.stderr
deleted file mode 100644
index 5cd3f08..0000000
--- a/tests/ui/issues/issue-2823.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error[E0599]: no method named `clone` found for struct `C` in the current scope
-  --> $DIR/issue-2823.rs:13:16
-   |
-LL | struct C {
-   | -------- method `clone` not found for this struct
-...
-LL |     let _d = c.clone();
-   |                ^^^^^ method not found in `C`
-   |
-   = help: items from traits can only be used if the trait is implemented and in scope
-   = note: the following trait defines an item `clone`, perhaps you need to implement it:
-           candidate #1: `Clone`
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/issues/issue-2951.rs b/tests/ui/issues/issue-2951.rs
index 1798e3e..e28516f 100644
--- a/tests/ui/issues/issue-2951.rs
+++ b/tests/ui/issues/issue-2951.rs
@@ -1,10 +1,12 @@
+//@ dont-require-annotations: NOTE
+
 fn foo<T, U>(x: T, y: U) {
     let mut xx = x;
     xx = y;
     //~^  ERROR mismatched types
-    //~| expected type parameter `T`, found type parameter `U`
-    //~| expected type parameter `T`
-    //~| found type parameter `U`
+    //~| NOTE expected type parameter `T`, found type parameter `U`
+    //~| NOTE expected type parameter `T`
+    //~| NOTE found type parameter `U`
 }
 
 fn main() {
diff --git a/tests/ui/issues/issue-2951.stderr b/tests/ui/issues/issue-2951.stderr
index 134808b..d4b4593 100644
--- a/tests/ui/issues/issue-2951.stderr
+++ b/tests/ui/issues/issue-2951.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-2951.rs:3:10
+  --> $DIR/issue-2951.rs:5:10
    |
 LL | fn foo<T, U>(x: T, y: U) {
    |        -  - found type parameter
diff --git a/tests/ui/issues/issue-31011.rs b/tests/ui/issues/issue-31011.rs
index 86fe16f..078d8b2 100644
--- a/tests/ui/issues/issue-31011.rs
+++ b/tests/ui/issues/issue-31011.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 macro_rules! log {
     ( $ctx:expr, $( $args:expr),* ) => {
         if $ctx.trace {
@@ -16,7 +18,7 @@ struct Foo {
 fn wrap<T>(context: &T) -> ()
 {
     log!(context, "entered wrapper");
-    //~^ in this expansion of log!
+    //~^ NOTE in this expansion of log!
 }
 
 fn main() {
diff --git a/tests/ui/issues/issue-31011.stderr b/tests/ui/issues/issue-31011.stderr
index 9785d56..701141e 100644
--- a/tests/ui/issues/issue-31011.stderr
+++ b/tests/ui/issues/issue-31011.stderr
@@ -1,5 +1,5 @@
 error[E0609]: no field `trace` on type `&T`
-  --> $DIR/issue-31011.rs:3:17
+  --> $DIR/issue-31011.rs:5:17
    |
 LL |         if $ctx.trace {
    |                 ^^^^^ unknown field
diff --git a/tests/ui/issues/issue-31910.rs b/tests/ui/issues/issue-31910.rs
index 19cfc46..fc82fda 100644
--- a/tests/ui/issues/issue-31910.rs
+++ b/tests/ui/issues/issue-31910.rs
@@ -1,8 +1,9 @@
 enum Enum<T: Trait> {
-    //~^ ERROR: `T` is never used
+    //~^ ERROR `T` is never used
+    //~| NOTE unused type parameter
     X = Trait::Number,
     //~^ ERROR mismatched types
-    //~| expected `isize`, found `i32`
+    //~| NOTE expected `isize`, found `i32`
 }
 
 trait Trait {
diff --git a/tests/ui/issues/issue-31910.stderr b/tests/ui/issues/issue-31910.stderr
index ca2d2f6..56e4cee 100644
--- a/tests/ui/issues/issue-31910.stderr
+++ b/tests/ui/issues/issue-31910.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-31910.rs:3:9
+  --> $DIR/issue-31910.rs:4:9
    |
 LL |     X = Trait::Number,
    |         ^^^^^^^^^^^^^ expected `isize`, found `i32`
diff --git a/tests/ui/issues/issue-3477.rs b/tests/ui/issues/issue-3477.rs
index 3817d0e..eb94294 100644
--- a/tests/ui/issues/issue-3477.rs
+++ b/tests/ui/issues/issue-3477.rs
@@ -1,5 +1,6 @@
 fn main() {
     let _p: char = 100;
     //~^ ERROR mismatched types
-    //~| expected `char`, found `u8`
+    //~| NOTE expected `char`, found `u8`
+    //~| NOTE expected due to this
 }
diff --git a/tests/ui/issues/issue-3680.rs b/tests/ui/issues/issue-3680.rs
index a0e5279..7fdc6e1 100644
--- a/tests/ui/issues/issue-3680.rs
+++ b/tests/ui/issues/issue-3680.rs
@@ -1,9 +1,9 @@
 fn main() {
-    match None {
+    match None { //~ NOTE this expression has type `Option<_>`
         Err(_) => ()
         //~^ ERROR mismatched types
-        //~| expected enum `Option<_>`
-        //~| found enum `Result<_, _>`
-        //~| expected `Option<_>`, found `Result<_, _>`
+        //~| NOTE expected enum `Option<_>`
+        //~| NOTE found enum `Result<_, _>`
+        //~| NOTE expected `Option<_>`, found `Result<_, _>`
     }
 }
diff --git a/tests/ui/issues/issue-37884.rs b/tests/ui/issues/issue-37884.rs
index ee37481..3480942 100644
--- a/tests/ui/issues/issue-37884.rs
+++ b/tests/ui/issues/issue-37884.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 struct RepeatMut<'a, T>(T, &'a ());
 
 impl<'a, T: 'a> Iterator for RepeatMut<'a, T> {
@@ -5,7 +7,7 @@ impl<'a, T: 'a> Iterator for RepeatMut<'a, T> {
     type Item = &'a mut T;
     fn next(&'a mut self) -> Option<Self::Item>
     //~^ ERROR method not compatible with trait
-    //~| lifetime mismatch
+    //~| NOTE lifetime mismatch
     {
         Some(&mut self.0)
     }
diff --git a/tests/ui/issues/issue-37884.stderr b/tests/ui/issues/issue-37884.stderr
index 17037d2..a7a19e3 100644
--- a/tests/ui/issues/issue-37884.stderr
+++ b/tests/ui/issues/issue-37884.stderr
@@ -1,5 +1,5 @@
 error[E0308]: method not compatible with trait
-  --> $DIR/issue-37884.rs:6:5
+  --> $DIR/issue-37884.rs:8:5
    |
 LL |     fn next(&'a mut self) -> Option<Self::Item>
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
@@ -9,7 +9,7 @@
 note: the anonymous lifetime as defined here...
   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
 note: ...does not necessarily outlive the lifetime `'a` as defined here
-  --> $DIR/issue-37884.rs:3:6
+  --> $DIR/issue-37884.rs:5:6
    |
 LL | impl<'a, T: 'a> Iterator for RepeatMut<'a, T> {
    |      ^^
diff --git a/tests/ui/issues/issue-43355.rs b/tests/ui/issues/issue-43355.rs
index bf819af..597472b 100644
--- a/tests/ui/issues/issue-43355.rs
+++ b/tests/ui/issues/issue-43355.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 pub trait Trait1<X> {
     type Output;
 }
@@ -12,7 +14,7 @@ impl<X, T> Trait1<X> for T where T: Trait2<X> {
 
 impl<X> Trait1<Box<X>> for A {
 //~^ ERROR conflicting implementations of trait
-//~| downstream crates may implement trait `Trait2<std::boxed::Box<_>>` for type `A`
+//~| NOTE downstream crates may implement trait `Trait2<std::boxed::Box<_>>` for type `A`
     type Output = i32;
 }
 
diff --git a/tests/ui/issues/issue-43355.stderr b/tests/ui/issues/issue-43355.stderr
index 25179ef..5a089cb 100644
--- a/tests/ui/issues/issue-43355.stderr
+++ b/tests/ui/issues/issue-43355.stderr
@@ -1,5 +1,5 @@
 error[E0119]: conflicting implementations of trait `Trait1<Box<_>>` for type `A`
-  --> $DIR/issue-43355.rs:13:1
+  --> $DIR/issue-43355.rs:15:1
    |
 LL | impl<X, T> Trait1<X> for T where T: Trait2<X> {
    | --------------------------------------------- first implementation here
diff --git a/tests/ui/issues/issue-4517.rs b/tests/ui/issues/issue-4517.rs
index 469304e..778f8f9 100644
--- a/tests/ui/issues/issue-4517.rs
+++ b/tests/ui/issues/issue-4517.rs
@@ -1,8 +1,10 @@
+//@ dont-require-annotations: NOTE
+
 fn bar(int_param: usize) {}
 
 fn main() {
     let foo: [u8; 4] = [1; 4];
     bar(foo);
     //~^ ERROR mismatched types
-    //~| expected `usize`, found `[u8; 4]`
+    //~| NOTE expected `usize`, found `[u8; 4]`
 }
diff --git a/tests/ui/issues/issue-4517.stderr b/tests/ui/issues/issue-4517.stderr
index 5d544ee..d078c7e 100644
--- a/tests/ui/issues/issue-4517.stderr
+++ b/tests/ui/issues/issue-4517.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-4517.rs:5:9
+  --> $DIR/issue-4517.rs:7:9
    |
 LL |     bar(foo);
    |     --- ^^^ expected `usize`, found `[u8; 4]`
@@ -7,7 +7,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/issue-4517.rs:1:4
+  --> $DIR/issue-4517.rs:3:4
    |
 LL | fn bar(int_param: usize) {}
    |    ^^^ ----------------
diff --git a/tests/ui/issues/issue-4935.rs b/tests/ui/issues/issue-4935.rs
index c95020a..ef8a3eb 100644
--- a/tests/ui/issues/issue-4935.rs
+++ b/tests/ui/issues/issue-4935.rs
@@ -1,6 +1,7 @@
 // Regression test for issue #4935
 
 fn foo(a: usize) {}
-//~^ defined here
+//~^ NOTE defined here
 fn main() { foo(5, 6) }
 //~^ ERROR function takes 1 argument but 2 arguments were supplied
+//~| NOTE unexpected argument #2 of type `{integer}`
diff --git a/tests/ui/issues/issue-4968.rs b/tests/ui/issues/issue-4968.rs
index c8df46d..08539d6 100644
--- a/tests/ui/issues/issue-4968.rs
+++ b/tests/ui/issues/issue-4968.rs
@@ -1,10 +1,12 @@
 // Regression test for issue #4968
 
+//@ dont-require-annotations: NOTE
+
 const A: (isize,isize) = (4,2);
 fn main() {
     match 42 { A => () }
     //~^ ERROR mismatched types
-    //~| expected type `{integer}`
-    //~| found tuple `(isize, isize)`
-    //~| expected integer, found `(isize, isize)`
+    //~| NOTE expected type `{integer}`
+    //~| NOTE found tuple `(isize, isize)`
+    //~| NOTE expected integer, found `(isize, isize)`
 }
diff --git a/tests/ui/issues/issue-4968.stderr b/tests/ui/issues/issue-4968.stderr
index 549e550..2c1e1d7 100644
--- a/tests/ui/issues/issue-4968.stderr
+++ b/tests/ui/issues/issue-4968.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-4968.rs:5:16
+  --> $DIR/issue-4968.rs:7:16
    |
 LL | const A: (isize,isize) = (4,2);
    | ---------------------- constant defined here
diff --git a/tests/ui/issues/issue-5100.rs b/tests/ui/issues/issue-5100.rs
index 53ebdec..e9ae551 100644
--- a/tests/ui/issues/issue-5100.rs
+++ b/tests/ui/issues/issue-5100.rs
@@ -1,5 +1,6 @@
-#![feature(box_patterns)]
+//@ dont-require-annotations: NOTE
 
+#![feature(box_patterns)]
 
 enum A { B, C }
 
@@ -7,41 +8,41 @@ fn main() {
     match (true, false) {
         A::B => (),
 //~^ ERROR mismatched types
-//~| expected `(bool, bool)`, found `A`
-//~| expected tuple `(bool, bool)`
-//~| found enum `A`
+//~| NOTE expected `(bool, bool)`, found `A`
+//~| NOTE expected tuple `(bool, bool)`
+//~| NOTE found enum `A`
         _ => ()
     }
 
     match (true, false) {
         (true, false, false) => ()
 //~^ ERROR mismatched types
-//~| expected a tuple with 2 elements, found one with 3 elements
-//~| expected tuple `(bool, bool)`
-//~| found tuple `(_, _, _)`
+//~| NOTE expected a tuple with 2 elements, found one with 3 elements
+//~| NOTE expected tuple `(bool, bool)`
+//~| NOTE found tuple `(_, _, _)`
     }
 
     match (true, false) {
         (true, false, false) => ()
 //~^ ERROR mismatched types
-//~| expected a tuple with 2 elements, found one with 3 elements
-//~| expected tuple `(bool, bool)`
-//~| found tuple `(_, _, _)`
+//~| NOTE expected a tuple with 2 elements, found one with 3 elements
+//~| NOTE expected tuple `(bool, bool)`
+//~| NOTE found tuple `(_, _, _)`
     }
 
     match (true, false) {
         box (true, false) => ()
 //~^ ERROR mismatched types
-//~| expected tuple `(bool, bool)`
-//~| found struct `Box<_>`
+//~| NOTE expected tuple `(bool, bool)`
+//~| NOTE found struct `Box<_>`
     }
 
     match (true, false) {
         &(true, false) => ()
 //~^ ERROR mismatched types
-//~| expected `(bool, bool)`, found `&_`
-//~| expected tuple `(bool, bool)`
-//~| found reference `&_`
+//~| NOTE expected `(bool, bool)`, found `&_`
+//~| NOTE expected tuple `(bool, bool)`
+//~| NOTE found reference `&_`
     }
 
 
@@ -53,5 +54,5 @@ fn main() {
 
     // Make sure none of the errors above were fatal
     let x: char = true; //~  ERROR mismatched types
-                        //~| expected `char`, found `bool`
+                        //~| NOTE expected `char`, found `bool`
 }
diff --git a/tests/ui/issues/issue-5100.stderr b/tests/ui/issues/issue-5100.stderr
index b1680aa..24d41a1 100644
--- a/tests/ui/issues/issue-5100.stderr
+++ b/tests/ui/issues/issue-5100.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-5100.rs:8:9
+  --> $DIR/issue-5100.rs:9:9
    |
 LL | enum A { B, C }
    |          - unit variant defined here
@@ -13,7 +13,7 @@
                found enum `A`
 
 error[E0308]: mismatched types
-  --> $DIR/issue-5100.rs:17:9
+  --> $DIR/issue-5100.rs:18:9
    |
 LL |     match (true, false) {
    |           ------------- this expression has type `(bool, bool)`
@@ -24,7 +24,7 @@
               found tuple `(_, _, _)`
 
 error[E0308]: mismatched types
-  --> $DIR/issue-5100.rs:25:9
+  --> $DIR/issue-5100.rs:26:9
    |
 LL |     match (true, false) {
    |           ------------- this expression has type `(bool, bool)`
@@ -35,7 +35,7 @@
               found tuple `(_, _, _)`
 
 error[E0308]: mismatched types
-  --> $DIR/issue-5100.rs:33:9
+  --> $DIR/issue-5100.rs:34:9
    |
 LL |     match (true, false) {
    |           ------------- this expression has type `(bool, bool)`
@@ -46,7 +46,7 @@
              found struct `Box<_>`
 
 error[E0308]: mismatched types
-  --> $DIR/issue-5100.rs:40:9
+  --> $DIR/issue-5100.rs:41:9
    |
 LL |     match (true, false) {
    |           ------------- this expression has type `(bool, bool)`
@@ -57,13 +57,13 @@
            found reference `&_`
 
 error[E0618]: expected function, found `(char, char)`
-  --> $DIR/issue-5100.rs:48:14
+  --> $DIR/issue-5100.rs:49:14
    |
 LL |     let v = [('a', 'b')
    |              ^^^^^^^^^^- help: consider separating array elements with a comma: `,`
 
 error[E0308]: mismatched types
-  --> $DIR/issue-5100.rs:55:19
+  --> $DIR/issue-5100.rs:56:19
    |
 LL |     let x: char = true;
    |            ----   ^^^^ expected `char`, found `bool`
diff --git a/tests/ui/issues/issue-5358-1.rs b/tests/ui/issues/issue-5358-1.rs
index 14ee962..281f219 100644
--- a/tests/ui/issues/issue-5358-1.rs
+++ b/tests/ui/issues/issue-5358-1.rs
@@ -2,12 +2,12 @@
 struct S(Either<usize, usize>);
 
 fn main() {
-    match S(Either::Left(5)) {
+    match S(Either::Left(5)) { //~ NOTE this expression has type `S`
         Either::Right(_) => {}
         //~^ ERROR mismatched types
-        //~| expected `S`, found `Either<_, _>`
-        //~| expected struct `S`
-        //~| found enum `Either<_, _>`
+        //~| NOTE expected `S`, found `Either<_, _>`
+        //~| NOTE expected struct `S`
+        //~| NOTE found enum `Either<_, _>`
         _ => {}
     }
 }
diff --git a/tests/ui/issues/issue-7061.rs b/tests/ui/issues/issue-7061.rs
index 8a6ee92..c5d5a9d 100644
--- a/tests/ui/issues/issue-7061.rs
+++ b/tests/ui/issues/issue-7061.rs
@@ -1,10 +1,12 @@
+//@ dont-require-annotations: NOTE
+
 struct BarStruct;
 
 impl<'a> BarStruct {
     fn foo(&'a mut self) -> Box<BarStruct> { self }
     //~^ ERROR mismatched types
-    //~| expected struct `Box<BarStruct>`
-    //~| found mutable reference `&'a mut BarStruct`
+    //~| NOTE expected struct `Box<BarStruct>`
+    //~| NOTE found mutable reference `&'a mut BarStruct`
 }
 
 fn main() {}
diff --git a/tests/ui/issues/issue-7061.stderr b/tests/ui/issues/issue-7061.stderr
index 4fca2ff..b4c0ebf 100644
--- a/tests/ui/issues/issue-7061.stderr
+++ b/tests/ui/issues/issue-7061.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-7061.rs:4:46
+  --> $DIR/issue-7061.rs:6:46
    |
 LL |     fn foo(&'a mut self) -> Box<BarStruct> { self }
    |                             --------------   ^^^^ expected `Box<BarStruct>`, found `&mut BarStruct`
diff --git a/tests/ui/issues/issue-7092.rs b/tests/ui/issues/issue-7092.rs
index c3c96c7..fab18bd 100644
--- a/tests/ui/issues/issue-7092.rs
+++ b/tests/ui/issues/issue-7092.rs
@@ -2,12 +2,12 @@
 }
 
 fn foo(x: Whatever) {
-    match x {
+    match x { //~ NOTE this expression has type `Whatever`
         Some(field) =>
 //~^ ERROR mismatched types
-//~| expected `Whatever`, found `Option<_>`
-//~| expected enum `Whatever`
-//~| found enum `Option<_>`
+//~| NOTE expected `Whatever`, found `Option<_>`
+//~| NOTE expected enum `Whatever`
+//~| NOTE found enum `Option<_>`
             field.access(),
     }
 }
diff --git a/tests/ui/issues/issue-7867.rs b/tests/ui/issues/issue-7867.rs
index e9fd10c..87e7c83 100644
--- a/tests/ui/issues/issue-7867.rs
+++ b/tests/ui/issues/issue-7867.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 enum A { B, C }
 
 mod foo { pub fn bar() {} }
@@ -6,9 +8,9 @@ fn main() {
     match (true, false) {
         A::B => (),
         //~^ ERROR mismatched types
-        //~| expected `(bool, bool)`, found `A`
-        //~| expected tuple `(bool, bool)`
-        //~| found enum `A`
+        //~| NOTE expected `(bool, bool)`, found `A`
+        //~| NOTE expected tuple `(bool, bool)`
+        //~| NOTE found enum `A`
         _ => ()
     }
 }
diff --git a/tests/ui/issues/issue-7867.stderr b/tests/ui/issues/issue-7867.stderr
index 1a0cf5d..fcb69d7 100644
--- a/tests/ui/issues/issue-7867.stderr
+++ b/tests/ui/issues/issue-7867.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-7867.rs:7:9
+  --> $DIR/issue-7867.rs:9:9
    |
 LL | enum A { B, C }
    |          - unit variant defined here
diff --git a/tests/ui/lint/non-snake-case/lint-uppercase-variables.rs b/tests/ui/lint/non-snake-case/lint-uppercase-variables.rs
index 59dba53..aefbe63 100644
--- a/tests/ui/lint/non-snake-case/lint-uppercase-variables.rs
+++ b/tests/ui/lint/non-snake-case/lint-uppercase-variables.rs
@@ -35,6 +35,9 @@ fn in_param(Foo: foo::Foo) {}
     //~^^ ERROR `Foo` is named the same as one of the variants of the type `foo::Foo`
     //~^^^ WARN unused variable: `Foo`
 
+    let _: fn(CamelCase: i32);
+    //~^ ERROR variable `CamelCase` should have a snake case name
+
     test(1);
 
     let _ = Something { X: 0 };
diff --git a/tests/ui/lint/non-snake-case/lint-uppercase-variables.stderr b/tests/ui/lint/non-snake-case/lint-uppercase-variables.stderr
index 9220828..b0c5600 100644
--- a/tests/ui/lint/non-snake-case/lint-uppercase-variables.stderr
+++ b/tests/ui/lint/non-snake-case/lint-uppercase-variables.stderr
@@ -85,6 +85,12 @@
 LL |     fn in_param(Foo: foo::Foo) {}
    |                 ^^^ help: convert the identifier to snake case (notice the capitalization): `foo`
 
-error: aborting due to 9 previous errors; 3 warnings emitted
+error: variable `CamelCase` should have a snake case name
+  --> $DIR/lint-uppercase-variables.rs:38:15
+   |
+LL |     let _: fn(CamelCase: i32);
+   |               ^^^^^^^^^ help: convert the identifier to snake case: `camel_case`
+
+error: aborting due to 10 previous errors; 3 warnings emitted
 
 For more information about this error, try `rustc --explain E0170`.
diff --git a/tests/ui/macros/issue-118786.rs b/tests/ui/macros/issue-118786.rs
index a73b737..78fd6ab 100644
--- a/tests/ui/macros/issue-118786.rs
+++ b/tests/ui/macros/issue-118786.rs
@@ -1,4 +1,5 @@
 //@ compile-flags: --crate-type lib -O -C debug-assertions=yes
+//@ dont-require-annotations: NOTE
 
 // Regression test for issue 118786
 
@@ -7,7 +8,7 @@ macro_rules! make_macro {
         macro_rules! $macro_name {
         //~^ ERROR macro expansion ignores `{` and any tokens following
         //~| ERROR cannot find macro `macro_rules` in this scope
-        //~| put a macro name here
+        //~| NOTE put a macro name here
             () => {}
         }
     }
diff --git a/tests/ui/macros/issue-118786.stderr b/tests/ui/macros/issue-118786.stderr
index af4cc9a..ddec281 100644
--- a/tests/ui/macros/issue-118786.stderr
+++ b/tests/ui/macros/issue-118786.stderr
@@ -1,5 +1,5 @@
 error: macros that expand to items must be delimited with braces or followed by a semicolon
-  --> $DIR/issue-118786.rs:16:13
+  --> $DIR/issue-118786.rs:17:13
    |
 LL | make_macro!((meow));
    |             ^^^^^^
@@ -15,7 +15,7 @@
    |                                 +
 
 error: macro expansion ignores `{` and any tokens following
-  --> $DIR/issue-118786.rs:7:34
+  --> $DIR/issue-118786.rs:8:34
    |
 LL |         macro_rules! $macro_name {
    |                                  ^
@@ -26,7 +26,7 @@
    = note: the usage of `make_macro!` is likely invalid in item context
 
 error: cannot find macro `macro_rules` in this scope
-  --> $DIR/issue-118786.rs:7:9
+  --> $DIR/issue-118786.rs:8:9
    |
 LL |         macro_rules! $macro_name {
    |         ^^^^^^^^^^^
@@ -35,7 +35,7 @@
    | ------------------- in this macro invocation
    |
 note: maybe you have forgotten to define a name for this `macro_rules!`
-  --> $DIR/issue-118786.rs:7:20
+  --> $DIR/issue-118786.rs:8:20
    |
 LL |         macro_rules! $macro_name {
    |                    ^ put a macro name here
diff --git a/tests/ui/macros/issue-29084.rs b/tests/ui/macros/issue-29084.rs
index d162526..a0a2966 100644
--- a/tests/ui/macros/issue-29084.rs
+++ b/tests/ui/macros/issue-29084.rs
@@ -1,13 +1,15 @@
+//@ dont-require-annotations: NOTE
+
 macro_rules! foo {
     ($d:expr) => {{
         fn bar(d: u8) { }
         bar(&mut $d);
         //~^ ERROR mismatched types
-        //~| expected `u8`, found `&mut u8`
+        //~| NOTE expected `u8`, found `&mut u8`
     }}
 }
 
 fn main() {
     foo!(0u8);
-    //~^ in this expansion of foo!
+    //~^ NOTE in this expansion of foo!
 }
diff --git a/tests/ui/macros/issue-29084.stderr b/tests/ui/macros/issue-29084.stderr
index 9c33e4e..6e7474c 100644
--- a/tests/ui/macros/issue-29084.stderr
+++ b/tests/ui/macros/issue-29084.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-29084.rs:4:13
+  --> $DIR/issue-29084.rs:6:13
    |
 LL |         bar(&mut $d);
    |         --- ^^^^^^^ expected `u8`, found `&mut u8`
@@ -10,7 +10,7 @@
    |     --------- in this macro invocation
    |
 note: function defined here
-  --> $DIR/issue-29084.rs:3:12
+  --> $DIR/issue-29084.rs:5:12
    |
 LL |         fn bar(d: u8) { }
    |            ^^^ -----
diff --git a/tests/ui/macros/stringify.rs b/tests/ui/macros/stringify.rs
index 3490d3e..3f3d9252 100644
--- a/tests/ui/macros/stringify.rs
+++ b/tests/ui/macros/stringify.rs
@@ -288,6 +288,9 @@ fn test_expr() {
     // ExprKind::OffsetOf: untestable because this test works pre-expansion.
 
     // ExprKind::MacCall
+    c1!(expr, [ mac!() ], "mac!()");
+    c1!(expr, [ mac![] ], "mac![]");
+    c1!(expr, [ mac! {} ], "mac! {}");
     c1!(expr, [ mac!(...) ], "mac!(...)");
     c1!(expr, [ mac![...] ], "mac![...]");
     c1!(expr, [ mac! { ... } ], "mac! { ... }");
@@ -353,7 +356,8 @@ fn test_item() {
     c1!(item, [ pub extern crate self as std; ], "pub extern crate self as std;");
 
     // ItemKind::Use
-    c1!(item, [ pub use crate::{a, b::c}; ], "pub use crate::{ a, b::c };"); // FIXME
+    c1!(item, [ pub use crate::{a, b::c}; ], "pub use crate::{a, b::c};");
+    c1!(item, [ pub use crate::{ e, ff }; ], "pub use crate::{ e, ff };");
     c1!(item, [ pub use A::*; ], "pub use A::*;");
 
     // ItemKind::Static
@@ -482,9 +486,12 @@ trait Trait<'a>: Sized
     c1!(item, [ impl ~const Struct {} ], "impl ~const Struct {}");
 
     // ItemKind::MacCall
+    c1!(item, [ mac!(); ], "mac!();");
+    c1!(item, [ mac![]; ], "mac![];");
+    c1!(item, [ mac! {} ], "mac! {}");
     c1!(item, [ mac!(...); ], "mac!(...);");
     c1!(item, [ mac![...]; ], "mac![...];");
-    c1!(item, [ mac! { ... } ], "mac! { ... }");
+    c1!(item, [ mac! {...} ], "mac! {...}");
 
     // ItemKind::MacroDef
     c1!(item,
@@ -598,8 +605,11 @@ fn test_pat() {
     c1!(pat, [ (pat) ], "(pat)");
 
     // PatKind::MacCall
+    c1!(pat, [ mac!() ], "mac!()");
+    c1!(pat, [ mac![] ], "mac![]");
+    c1!(pat, [ mac! {} ], "mac! {}");
     c1!(pat, [ mac!(...) ], "mac!(...)");
-    c1!(pat, [ mac![...] ], "mac![...]");
+    c1!(pat, [ mac! [ ... ] ], "mac! [...]");
     c1!(pat, [ mac! { ... } ], "mac! { ... }");
 
     // Attributes are not allowed on patterns.
@@ -644,6 +654,9 @@ fn test_stmt() {
     c1!(stmt, [ ; ], ";");
 
     // StmtKind::MacCall
+    c1!(stmt, [ mac! ( ) ], "mac! ()");
+    c1!(stmt, [ mac![] ], "mac![]");
+    c1!(stmt, [ mac!{} ], "mac!{}");
     c1!(stmt, [ mac!(...) ], "mac!(...)");
     c1!(stmt, [ mac![...] ], "mac![...]");
     c1!(stmt, [ mac! { ... } ], "mac! { ... }");
@@ -739,6 +752,9 @@ fn test_ty() {
     // TyKind::ImplicitSelf: there is no syntax for this.
 
     // TyKind::MacCall
+    c1!(ty, [ mac!() ], "mac!()");
+    c1!(ty, [ mac![] ], "mac![]");
+    c1!(ty, [ mac! { } ], "mac! {}");
     c1!(ty, [ mac!(...) ], "mac!(...)");
     c1!(ty, [ mac![...] ], "mac![...]");
     c1!(ty, [ mac! { ... } ], "mac! { ... }");
diff --git a/tests/ui/macros/trace_faulty_macros.stderr b/tests/ui/macros/trace_faulty_macros.stderr
index 73fed66..e90d7a9 100644
--- a/tests/ui/macros/trace_faulty_macros.stderr
+++ b/tests/ui/macros/trace_faulty_macros.stderr
@@ -87,9 +87,9 @@
    |             ^^^^^^^^^^^^
    |
    = note: expanding `pat_macro! {  }`
-   = note: to `pat_macro! (A { a : a, b : 0, c : _, .. });`
-   = note: expanding `pat_macro! { A { a : a, b : 0, c : _, .. } }`
-   = note: to `A { a : a, b : 0, c : _, .. }`
+   = note: to `pat_macro! (A {a : a, b : 0, c : _, ..});`
+   = note: expanding `pat_macro! { A {a : a, b : 0, c : _, ..} }`
+   = note: to `A {a : a, b : 0, c : _, ..}`
 
 note: trace_macro
   --> $DIR/trace_faulty_macros.rs:53:5
diff --git a/tests/ui/match/match-struct.rs b/tests/ui/match/match-struct.rs
index 4da7b43..2160571 100644
--- a/tests/ui/match/match-struct.rs
+++ b/tests/ui/match/match-struct.rs
@@ -2,10 +2,10 @@
 enum E { C(isize) }
 
 fn main() {
-    match (S { a: 1 }) {
+    match (S { a: 1 }) { //~ NOTE this expression has type `S`
         E::C(_) => (),
         //~^ ERROR mismatched types
-        //~| expected `S`, found `E`
+        //~| NOTE expected `S`, found `E`
         _ => ()
     }
 }
diff --git a/tests/ui/methods/clone-missing.rs b/tests/ui/methods/clone-missing.rs
index f2e4ad2..c5ecd3f 100644
--- a/tests/ui/methods/clone-missing.rs
+++ b/tests/ui/methods/clone-missing.rs
@@ -1,19 +1,34 @@
-// This test checks that calling `.clone()` on a type that does not implement the `Clone` trait
-// results in a compilation error. The `Foo` struct does not derive or implement `Clone`,
-// so attempting to clone it should fail.
+//! This test checks that calling `.clone()` on a type that does
+//! not implement the `Clone` trait results in a compilation error.
+//! The `NotClone` and AlsoNotClone structs do not derive or
+//! implement `Clone`, so attempting to clone them should fail.
 
-struct Foo {
-  i: isize,
+struct NotClone {
+    i: isize,
 }
 
-fn foo(i:isize) -> Foo {
-    Foo {
-        i: i
+fn not_clone(i: isize) -> NotClone {
+    NotClone { i }
+}
+
+struct AlsoNotClone {
+    i: isize,
+    j: NotClone,
+}
+
+fn also_not_clone(i: isize) -> AlsoNotClone {
+    AlsoNotClone {
+        i,
+        j: NotClone { i: i },
     }
 }
 
 fn main() {
-    let x = foo(10);
+    let x = not_clone(10);
+    let _y = x.clone();
+    //~^ ERROR no method named `clone` found
+
+    let x = also_not_clone(10);
     let _y = x.clone();
     //~^ ERROR no method named `clone` found
 }
diff --git a/tests/ui/methods/clone-missing.stderr b/tests/ui/methods/clone-missing.stderr
index 4ab1aae..8676e73 100644
--- a/tests/ui/methods/clone-missing.stderr
+++ b/tests/ui/methods/clone-missing.stderr
@@ -1,16 +1,29 @@
-error[E0599]: no method named `clone` found for struct `Foo` in the current scope
-  --> $DIR/clone-missing.rs:17:16
+error[E0599]: no method named `clone` found for struct `NotClone` in the current scope
+  --> $DIR/clone-missing.rs:28:16
    |
-LL | struct Foo {
-   | ---------- method `clone` not found for this struct
+LL | struct NotClone {
+   | --------------- method `clone` not found for this struct
 ...
 LL |     let _y = x.clone();
-   |                ^^^^^ method not found in `Foo`
+   |                ^^^^^ method not found in `NotClone`
    |
    = help: items from traits can only be used if the trait is implemented and in scope
    = note: the following trait defines an item `clone`, perhaps you need to implement it:
            candidate #1: `Clone`
 
-error: aborting due to 1 previous error
+error[E0599]: no method named `clone` found for struct `AlsoNotClone` in the current scope
+  --> $DIR/clone-missing.rs:32:16
+   |
+LL | struct AlsoNotClone {
+   | ------------------- method `clone` not found for this struct
+...
+LL |     let _y = x.clone();
+   |                ^^^^^ method not found in `AlsoNotClone`
+   |
+   = help: items from traits can only be used if the trait is implemented and in scope
+   = note: the following trait defines an item `clone`, perhaps you need to implement it:
+           candidate #1: `Clone`
+
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs b/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs
index 9e53ff0..5ef1d0c 100644
--- a/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs
+++ b/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 #![feature(arbitrary_self_types, coerce_unsized, dispatch_from_dyn, unsize)]
 #![feature(unsized_locals, unsized_fn_params)]
 //~^ WARN the feature `unsized_locals` is incomplete
@@ -85,7 +87,7 @@ fn objectcandidate_impl() {
 
     // Observe the type of `z` is `u32`
     let _seetype: () = z; //~ ERROR mismatched types
-    //~| expected `()`, found `u32`
+    //~| NOTE expected `()`, found `u32`
 }
 
 fn traitcandidate_impl() {
@@ -102,7 +104,7 @@ fn traitcandidate_impl() {
 
     // Observe the type of `z` is `u64`
     let _seetype: () = z; //~ ERROR mismatched types
-    //~| expected `()`, found `u64`
+    //~| NOTE expected `()`, found `u64`
 }
 
 fn traitcandidate_impl_with_nuisance() {
@@ -137,7 +139,7 @@ fn neither_impl() {
 
     // Observe the type of `z` is `u8`
     let _seetype: () = z; //~ ERROR mismatched types
-    //~| expected `()`, found `u8`
+    //~| NOTE expected `()`, found `u8`
 }
 
 fn both_impls() {
@@ -155,7 +157,7 @@ fn both_impls() {
 
     // Observe the type of `z` is `u32`
     let _seetype: () = z; //~ ERROR mismatched types
-    //~| expected `()`, found `u32`
+    //~| NOTE expected `()`, found `u32`
 }
 
 
@@ -172,7 +174,7 @@ fn both_impls_with_nuisance() {
 
     // Observe the type of `z` is `u32`
     let _seetype: () = z; //~ ERROR mismatched types
-    //~| expected `()`, found `u32`
+    //~| NOTE expected `()`, found `u32`
 }
 
 fn main() {
diff --git a/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr b/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr
index d6da3f2..213139a 100644
--- a/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr
+++ b/tests/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr
@@ -1,5 +1,5 @@
 warning: the feature `unsized_locals` is incomplete and may not be safe to use and/or cause compiler crashes
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:2:12
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:4:12
    |
 LL | #![feature(unsized_locals, unsized_fn_params)]
    |            ^^^^^^^^^^^^^^
@@ -8,7 +8,7 @@
    = note: `#[warn(incomplete_features)]` on by default
 
 error[E0308]: mismatched types
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:87:24
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:89:24
    |
 LL |     let _seetype: () = z;
    |                   --   ^ expected `()`, found `u32`
@@ -16,7 +16,7 @@
    |                   expected due to this
 
 error[E0308]: mismatched types
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:104:24
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:106:24
    |
 LL |     let _seetype: () = z;
    |                   --   ^ expected `()`, found `u64`
@@ -24,23 +24,23 @@
    |                   expected due to this
 
 error[E0034]: multiple applicable items in scope
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:122:15
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:124:15
    |
 LL |     let z = x.foo();
    |               ^^^ multiple `foo` found
    |
 note: candidate #1 is defined in the trait `FinalFoo`
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:59:5
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:61:5
    |
 LL |     fn foo(&self) -> u8;
    |     ^^^^^^^^^^^^^^^^^^^^
 note: candidate #2 is defined in an impl of the trait `NuisanceFoo` for the type `T`
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:72:9
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:74:9
    |
 LL |         fn foo(self) {}
    |         ^^^^^^^^^^^^
 note: candidate #3 is defined in an impl of the trait `X` for the type `T`
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:45:9
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:47:9
    |
 LL |         fn foo(self: Smaht<Self, u64>) -> u64 {
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -61,7 +61,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:139:24
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:141:24
    |
 LL |     let _seetype: () = z;
    |                   --   ^ expected `()`, found `u8`
@@ -69,7 +69,7 @@
    |                   expected due to this
 
 error[E0308]: mismatched types
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:157:24
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:159:24
    |
 LL |     let _seetype: () = z;
    |                   --   ^ expected `()`, found `u32`
@@ -77,7 +77,7 @@
    |                   expected due to this
 
 error[E0308]: mismatched types
-  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:174:24
+  --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:176:24
    |
 LL |     let _seetype: () = z;
    |                   --   ^ expected `()`, found `u32`
diff --git a/tests/ui/methods/method-self-arg-1.rs b/tests/ui/methods/method-self-arg-1.rs
index 5912b4e..a0056b5 100644
--- a/tests/ui/methods/method-self-arg-1.rs
+++ b/tests/ui/methods/method-self-arg-1.rs
@@ -1,5 +1,7 @@
 // Test method calls with self as an argument cannot subvert type checking.
 
+//@ dont-require-annotations: NOTE
+
 struct Foo;
 
 impl Foo {
@@ -9,9 +11,9 @@ fn bar(&self) {}
 fn main() {
     let x = Foo;
     Foo::bar(x); //~  ERROR mismatched types
-                 //~| expected `&Foo`, found `Foo`
+                 //~| NOTE expected `&Foo`, found `Foo`
     Foo::bar(&42); //~  ERROR mismatched types
-                      //~| expected `&Foo`, found `&{integer}`
-                      //~| expected reference `&Foo`
-                      //~| found reference `&{integer}`
+                      //~| NOTE expected `&Foo`, found `&{integer}`
+                      //~| NOTE expected reference `&Foo`
+                      //~| NOTE found reference `&{integer}`
 }
diff --git a/tests/ui/methods/method-self-arg-1.stderr b/tests/ui/methods/method-self-arg-1.stderr
index dcc21ac..1d5927d 100644
--- a/tests/ui/methods/method-self-arg-1.stderr
+++ b/tests/ui/methods/method-self-arg-1.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/method-self-arg-1.rs:11:14
+  --> $DIR/method-self-arg-1.rs:13:14
    |
 LL |     Foo::bar(x);
    |     -------- ^ expected `&Foo`, found `Foo`
@@ -7,7 +7,7 @@
    |     arguments to this function are incorrect
    |
 note: method defined here
-  --> $DIR/method-self-arg-1.rs:6:8
+  --> $DIR/method-self-arg-1.rs:8:8
    |
 LL |     fn bar(&self) {}
    |        ^^^ -----
@@ -17,7 +17,7 @@
    |              +
 
 error[E0308]: mismatched types
-  --> $DIR/method-self-arg-1.rs:13:14
+  --> $DIR/method-self-arg-1.rs:15:14
    |
 LL |     Foo::bar(&42);
    |     -------- ^^^ expected `&Foo`, found `&{integer}`
@@ -27,7 +27,7 @@
    = note: expected reference `&Foo`
               found reference `&{integer}`
 note: method defined here
-  --> $DIR/method-self-arg-1.rs:6:8
+  --> $DIR/method-self-arg-1.rs:8:8
    |
 LL |     fn bar(&self) {}
    |        ^^^ -----
diff --git a/tests/ui/mismatched_types/issue-13033.rs b/tests/ui/mismatched_types/issue-13033.rs
index fdb356e..3b08857 100644
--- a/tests/ui/mismatched_types/issue-13033.rs
+++ b/tests/ui/mismatched_types/issue-13033.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 trait Foo {
     fn bar(&mut self, other: &mut dyn Foo);
 }
@@ -7,8 +9,8 @@
 impl Foo for Baz {
     fn bar(&mut self, other: &dyn Foo) {}
     //~^ ERROR method `bar` has an incompatible type for trait
-    //~| expected signature `fn(&mut Baz, &mut dyn Foo)`
-    //~| found signature `fn(&mut Baz, &dyn Foo)`
+    //~| NOTE expected signature `fn(&mut Baz, &mut dyn Foo)`
+    //~| NOTE found signature `fn(&mut Baz, &dyn Foo)`
 }
 
 fn main() {}
diff --git a/tests/ui/mismatched_types/issue-13033.stderr b/tests/ui/mismatched_types/issue-13033.stderr
index 61786ef..f12f81d 100644
--- a/tests/ui/mismatched_types/issue-13033.stderr
+++ b/tests/ui/mismatched_types/issue-13033.stderr
@@ -1,11 +1,11 @@
 error[E0053]: method `bar` has an incompatible type for trait
-  --> $DIR/issue-13033.rs:8:30
+  --> $DIR/issue-13033.rs:10:30
    |
 LL |     fn bar(&mut self, other: &dyn Foo) {}
    |                              ^^^^^^^^ types differ in mutability
    |
 note: type in trait
-  --> $DIR/issue-13033.rs:2:30
+  --> $DIR/issue-13033.rs:4:30
    |
 LL |     fn bar(&mut self, other: &mut dyn Foo);
    |                              ^^^^^^^^^^^^
diff --git a/tests/ui/moves/moves-based-on-type-match-bindings.rs b/tests/ui/moves/moves-based-on-type-match-bindings.rs
index 4fb9b40..407f097 100644
--- a/tests/ui/moves/moves-based-on-type-match-bindings.rs
+++ b/tests/ui/moves/moves-based-on-type-match-bindings.rs
@@ -10,12 +10,12 @@ fn f10() {
     let x = Foo {f: "hi".to_string()};
 
     let y = match x {
-        Foo {f} => {}
+        Foo {f} => {} //~ NOTE value partially moved here
     };
 
     touch(&x); //~ ERROR borrow of partially moved value: `x`
-    //~^ value borrowed here after partial move
-    //~| partial move occurs because `x.f` has type `String`
+    //~^ NOTE value borrowed here after partial move
+    //~| NOTE partial move occurs because `x.f` has type `String`
 }
 
 fn main() {}
diff --git a/tests/ui/mut/mut-pattern-mismatched.rs b/tests/ui/mut/mut-pattern-mismatched.rs
index 700261f..d99831b 100644
--- a/tests/ui/mut/mut-pattern-mismatched.rs
+++ b/tests/ui/mut/mut-pattern-mismatched.rs
@@ -1,20 +1,22 @@
+//@ dont-require-annotations: NOTE
+
 fn main() {
     let foo = &mut 1;
 
     // (separate lines to ensure the spans are accurate)
 
      let &_ //~  ERROR mismatched types
-            //~| expected mutable reference `&mut {integer}`
-            //~| found reference `&_`
-            //~| types differ in mutability
+            //~| NOTE expected mutable reference `&mut {integer}`
+            //~| NOTE found reference `&_`
+            //~| NOTE types differ in mutability
         = foo;
     let &mut _ = foo;
 
     let bar = &1;
     let &_ = bar;
     let &mut _ //~  ERROR mismatched types
-               //~| expected reference `&{integer}`
-               //~| found mutable reference `&mut _`
-               //~| types differ in mutability
+               //~| NOTE expected reference `&{integer}`
+               //~| NOTE found mutable reference `&mut _`
+               //~| NOTE types differ in mutability
          = bar;
 }
diff --git a/tests/ui/mut/mut-pattern-mismatched.stderr b/tests/ui/mut/mut-pattern-mismatched.stderr
index cad1cef..25b1bfe 100644
--- a/tests/ui/mut/mut-pattern-mismatched.stderr
+++ b/tests/ui/mut/mut-pattern-mismatched.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/mut-pattern-mismatched.rs:6:10
+  --> $DIR/mut-pattern-mismatched.rs:8:10
    |
 LL |      let &_
    |          ^^ types differ in mutability
@@ -11,7 +11,7 @@
                       found reference `&_`
 
 error[E0308]: mismatched types
-  --> $DIR/mut-pattern-mismatched.rs:15:9
+  --> $DIR/mut-pattern-mismatched.rs:17:9
    |
 LL |     let &mut _
    |         ^^^^^^ types differ in mutability
diff --git a/tests/ui/never_type/issue-10176.rs b/tests/ui/never_type/issue-10176.rs
index 5ac4359..41e012d 100644
--- a/tests/ui/never_type/issue-10176.rs
+++ b/tests/ui/never_type/issue-10176.rs
@@ -1,9 +1,9 @@
-fn f() -> isize {
+fn f() -> isize { //~ NOTE expected `isize` because of return type
     (return 1, return 2)
 //~^ ERROR mismatched types
-//~| expected type `isize`
-//~| found tuple `(!, !)`
-//~| expected `isize`, found `(!, !)`
+//~| NOTE expected type `isize`
+//~| NOTE found tuple `(!, !)`
+//~| NOTE expected `isize`, found `(!, !)`
 }
 
 fn main() {}
diff --git a/tests/ui/noexporttypeexe.rs b/tests/ui/noexporttypeexe.rs
index 6b4402a..35257b2 100644
--- a/tests/ui/noexporttypeexe.rs
+++ b/tests/ui/noexporttypeexe.rs
@@ -9,7 +9,8 @@ fn main() {
     // not convertible to a path.
   let x: isize = noexporttypelib::foo();
     //~^ ERROR mismatched types
-    //~| expected type `isize`
-    //~| found enum `Option<isize>`
-    //~| expected `isize`, found `Option<isize>`
+    //~| NOTE expected type `isize`
+    //~| NOTE found enum `Option<isize>`
+    //~| NOTE expected `isize`, found `Option<isize>`
+    //~| NOTE expected due to this
 }
diff --git a/tests/ui/noncopyable-class.rs b/tests/ui/noncopyable-class.rs
deleted file mode 100644
index 11b6eb7..0000000
--- a/tests/ui/noncopyable-class.rs
+++ /dev/null
@@ -1,36 +0,0 @@
-// Test that a class with a non-copyable field can't be
-// copied
-
-#[derive(Debug)]
-struct Bar {
-  x: isize,
-}
-
-impl Drop for Bar {
-    fn drop(&mut self) {}
-}
-
-fn bar(x:isize) -> Bar {
-    Bar {
-        x: x
-    }
-}
-
-#[derive(Debug)]
-struct Foo {
-  i: isize,
-  j: Bar,
-}
-
-fn foo(i:isize) -> Foo {
-    Foo {
-        i: i,
-        j: bar(5)
-    }
-}
-
-fn main() {
-    let x = foo(10);
-    let _y = x.clone(); //~ ERROR no method named `clone` found
-    println!("{:?}", x);
-}
diff --git a/tests/ui/noncopyable-class.stderr b/tests/ui/noncopyable-class.stderr
deleted file mode 100644
index b8f7276..0000000
--- a/tests/ui/noncopyable-class.stderr
+++ /dev/null
@@ -1,16 +0,0 @@
-error[E0599]: no method named `clone` found for struct `Foo` in the current scope
-  --> $DIR/noncopyable-class.rs:34:16
-   |
-LL | struct Foo {
-   | ---------- method `clone` not found for this struct
-...
-LL |     let _y = x.clone();
-   |                ^^^^^ method not found in `Foo`
-   |
-   = help: items from traits can only be used if the trait is implemented and in scope
-   = note: the following trait defines an item `clone`, perhaps you need to implement it:
-           candidate #1: `Clone`
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/numeric/integer-literal-suffix-inference.rs b/tests/ui/numeric/integer-literal-suffix-inference.rs
index c320f2b..775e374 100644
--- a/tests/ui/numeric/integer-literal-suffix-inference.rs
+++ b/tests/ui/numeric/integer-literal-suffix-inference.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 fn main() {
 
     // the smallest positive values that need these types
@@ -37,184 +39,184 @@ fn id_usize(n: usize) -> usize { n }
     id_i8(a8); // ok
     id_i8(a16);
     //~^ ERROR mismatched types
-    //~| expected `i8`, found `i16`
+    //~| NOTE expected `i8`, found `i16`
     id_i8(a32);
     //~^ ERROR mismatched types
-    //~| expected `i8`, found `i32`
+    //~| NOTE expected `i8`, found `i32`
     id_i8(a64);
     //~^ ERROR mismatched types
-    //~| expected `i8`, found `i64`
+    //~| NOTE expected `i8`, found `i64`
     id_i8(asize);
     //~^ ERROR mismatched types
-    //~| expected `i8`, found `isize`
+    //~| NOTE expected `i8`, found `isize`
 
     id_i16(a8);
     //~^ ERROR mismatched types
-    //~| expected `i16`, found `i8`
+    //~| NOTE expected `i16`, found `i8`
     id_i16(a16); // ok
     id_i16(a32);
     //~^ ERROR mismatched types
-    //~| expected `i16`, found `i32`
+    //~| NOTE expected `i16`, found `i32`
     id_i16(a64);
     //~^ ERROR mismatched types
-    //~| expected `i16`, found `i64`
+    //~| NOTE expected `i16`, found `i64`
     id_i16(asize);
     //~^ ERROR mismatched types
-    //~| expected `i16`, found `isize`
+    //~| NOTE expected `i16`, found `isize`
 
     id_i32(a8);
     //~^ ERROR mismatched types
-    //~| expected `i32`, found `i8`
+    //~| NOTE expected `i32`, found `i8`
     id_i32(a16);
     //~^ ERROR mismatched types
-    //~| expected `i32`, found `i16`
+    //~| NOTE expected `i32`, found `i16`
     id_i32(a32); // ok
     id_i32(a64);
     //~^ ERROR mismatched types
-    //~| expected `i32`, found `i64`
+    //~| NOTE expected `i32`, found `i64`
     id_i32(asize);
     //~^ ERROR mismatched types
-    //~| expected `i32`, found `isize`
+    //~| NOTE expected `i32`, found `isize`
 
     id_i64(a8);
     //~^ ERROR mismatched types
-    //~| expected `i64`, found `i8`
+    //~| NOTE expected `i64`, found `i8`
     id_i64(a16);
     //~^ ERROR mismatched types
-    //~| expected `i64`, found `i16`
+    //~| NOTE expected `i64`, found `i16`
     id_i64(a32);
     //~^ ERROR mismatched types
-    //~| expected `i64`, found `i32`
+    //~| NOTE expected `i64`, found `i32`
     id_i64(a64); // ok
     id_i64(asize);
     //~^ ERROR mismatched types
-    //~| expected `i64`, found `isize`
+    //~| NOTE expected `i64`, found `isize`
 
     id_isize(a8);
     //~^ ERROR mismatched types
-    //~| expected `isize`, found `i8`
+    //~| NOTE expected `isize`, found `i8`
     id_isize(a16);
     //~^ ERROR mismatched types
-    //~| expected `isize`, found `i16`
+    //~| NOTE expected `isize`, found `i16`
     id_isize(a32);
     //~^ ERROR mismatched types
-    //~| expected `isize`, found `i32`
+    //~| NOTE expected `isize`, found `i32`
     id_isize(a64);
     //~^ ERROR mismatched types
-    //~| expected `isize`, found `i64`
+    //~| NOTE expected `isize`, found `i64`
     id_isize(asize); //ok
 
     id_i8(c8); // ok
     id_i8(c16);
     //~^ ERROR mismatched types
-    //~| expected `i8`, found `i16`
+    //~| NOTE expected `i8`, found `i16`
     id_i8(c32);
     //~^ ERROR mismatched types
-    //~| expected `i8`, found `i32`
+    //~| NOTE expected `i8`, found `i32`
     id_i8(c64);
     //~^ ERROR mismatched types
-    //~| expected `i8`, found `i64`
+    //~| NOTE expected `i8`, found `i64`
 
     id_i16(c8);
     //~^ ERROR mismatched types
-    //~| expected `i16`, found `i8`
+    //~| NOTE expected `i16`, found `i8`
     id_i16(c16); // ok
     id_i16(c32);
     //~^ ERROR mismatched types
-    //~| expected `i16`, found `i32`
+    //~| NOTE expected `i16`, found `i32`
     id_i16(c64);
     //~^ ERROR mismatched types
-    //~| expected `i16`, found `i64`
+    //~| NOTE expected `i16`, found `i64`
 
     id_i32(c8);
     //~^ ERROR mismatched types
-    //~| expected `i32`, found `i8`
+    //~| NOTE expected `i32`, found `i8`
     id_i32(c16);
     //~^ ERROR mismatched types
-    //~| expected `i32`, found `i16`
+    //~| NOTE expected `i32`, found `i16`
     id_i32(c32); // ok
     id_i32(c64);
     //~^ ERROR mismatched types
-    //~| expected `i32`, found `i64`
+    //~| NOTE expected `i32`, found `i64`
 
     id_i64(a8);
     //~^ ERROR mismatched types
-    //~| expected `i64`, found `i8`
+    //~| NOTE expected `i64`, found `i8`
     id_i64(a16);
     //~^ ERROR mismatched types
-    //~| expected `i64`, found `i16`
+    //~| NOTE expected `i64`, found `i16`
     id_i64(a32);
     //~^ ERROR mismatched types
-    //~| expected `i64`, found `i32`
+    //~| NOTE expected `i64`, found `i32`
     id_i64(a64); // ok
 
     id_u8(b8); // ok
     id_u8(b16);
     //~^ ERROR mismatched types
-    //~| expected `u8`, found `u16`
+    //~| NOTE expected `u8`, found `u16`
     id_u8(b32);
     //~^ ERROR mismatched types
-    //~| expected `u8`, found `u32`
+    //~| NOTE expected `u8`, found `u32`
     id_u8(b64);
     //~^ ERROR mismatched types
-    //~| expected `u8`, found `u64`
+    //~| NOTE expected `u8`, found `u64`
     id_u8(bsize);
     //~^ ERROR mismatched types
-    //~| expected `u8`, found `usize`
+    //~| NOTE expected `u8`, found `usize`
 
     id_u16(b8);
     //~^ ERROR mismatched types
-    //~| expected `u16`, found `u8`
+    //~| NOTE expected `u16`, found `u8`
     id_u16(b16); // ok
     id_u16(b32);
     //~^ ERROR mismatched types
-    //~| expected `u16`, found `u32`
+    //~| NOTE expected `u16`, found `u32`
     id_u16(b64);
     //~^ ERROR mismatched types
-    //~| expected `u16`, found `u64`
+    //~| NOTE expected `u16`, found `u64`
     id_u16(bsize);
     //~^ ERROR mismatched types
-    //~| expected `u16`, found `usize`
+    //~| NOTE expected `u16`, found `usize`
 
     id_u32(b8);
     //~^ ERROR mismatched types
-    //~| expected `u32`, found `u8`
+    //~| NOTE expected `u32`, found `u8`
     id_u32(b16);
     //~^ ERROR mismatched types
-    //~| expected `u32`, found `u16`
+    //~| NOTE expected `u32`, found `u16`
     id_u32(b32); // ok
     id_u32(b64);
     //~^ ERROR mismatched types
-    //~| expected `u32`, found `u64`
+    //~| NOTE expected `u32`, found `u64`
     id_u32(bsize);
     //~^ ERROR mismatched types
-    //~| expected `u32`, found `usize`
+    //~| NOTE expected `u32`, found `usize`
 
     id_u64(b8);
     //~^ ERROR mismatched types
-    //~| expected `u64`, found `u8`
+    //~| NOTE expected `u64`, found `u8`
     id_u64(b16);
     //~^ ERROR mismatched types
-    //~| expected `u64`, found `u16`
+    //~| NOTE expected `u64`, found `u16`
     id_u64(b32);
     //~^ ERROR mismatched types
-    //~| expected `u64`, found `u32`
+    //~| NOTE expected `u64`, found `u32`
     id_u64(b64); // ok
     id_u64(bsize);
     //~^ ERROR mismatched types
-    //~| expected `u64`, found `usize`
+    //~| NOTE expected `u64`, found `usize`
 
     id_usize(b8);
     //~^ ERROR mismatched types
-    //~| expected `usize`, found `u8`
+    //~| NOTE expected `usize`, found `u8`
     id_usize(b16);
     //~^ ERROR mismatched types
-    //~| expected `usize`, found `u16`
+    //~| NOTE expected `usize`, found `u16`
     id_usize(b32);
     //~^ ERROR mismatched types
-    //~| expected `usize`, found `u32`
+    //~| NOTE expected `usize`, found `u32`
     id_usize(b64);
     //~^ ERROR mismatched types
-    //~| expected `usize`, found `u64`
+    //~| NOTE expected `usize`, found `u64`
     id_usize(bsize); //ok
 }
diff --git a/tests/ui/numeric/integer-literal-suffix-inference.stderr b/tests/ui/numeric/integer-literal-suffix-inference.stderr
index 5045f58..30232e4 100644
--- a/tests/ui/numeric/integer-literal-suffix-inference.stderr
+++ b/tests/ui/numeric/integer-literal-suffix-inference.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:38:11
+  --> $DIR/integer-literal-suffix-inference.rs:40:11
    |
 LL |     id_i8(a16);
    |     ----- ^^^ expected `i8`, found `i16`
@@ -7,7 +7,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:15:8
+  --> $DIR/integer-literal-suffix-inference.rs:17:8
    |
 LL |     fn id_i8(n: i8) -> i8 { n }
    |        ^^^^^ -----
@@ -17,7 +17,7 @@
    |              ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:41:11
+  --> $DIR/integer-literal-suffix-inference.rs:43:11
    |
 LL |     id_i8(a32);
    |     ----- ^^^ expected `i8`, found `i32`
@@ -25,7 +25,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:15:8
+  --> $DIR/integer-literal-suffix-inference.rs:17:8
    |
 LL |     fn id_i8(n: i8) -> i8 { n }
    |        ^^^^^ -----
@@ -35,7 +35,7 @@
    |              ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:44:11
+  --> $DIR/integer-literal-suffix-inference.rs:46:11
    |
 LL |     id_i8(a64);
    |     ----- ^^^ expected `i8`, found `i64`
@@ -43,7 +43,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:15:8
+  --> $DIR/integer-literal-suffix-inference.rs:17:8
    |
 LL |     fn id_i8(n: i8) -> i8 { n }
    |        ^^^^^ -----
@@ -53,7 +53,7 @@
    |              ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:47:11
+  --> $DIR/integer-literal-suffix-inference.rs:49:11
    |
 LL |     id_i8(asize);
    |     ----- ^^^^^ expected `i8`, found `isize`
@@ -61,7 +61,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:15:8
+  --> $DIR/integer-literal-suffix-inference.rs:17:8
    |
 LL |     fn id_i8(n: i8) -> i8 { n }
    |        ^^^^^ -----
@@ -71,7 +71,7 @@
    |                ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:51:12
+  --> $DIR/integer-literal-suffix-inference.rs:53:12
    |
 LL |     id_i16(a8);
    |     ------ ^^ expected `i16`, found `i8`
@@ -79,7 +79,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:16:8
+  --> $DIR/integer-literal-suffix-inference.rs:18:8
    |
 LL |     fn id_i16(n: i16) -> i16 { n }
    |        ^^^^^^ ------
@@ -89,7 +89,7 @@
    |              +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:55:12
+  --> $DIR/integer-literal-suffix-inference.rs:57:12
    |
 LL |     id_i16(a32);
    |     ------ ^^^ expected `i16`, found `i32`
@@ -97,7 +97,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:16:8
+  --> $DIR/integer-literal-suffix-inference.rs:18:8
    |
 LL |     fn id_i16(n: i16) -> i16 { n }
    |        ^^^^^^ ------
@@ -107,7 +107,7 @@
    |               ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:58:12
+  --> $DIR/integer-literal-suffix-inference.rs:60:12
    |
 LL |     id_i16(a64);
    |     ------ ^^^ expected `i16`, found `i64`
@@ -115,7 +115,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:16:8
+  --> $DIR/integer-literal-suffix-inference.rs:18:8
    |
 LL |     fn id_i16(n: i16) -> i16 { n }
    |        ^^^^^^ ------
@@ -125,7 +125,7 @@
    |               ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:61:12
+  --> $DIR/integer-literal-suffix-inference.rs:63:12
    |
 LL |     id_i16(asize);
    |     ------ ^^^^^ expected `i16`, found `isize`
@@ -133,7 +133,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:16:8
+  --> $DIR/integer-literal-suffix-inference.rs:18:8
    |
 LL |     fn id_i16(n: i16) -> i16 { n }
    |        ^^^^^^ ------
@@ -143,7 +143,7 @@
    |                 ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:65:12
+  --> $DIR/integer-literal-suffix-inference.rs:67:12
    |
 LL |     id_i32(a8);
    |     ------ ^^ expected `i32`, found `i8`
@@ -151,7 +151,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:17:8
+  --> $DIR/integer-literal-suffix-inference.rs:19:8
    |
 LL |     fn id_i32(n: i32) -> i32 { n }
    |        ^^^^^^ ------
@@ -161,7 +161,7 @@
    |              +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:68:12
+  --> $DIR/integer-literal-suffix-inference.rs:70:12
    |
 LL |     id_i32(a16);
    |     ------ ^^^ expected `i32`, found `i16`
@@ -169,7 +169,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:17:8
+  --> $DIR/integer-literal-suffix-inference.rs:19:8
    |
 LL |     fn id_i32(n: i32) -> i32 { n }
    |        ^^^^^^ ------
@@ -179,7 +179,7 @@
    |               +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:72:12
+  --> $DIR/integer-literal-suffix-inference.rs:74:12
    |
 LL |     id_i32(a64);
    |     ------ ^^^ expected `i32`, found `i64`
@@ -187,7 +187,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:17:8
+  --> $DIR/integer-literal-suffix-inference.rs:19:8
    |
 LL |     fn id_i32(n: i32) -> i32 { n }
    |        ^^^^^^ ------
@@ -197,7 +197,7 @@
    |               ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:75:12
+  --> $DIR/integer-literal-suffix-inference.rs:77:12
    |
 LL |     id_i32(asize);
    |     ------ ^^^^^ expected `i32`, found `isize`
@@ -205,7 +205,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:17:8
+  --> $DIR/integer-literal-suffix-inference.rs:19:8
    |
 LL |     fn id_i32(n: i32) -> i32 { n }
    |        ^^^^^^ ------
@@ -215,7 +215,7 @@
    |                 ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:79:12
+  --> $DIR/integer-literal-suffix-inference.rs:81:12
    |
 LL |     id_i64(a8);
    |     ------ ^^ expected `i64`, found `i8`
@@ -223,7 +223,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:18:8
+  --> $DIR/integer-literal-suffix-inference.rs:20:8
    |
 LL |     fn id_i64(n: i64) -> i64 { n }
    |        ^^^^^^ ------
@@ -233,7 +233,7 @@
    |              +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:82:12
+  --> $DIR/integer-literal-suffix-inference.rs:84:12
    |
 LL |     id_i64(a16);
    |     ------ ^^^ expected `i64`, found `i16`
@@ -241,7 +241,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:18:8
+  --> $DIR/integer-literal-suffix-inference.rs:20:8
    |
 LL |     fn id_i64(n: i64) -> i64 { n }
    |        ^^^^^^ ------
@@ -251,7 +251,7 @@
    |               +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:85:12
+  --> $DIR/integer-literal-suffix-inference.rs:87:12
    |
 LL |     id_i64(a32);
    |     ------ ^^^ expected `i64`, found `i32`
@@ -259,7 +259,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:18:8
+  --> $DIR/integer-literal-suffix-inference.rs:20:8
    |
 LL |     fn id_i64(n: i64) -> i64 { n }
    |        ^^^^^^ ------
@@ -269,7 +269,7 @@
    |               +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:89:12
+  --> $DIR/integer-literal-suffix-inference.rs:91:12
    |
 LL |     id_i64(asize);
    |     ------ ^^^^^ expected `i64`, found `isize`
@@ -277,7 +277,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:18:8
+  --> $DIR/integer-literal-suffix-inference.rs:20:8
    |
 LL |     fn id_i64(n: i64) -> i64 { n }
    |        ^^^^^^ ------
@@ -287,7 +287,7 @@
    |                 ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:93:14
+  --> $DIR/integer-literal-suffix-inference.rs:95:14
    |
 LL |     id_isize(a8);
    |     -------- ^^ expected `isize`, found `i8`
@@ -295,7 +295,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:19:8
+  --> $DIR/integer-literal-suffix-inference.rs:21:8
    |
 LL |     fn id_isize(n: isize) -> isize { n }
    |        ^^^^^^^^ --------
@@ -305,7 +305,7 @@
    |                +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:96:14
+  --> $DIR/integer-literal-suffix-inference.rs:98:14
    |
 LL |     id_isize(a16);
    |     -------- ^^^ expected `isize`, found `i16`
@@ -313,7 +313,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:19:8
+  --> $DIR/integer-literal-suffix-inference.rs:21:8
    |
 LL |     fn id_isize(n: isize) -> isize { n }
    |        ^^^^^^^^ --------
@@ -323,7 +323,7 @@
    |                 +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:99:14
+  --> $DIR/integer-literal-suffix-inference.rs:101:14
    |
 LL |     id_isize(a32);
    |     -------- ^^^ expected `isize`, found `i32`
@@ -331,7 +331,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:19:8
+  --> $DIR/integer-literal-suffix-inference.rs:21:8
    |
 LL |     fn id_isize(n: isize) -> isize { n }
    |        ^^^^^^^^ --------
@@ -341,7 +341,7 @@
    |                 ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:102:14
+  --> $DIR/integer-literal-suffix-inference.rs:104:14
    |
 LL |     id_isize(a64);
    |     -------- ^^^ expected `isize`, found `i64`
@@ -349,7 +349,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:19:8
+  --> $DIR/integer-literal-suffix-inference.rs:21:8
    |
 LL |     fn id_isize(n: isize) -> isize { n }
    |        ^^^^^^^^ --------
@@ -359,7 +359,7 @@
    |                 ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:108:11
+  --> $DIR/integer-literal-suffix-inference.rs:110:11
    |
 LL |     id_i8(c16);
    |     ----- ^^^ expected `i8`, found `i16`
@@ -367,7 +367,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:15:8
+  --> $DIR/integer-literal-suffix-inference.rs:17:8
    |
 LL |     fn id_i8(n: i8) -> i8 { n }
    |        ^^^^^ -----
@@ -377,7 +377,7 @@
    |              ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:111:11
+  --> $DIR/integer-literal-suffix-inference.rs:113:11
    |
 LL |     id_i8(c32);
    |     ----- ^^^ expected `i8`, found `i32`
@@ -385,7 +385,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:15:8
+  --> $DIR/integer-literal-suffix-inference.rs:17:8
    |
 LL |     fn id_i8(n: i8) -> i8 { n }
    |        ^^^^^ -----
@@ -395,7 +395,7 @@
    |              ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:114:11
+  --> $DIR/integer-literal-suffix-inference.rs:116:11
    |
 LL |     id_i8(c64);
    |     ----- ^^^ expected `i8`, found `i64`
@@ -403,7 +403,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:15:8
+  --> $DIR/integer-literal-suffix-inference.rs:17:8
    |
 LL |     fn id_i8(n: i8) -> i8 { n }
    |        ^^^^^ -----
@@ -413,7 +413,7 @@
    |              ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:118:12
+  --> $DIR/integer-literal-suffix-inference.rs:120:12
    |
 LL |     id_i16(c8);
    |     ------ ^^ expected `i16`, found `i8`
@@ -421,7 +421,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:16:8
+  --> $DIR/integer-literal-suffix-inference.rs:18:8
    |
 LL |     fn id_i16(n: i16) -> i16 { n }
    |        ^^^^^^ ------
@@ -431,7 +431,7 @@
    |              +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:122:12
+  --> $DIR/integer-literal-suffix-inference.rs:124:12
    |
 LL |     id_i16(c32);
    |     ------ ^^^ expected `i16`, found `i32`
@@ -439,7 +439,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:16:8
+  --> $DIR/integer-literal-suffix-inference.rs:18:8
    |
 LL |     fn id_i16(n: i16) -> i16 { n }
    |        ^^^^^^ ------
@@ -449,7 +449,7 @@
    |               ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:125:12
+  --> $DIR/integer-literal-suffix-inference.rs:127:12
    |
 LL |     id_i16(c64);
    |     ------ ^^^ expected `i16`, found `i64`
@@ -457,7 +457,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:16:8
+  --> $DIR/integer-literal-suffix-inference.rs:18:8
    |
 LL |     fn id_i16(n: i16) -> i16 { n }
    |        ^^^^^^ ------
@@ -467,7 +467,7 @@
    |               ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:129:12
+  --> $DIR/integer-literal-suffix-inference.rs:131:12
    |
 LL |     id_i32(c8);
    |     ------ ^^ expected `i32`, found `i8`
@@ -475,7 +475,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:17:8
+  --> $DIR/integer-literal-suffix-inference.rs:19:8
    |
 LL |     fn id_i32(n: i32) -> i32 { n }
    |        ^^^^^^ ------
@@ -485,7 +485,7 @@
    |              +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:132:12
+  --> $DIR/integer-literal-suffix-inference.rs:134:12
    |
 LL |     id_i32(c16);
    |     ------ ^^^ expected `i32`, found `i16`
@@ -493,7 +493,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:17:8
+  --> $DIR/integer-literal-suffix-inference.rs:19:8
    |
 LL |     fn id_i32(n: i32) -> i32 { n }
    |        ^^^^^^ ------
@@ -503,7 +503,7 @@
    |               +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:136:12
+  --> $DIR/integer-literal-suffix-inference.rs:138:12
    |
 LL |     id_i32(c64);
    |     ------ ^^^ expected `i32`, found `i64`
@@ -511,7 +511,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:17:8
+  --> $DIR/integer-literal-suffix-inference.rs:19:8
    |
 LL |     fn id_i32(n: i32) -> i32 { n }
    |        ^^^^^^ ------
@@ -521,7 +521,7 @@
    |               ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:140:12
+  --> $DIR/integer-literal-suffix-inference.rs:142:12
    |
 LL |     id_i64(a8);
    |     ------ ^^ expected `i64`, found `i8`
@@ -529,7 +529,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:18:8
+  --> $DIR/integer-literal-suffix-inference.rs:20:8
    |
 LL |     fn id_i64(n: i64) -> i64 { n }
    |        ^^^^^^ ------
@@ -539,7 +539,7 @@
    |              +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:143:12
+  --> $DIR/integer-literal-suffix-inference.rs:145:12
    |
 LL |     id_i64(a16);
    |     ------ ^^^ expected `i64`, found `i16`
@@ -547,7 +547,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:18:8
+  --> $DIR/integer-literal-suffix-inference.rs:20:8
    |
 LL |     fn id_i64(n: i64) -> i64 { n }
    |        ^^^^^^ ------
@@ -557,7 +557,7 @@
    |               +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:146:12
+  --> $DIR/integer-literal-suffix-inference.rs:148:12
    |
 LL |     id_i64(a32);
    |     ------ ^^^ expected `i64`, found `i32`
@@ -565,7 +565,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:18:8
+  --> $DIR/integer-literal-suffix-inference.rs:20:8
    |
 LL |     fn id_i64(n: i64) -> i64 { n }
    |        ^^^^^^ ------
@@ -575,7 +575,7 @@
    |               +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:152:11
+  --> $DIR/integer-literal-suffix-inference.rs:154:11
    |
 LL |     id_u8(b16);
    |     ----- ^^^ expected `u8`, found `u16`
@@ -583,7 +583,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:27:8
+  --> $DIR/integer-literal-suffix-inference.rs:29:8
    |
 LL |     fn id_u8(n: u8) -> u8 { n }
    |        ^^^^^ -----
@@ -593,7 +593,7 @@
    |              ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:155:11
+  --> $DIR/integer-literal-suffix-inference.rs:157:11
    |
 LL |     id_u8(b32);
    |     ----- ^^^ expected `u8`, found `u32`
@@ -601,7 +601,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:27:8
+  --> $DIR/integer-literal-suffix-inference.rs:29:8
    |
 LL |     fn id_u8(n: u8) -> u8 { n }
    |        ^^^^^ -----
@@ -611,7 +611,7 @@
    |              ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:158:11
+  --> $DIR/integer-literal-suffix-inference.rs:160:11
    |
 LL |     id_u8(b64);
    |     ----- ^^^ expected `u8`, found `u64`
@@ -619,7 +619,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:27:8
+  --> $DIR/integer-literal-suffix-inference.rs:29:8
    |
 LL |     fn id_u8(n: u8) -> u8 { n }
    |        ^^^^^ -----
@@ -629,7 +629,7 @@
    |              ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:161:11
+  --> $DIR/integer-literal-suffix-inference.rs:163:11
    |
 LL |     id_u8(bsize);
    |     ----- ^^^^^ expected `u8`, found `usize`
@@ -637,7 +637,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:27:8
+  --> $DIR/integer-literal-suffix-inference.rs:29:8
    |
 LL |     fn id_u8(n: u8) -> u8 { n }
    |        ^^^^^ -----
@@ -647,7 +647,7 @@
    |                ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:165:12
+  --> $DIR/integer-literal-suffix-inference.rs:167:12
    |
 LL |     id_u16(b8);
    |     ------ ^^ expected `u16`, found `u8`
@@ -655,7 +655,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:28:8
+  --> $DIR/integer-literal-suffix-inference.rs:30:8
    |
 LL |     fn id_u16(n: u16) -> u16 { n }
    |        ^^^^^^ ------
@@ -665,7 +665,7 @@
    |              +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:169:12
+  --> $DIR/integer-literal-suffix-inference.rs:171:12
    |
 LL |     id_u16(b32);
    |     ------ ^^^ expected `u16`, found `u32`
@@ -673,7 +673,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:28:8
+  --> $DIR/integer-literal-suffix-inference.rs:30:8
    |
 LL |     fn id_u16(n: u16) -> u16 { n }
    |        ^^^^^^ ------
@@ -683,7 +683,7 @@
    |               ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:172:12
+  --> $DIR/integer-literal-suffix-inference.rs:174:12
    |
 LL |     id_u16(b64);
    |     ------ ^^^ expected `u16`, found `u64`
@@ -691,7 +691,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:28:8
+  --> $DIR/integer-literal-suffix-inference.rs:30:8
    |
 LL |     fn id_u16(n: u16) -> u16 { n }
    |        ^^^^^^ ------
@@ -701,7 +701,7 @@
    |               ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:175:12
+  --> $DIR/integer-literal-suffix-inference.rs:177:12
    |
 LL |     id_u16(bsize);
    |     ------ ^^^^^ expected `u16`, found `usize`
@@ -709,7 +709,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:28:8
+  --> $DIR/integer-literal-suffix-inference.rs:30:8
    |
 LL |     fn id_u16(n: u16) -> u16 { n }
    |        ^^^^^^ ------
@@ -719,7 +719,7 @@
    |                 ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:179:12
+  --> $DIR/integer-literal-suffix-inference.rs:181:12
    |
 LL |     id_u32(b8);
    |     ------ ^^ expected `u32`, found `u8`
@@ -727,7 +727,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:29:8
+  --> $DIR/integer-literal-suffix-inference.rs:31:8
    |
 LL |     fn id_u32(n: u32) -> u32 { n }
    |        ^^^^^^ ------
@@ -737,7 +737,7 @@
    |              +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:182:12
+  --> $DIR/integer-literal-suffix-inference.rs:184:12
    |
 LL |     id_u32(b16);
    |     ------ ^^^ expected `u32`, found `u16`
@@ -745,7 +745,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:29:8
+  --> $DIR/integer-literal-suffix-inference.rs:31:8
    |
 LL |     fn id_u32(n: u32) -> u32 { n }
    |        ^^^^^^ ------
@@ -755,7 +755,7 @@
    |               +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:186:12
+  --> $DIR/integer-literal-suffix-inference.rs:188:12
    |
 LL |     id_u32(b64);
    |     ------ ^^^ expected `u32`, found `u64`
@@ -763,7 +763,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:29:8
+  --> $DIR/integer-literal-suffix-inference.rs:31:8
    |
 LL |     fn id_u32(n: u32) -> u32 { n }
    |        ^^^^^^ ------
@@ -773,7 +773,7 @@
    |               ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:189:12
+  --> $DIR/integer-literal-suffix-inference.rs:191:12
    |
 LL |     id_u32(bsize);
    |     ------ ^^^^^ expected `u32`, found `usize`
@@ -781,7 +781,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:29:8
+  --> $DIR/integer-literal-suffix-inference.rs:31:8
    |
 LL |     fn id_u32(n: u32) -> u32 { n }
    |        ^^^^^^ ------
@@ -791,7 +791,7 @@
    |                 ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:193:12
+  --> $DIR/integer-literal-suffix-inference.rs:195:12
    |
 LL |     id_u64(b8);
    |     ------ ^^ expected `u64`, found `u8`
@@ -799,7 +799,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:30:8
+  --> $DIR/integer-literal-suffix-inference.rs:32:8
    |
 LL |     fn id_u64(n: u64) -> u64 { n }
    |        ^^^^^^ ------
@@ -809,7 +809,7 @@
    |              +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:196:12
+  --> $DIR/integer-literal-suffix-inference.rs:198:12
    |
 LL |     id_u64(b16);
    |     ------ ^^^ expected `u64`, found `u16`
@@ -817,7 +817,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:30:8
+  --> $DIR/integer-literal-suffix-inference.rs:32:8
    |
 LL |     fn id_u64(n: u64) -> u64 { n }
    |        ^^^^^^ ------
@@ -827,7 +827,7 @@
    |               +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:199:12
+  --> $DIR/integer-literal-suffix-inference.rs:201:12
    |
 LL |     id_u64(b32);
    |     ------ ^^^ expected `u64`, found `u32`
@@ -835,7 +835,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:30:8
+  --> $DIR/integer-literal-suffix-inference.rs:32:8
    |
 LL |     fn id_u64(n: u64) -> u64 { n }
    |        ^^^^^^ ------
@@ -845,7 +845,7 @@
    |               +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:203:12
+  --> $DIR/integer-literal-suffix-inference.rs:205:12
    |
 LL |     id_u64(bsize);
    |     ------ ^^^^^ expected `u64`, found `usize`
@@ -853,7 +853,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:30:8
+  --> $DIR/integer-literal-suffix-inference.rs:32:8
    |
 LL |     fn id_u64(n: u64) -> u64 { n }
    |        ^^^^^^ ------
@@ -863,7 +863,7 @@
    |                 ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:207:14
+  --> $DIR/integer-literal-suffix-inference.rs:209:14
    |
 LL |     id_usize(b8);
    |     -------- ^^ expected `usize`, found `u8`
@@ -871,7 +871,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:31:8
+  --> $DIR/integer-literal-suffix-inference.rs:33:8
    |
 LL |     fn id_usize(n: usize) -> usize { n }
    |        ^^^^^^^^ --------
@@ -881,7 +881,7 @@
    |                +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:210:14
+  --> $DIR/integer-literal-suffix-inference.rs:212:14
    |
 LL |     id_usize(b16);
    |     -------- ^^^ expected `usize`, found `u16`
@@ -889,7 +889,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:31:8
+  --> $DIR/integer-literal-suffix-inference.rs:33:8
    |
 LL |     fn id_usize(n: usize) -> usize { n }
    |        ^^^^^^^^ --------
@@ -899,7 +899,7 @@
    |                 +++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:213:14
+  --> $DIR/integer-literal-suffix-inference.rs:215:14
    |
 LL |     id_usize(b32);
    |     -------- ^^^ expected `usize`, found `u32`
@@ -907,7 +907,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:31:8
+  --> $DIR/integer-literal-suffix-inference.rs:33:8
    |
 LL |     fn id_usize(n: usize) -> usize { n }
    |        ^^^^^^^^ --------
@@ -917,7 +917,7 @@
    |                 ++++++++++++++++++++
 
 error[E0308]: mismatched types
-  --> $DIR/integer-literal-suffix-inference.rs:216:14
+  --> $DIR/integer-literal-suffix-inference.rs:218:14
    |
 LL |     id_usize(b64);
    |     -------- ^^^ expected `usize`, found `u64`
@@ -925,7 +925,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/integer-literal-suffix-inference.rs:31:8
+  --> $DIR/integer-literal-suffix-inference.rs:33:8
    |
 LL |     fn id_usize(n: usize) -> usize { n }
    |        ^^^^^^^^ --------
diff --git a/tests/ui/on-unimplemented/expected-comma-found-token.rs b/tests/ui/on-unimplemented/expected-comma-found-token.rs
index 8fb34f2..d60ab33 100644
--- a/tests/ui/on-unimplemented/expected-comma-found-token.rs
+++ b/tests/ui/on-unimplemented/expected-comma-found-token.rs
@@ -1,7 +1,6 @@
-// Tests that two closures cannot simultaneously have mutable
-// access to the variable, whether that mutable access be used
-// for direct assignment or for taking mutable ref. Issue #6801.
+//! Test for invalid MetaItem syntax in the attribute
 
+#![crate_type = "lib"]
 #![feature(rustc_attrs)]
 
 #[rustc_on_unimplemented(
@@ -9,5 +8,3 @@
     label="the label" //~ ERROR expected `,`, found `label`
 )]
 trait T {}
-
-fn main() {  }
diff --git a/tests/ui/on-unimplemented/expected-comma-found-token.stderr b/tests/ui/on-unimplemented/expected-comma-found-token.stderr
index 7c0874e..2717100 100644
--- a/tests/ui/on-unimplemented/expected-comma-found-token.stderr
+++ b/tests/ui/on-unimplemented/expected-comma-found-token.stderr
@@ -1,5 +1,5 @@
 error: expected `,`, found `label`
-  --> $DIR/expected-comma-found-token.rs:9:5
+  --> $DIR/expected-comma-found-token.rs:8:5
    |
 LL |     message="the message"
    |                          - expected `,`
diff --git a/tests/ui/panic-handler/panic-handler-wrong-location.rs b/tests/ui/panic-handler/panic-handler-wrong-location.rs
index c91580a..8fff706 100644
--- a/tests/ui/panic-handler/panic-handler-wrong-location.rs
+++ b/tests/ui/panic-handler/panic-handler-wrong-location.rs
@@ -4,7 +4,6 @@
 #![no_main]
 
 #[panic_handler] //~ ERROR `panic_impl` lang item must be applied to a function
-#[no_mangle]
 static X: u32 = 42;
 
 //~? ERROR `#[panic_handler]` function required, but not found
diff --git a/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs b/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs
index 47df107..6bfe16a 100644
--- a/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs
+++ b/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs
@@ -1,7 +1,9 @@
+//@ dont-require-annotations: NOTE
+
 fn main() {
     unsafe {
         dealloc(ptr2, Layout::(x: !)(1, 1)); //~ ERROR: expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `:`
         //~^ ERROR: expected one of `.`, `;`, `?`, `}`, or an operator, found `)`
-        //~| while parsing this parenthesized list of type arguments starting here
+        //~| NOTE while parsing this parenthesized list of type arguments starting here
     }
 }
diff --git a/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.stderr b/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.stderr
index 8067c97..c12bf7f 100644
--- a/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.stderr
+++ b/tests/ui/parser/diagnostics-parenthesized-type-arguments-ice-issue-122345.stderr
@@ -1,5 +1,5 @@
 error: expected one of `!`, `(`, `)`, `+`, `,`, `::`, or `<`, found `:`
-  --> $DIR/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs:3:33
+  --> $DIR/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs:5:33
    |
 LL |         dealloc(ptr2, Layout::(x: !)(1, 1));
    |                             --- ^ expected one of 7 possible tokens
@@ -7,7 +7,7 @@
    |                             while parsing this parenthesized list of type arguments starting here
 
 error: expected one of `.`, `;`, `?`, `}`, or an operator, found `)`
-  --> $DIR/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs:3:43
+  --> $DIR/diagnostics-parenthesized-type-arguments-ice-issue-122345.rs:5:43
    |
 LL |         dealloc(ptr2, Layout::(x: !)(1, 1));
    |                                           ^ expected one of `.`, `;`, `?`, `}`, or an operator
diff --git a/tests/ui/parser/do-catch-suggests-try.rs b/tests/ui/parser/do-catch-suggests-try.rs
index fcd55ce..af85373 100644
--- a/tests/ui/parser/do-catch-suggests-try.rs
+++ b/tests/ui/parser/do-catch-suggests-try.rs
@@ -1,10 +1,12 @@
+//@ dont-require-annotations: NOTE
+
 #![feature(try_blocks)]
 
 fn main() {
     let _: Option<()> = do catch {};
     //~^ ERROR found removed `do catch` syntax
     //~| HELP replace with the new syntax
-    //~| following RFC #2388, the new non-placeholder syntax is `try`
+    //~| NOTE following RFC #2388, the new non-placeholder syntax is `try`
 
     let _recovery_witness: () = 1; //~ ERROR mismatched types
 }
diff --git a/tests/ui/parser/do-catch-suggests-try.stderr b/tests/ui/parser/do-catch-suggests-try.stderr
index 2eaab83..eecf588 100644
--- a/tests/ui/parser/do-catch-suggests-try.stderr
+++ b/tests/ui/parser/do-catch-suggests-try.stderr
@@ -1,5 +1,5 @@
 error: found removed `do catch` syntax
-  --> $DIR/do-catch-suggests-try.rs:4:25
+  --> $DIR/do-catch-suggests-try.rs:6:25
    |
 LL |     let _: Option<()> = do catch {};
    |                         ^^^^^^^^
@@ -12,7 +12,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/do-catch-suggests-try.rs:9:33
+  --> $DIR/do-catch-suggests-try.rs:11:33
    |
 LL |     let _recovery_witness: () = 1;
    |                            --   ^ expected `()`, found integer
diff --git a/tests/ui/parser/mut-patterns.rs b/tests/ui/parser/mut-patterns.rs
index ed33968..a2af816 100644
--- a/tests/ui/parser/mut-patterns.rs
+++ b/tests/ui/parser/mut-patterns.rs
@@ -1,6 +1,7 @@
 // Can't put mut in non-ident pattern
 
 //@ edition:2018
+//@ dont-require-annotations: HELP
 
 #![feature(box_patterns)]
 #![allow(warnings)]
@@ -13,20 +14,20 @@ pub fn main() {
 
     let mut mut x = 0;
     //~^ ERROR `mut` on a binding may not be repeated
-    //~| remove the additional `mut`s
+    //~| HELP remove the additional `mut`s
 
     let mut mut mut mut mut x = 0;
     //~^ ERROR `mut` on a binding may not be repeated
-    //~| remove the additional `mut`s
+    //~| HELP remove the additional `mut`s
 
     struct Foo { x: isize }
     let mut Foo { x: x } = Foo { x: 3 };
     //~^ ERROR `mut` must be attached to each individual binding
-    //~| add `mut` to each binding
+    //~| HELP add `mut` to each binding
 
     let mut Foo { x } = Foo { x: 3 };
     //~^ ERROR `mut` must be attached to each individual binding
-    //~| add `mut` to each binding
+    //~| HELP add `mut` to each binding
 
     struct r#yield(u8, u8);
     let mut mut yield(become, await) = r#yield(0, 0);
diff --git a/tests/ui/parser/mut-patterns.stderr b/tests/ui/parser/mut-patterns.stderr
index 9dda249..7009998 100644
--- a/tests/ui/parser/mut-patterns.stderr
+++ b/tests/ui/parser/mut-patterns.stderr
@@ -1,5 +1,5 @@
 error: `mut` must be followed by a named binding
-  --> $DIR/mut-patterns.rs:9:9
+  --> $DIR/mut-patterns.rs:10:9
    |
 LL |     let mut _ = 0;
    |         ^^^^
@@ -12,7 +12,7 @@
    |
 
 error: `mut` must be followed by a named binding
-  --> $DIR/mut-patterns.rs:10:9
+  --> $DIR/mut-patterns.rs:11:9
    |
 LL |     let mut (_, _) = (0, 0);
    |         ^^^^
@@ -25,7 +25,7 @@
    |
 
 error: `mut` must be attached to each individual binding
-  --> $DIR/mut-patterns.rs:12:9
+  --> $DIR/mut-patterns.rs:13:9
    |
 LL |     let mut (x @ y) = 0;
    |         ^^^^^^^^^^^
@@ -38,7 +38,7 @@
    |
 
 error: `mut` on a binding may not be repeated
-  --> $DIR/mut-patterns.rs:14:13
+  --> $DIR/mut-patterns.rs:15:13
    |
 LL |     let mut mut x = 0;
    |             ^^^
@@ -50,7 +50,7 @@
    |
 
 error: `mut` on a binding may not be repeated
-  --> $DIR/mut-patterns.rs:18:13
+  --> $DIR/mut-patterns.rs:19:13
    |
 LL |     let mut mut mut mut mut x = 0;
    |             ^^^^^^^^^^^^^^^
@@ -62,7 +62,7 @@
    |
 
 error: `mut` must be attached to each individual binding
-  --> $DIR/mut-patterns.rs:23:9
+  --> $DIR/mut-patterns.rs:24:9
    |
 LL |     let mut Foo { x: x } = Foo { x: 3 };
    |         ^^^^^^^^^^^^^^^^
@@ -75,7 +75,7 @@
    |
 
 error: `mut` must be attached to each individual binding
-  --> $DIR/mut-patterns.rs:27:9
+  --> $DIR/mut-patterns.rs:28:9
    |
 LL |     let mut Foo { x } = Foo { x: 3 };
    |         ^^^^^^^^^^^^^
@@ -88,7 +88,7 @@
    |
 
 error: `mut` on a binding may not be repeated
-  --> $DIR/mut-patterns.rs:32:13
+  --> $DIR/mut-patterns.rs:33:13
    |
 LL |     let mut mut yield(become, await) = r#yield(0, 0);
    |             ^^^
@@ -100,7 +100,7 @@
    |
 
 error: expected identifier, found reserved keyword `yield`
-  --> $DIR/mut-patterns.rs:32:17
+  --> $DIR/mut-patterns.rs:33:17
    |
 LL |     let mut mut yield(become, await) = r#yield(0, 0);
    |                 ^^^^^ expected identifier, found reserved keyword
@@ -111,7 +111,7 @@
    |                 ++
 
 error: expected identifier, found reserved keyword `become`
-  --> $DIR/mut-patterns.rs:32:23
+  --> $DIR/mut-patterns.rs:33:23
    |
 LL |     let mut mut yield(become, await) = r#yield(0, 0);
    |                       ^^^^^^ expected identifier, found reserved keyword
@@ -122,7 +122,7 @@
    |                       ++
 
 error: expected identifier, found keyword `await`
-  --> $DIR/mut-patterns.rs:32:31
+  --> $DIR/mut-patterns.rs:33:31
    |
 LL |     let mut mut yield(become, await) = r#yield(0, 0);
    |                               ^^^^^ expected identifier, found keyword
@@ -133,7 +133,7 @@
    |                               ++
 
 error: `mut` must be followed by a named binding
-  --> $DIR/mut-patterns.rs:32:9
+  --> $DIR/mut-patterns.rs:33:9
    |
 LL |     let mut mut yield(become, await) = r#yield(0, 0);
    |         ^^^^^^^^
@@ -146,7 +146,7 @@
    |
 
 error: `mut` must be attached to each individual binding
-  --> $DIR/mut-patterns.rs:41:9
+  --> $DIR/mut-patterns.rs:42:9
    |
 LL |     let mut W(mut a, W(b, W(ref c, W(d, B { box f }))))
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -159,7 +159,7 @@
    |
 
 error: expected identifier, found metavariable
-  --> $DIR/mut-patterns.rs:48:21
+  --> $DIR/mut-patterns.rs:49:21
    |
 LL |             let mut $p = 0;
    |                     ^^ expected identifier, found metavariable
diff --git a/tests/ui/parser/recover/recover-pat-exprs.rs b/tests/ui/parser/recover/recover-pat-exprs.rs
index a78bb82..41b44ec 100644
--- a/tests/ui/parser/recover/recover-pat-exprs.rs
+++ b/tests/ui/parser/recover/recover-pat-exprs.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: HELP
+
 // FieldExpression, TupleIndexingExpression
 fn field_access() {
     match 0 {
@@ -28,7 +30,7 @@ fn array_indexing() {
     { let x[0; 20]; } //~ error: expected one of `:`, `;`, `=`, `@`, or `|`, found `[`
     { let x[]; } //~ error: expected one of `:`, `;`, `=`, `@`, or `|`, found `[`
     { let (x[]); } //~ error: expected one of `)`, `,`, `@`, `if`, or `|`, found `[`
-    //~^ missing `,`
+    //~^ HELP missing `,`
 }
 
 // MethodCallExpression, CallExpression, ErrorPropagationExpression
diff --git a/tests/ui/parser/recover/recover-pat-exprs.stderr b/tests/ui/parser/recover/recover-pat-exprs.stderr
index 69bc510..3300002 100644
--- a/tests/ui/parser/recover/recover-pat-exprs.stderr
+++ b/tests/ui/parser/recover/recover-pat-exprs.stderr
@@ -1,5 +1,5 @@
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:5:9
+  --> $DIR/recover-pat-exprs.rs:7:9
    |
 LL |         x.y => (),
    |         ^^^ not a pattern
@@ -19,7 +19,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:6:9
+  --> $DIR/recover-pat-exprs.rs:8:9
    |
 LL |         x.0 => (),
    |         ^^^ not a pattern
@@ -40,7 +40,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:7:9
+  --> $DIR/recover-pat-exprs.rs:9:9
    |
 LL |         x._0 => (),
    |         ^^^^ not a pattern
@@ -62,7 +62,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:8:9
+  --> $DIR/recover-pat-exprs.rs:10:9
    |
 LL |         x.0.1 => (),
    |         ^^^^^ not a pattern
@@ -84,7 +84,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:9:9
+  --> $DIR/recover-pat-exprs.rs:11:9
    |
 LL |         x.4.y.17.__z => (),
    |         ^^^^^^^^^^^^ not a pattern
@@ -106,37 +106,37 @@
    |
 
 error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.`
-  --> $DIR/recover-pat-exprs.rs:12:12
+  --> $DIR/recover-pat-exprs.rs:14:12
    |
 LL |     { let x.0e0; }
    |            ^ expected one of `:`, `;`, `=`, `@`, or `|`
 
 error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.`
-  --> $DIR/recover-pat-exprs.rs:13:12
+  --> $DIR/recover-pat-exprs.rs:15:12
    |
 LL |     { let x.-0.0; }
    |            ^ expected one of `:`, `;`, `=`, `@`, or `|`
 
 error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.`
-  --> $DIR/recover-pat-exprs.rs:14:12
+  --> $DIR/recover-pat-exprs.rs:16:12
    |
 LL |     { let x.-0; }
    |            ^ expected one of `:`, `;`, `=`, `@`, or `|`
 
 error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.`
-  --> $DIR/recover-pat-exprs.rs:16:12
+  --> $DIR/recover-pat-exprs.rs:18:12
    |
 LL |     { let x.0u32; }
    |            ^ expected one of `:`, `;`, `=`, `@`, or `|`
 
 error: expected one of `:`, `;`, `=`, `@`, or `|`, found `.`
-  --> $DIR/recover-pat-exprs.rs:17:12
+  --> $DIR/recover-pat-exprs.rs:19:12
    |
 LL |     { let x.0.0_f64; }
    |            ^ expected one of `:`, `;`, `=`, `@`, or `|`
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:23:9
+  --> $DIR/recover-pat-exprs.rs:25:9
    |
 LL |         x[0] => (),
    |         ^^^^ not a pattern
@@ -155,7 +155,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:24:9
+  --> $DIR/recover-pat-exprs.rs:26:9
    |
 LL |         x[..] => (),
    |         ^^^^^ not a pattern
@@ -175,25 +175,25 @@
    |
 
 error: expected one of `:`, `;`, `=`, `@`, or `|`, found `[`
-  --> $DIR/recover-pat-exprs.rs:27:12
+  --> $DIR/recover-pat-exprs.rs:29:12
    |
 LL |     { let x[0, 1, 2]; }
    |            ^ expected one of `:`, `;`, `=`, `@`, or `|`
 
 error: expected one of `:`, `;`, `=`, `@`, or `|`, found `[`
-  --> $DIR/recover-pat-exprs.rs:28:12
+  --> $DIR/recover-pat-exprs.rs:30:12
    |
 LL |     { let x[0; 20]; }
    |            ^ expected one of `:`, `;`, `=`, `@`, or `|`
 
 error: expected one of `:`, `;`, `=`, `@`, or `|`, found `[`
-  --> $DIR/recover-pat-exprs.rs:29:12
+  --> $DIR/recover-pat-exprs.rs:31:12
    |
 LL |     { let x[]; }
    |            ^ expected one of `:`, `;`, `=`, `@`, or `|`
 
 error: expected one of `)`, `,`, `@`, `if`, or `|`, found `[`
-  --> $DIR/recover-pat-exprs.rs:30:13
+  --> $DIR/recover-pat-exprs.rs:32:13
    |
 LL |     { let (x[]); }
    |             ^
@@ -202,7 +202,7 @@
    |             help: missing `,`
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:37:9
+  --> $DIR/recover-pat-exprs.rs:39:9
    |
 LL |         x.f() => (),
    |         ^^^^^ not a pattern
@@ -221,7 +221,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:38:9
+  --> $DIR/recover-pat-exprs.rs:40:9
    |
 LL |         x._f() => (),
    |         ^^^^^^ not a pattern
@@ -241,7 +241,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:39:9
+  --> $DIR/recover-pat-exprs.rs:41:9
    |
 LL |         x? => (),
    |         ^^ not a pattern
@@ -262,7 +262,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:40:9
+  --> $DIR/recover-pat-exprs.rs:42:9
    |
 LL |         ().f() => (),
    |         ^^^^^^ not a pattern
@@ -284,7 +284,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:41:9
+  --> $DIR/recover-pat-exprs.rs:43:9
    |
 LL |         (0, x)?.f() => (),
    |         ^^^^^^^^^^^ not a pattern
@@ -306,7 +306,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:42:9
+  --> $DIR/recover-pat-exprs.rs:44:9
    |
 LL |         x.f().g() => (),
    |         ^^^^^^^^^ not a pattern
@@ -328,7 +328,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:43:9
+  --> $DIR/recover-pat-exprs.rs:45:9
    |
 LL |         0.f()?.g()?? => (),
    |         ^^^^^^^^^^^^ not a pattern
@@ -350,7 +350,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:50:9
+  --> $DIR/recover-pat-exprs.rs:52:9
    |
 LL |         x as usize => (),
    |         ^^^^^^^^^^ not a pattern
@@ -369,7 +369,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:51:9
+  --> $DIR/recover-pat-exprs.rs:53:9
    |
 LL |         0 as usize => (),
    |         ^^^^^^^^^^ not a pattern
@@ -389,7 +389,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:52:9
+  --> $DIR/recover-pat-exprs.rs:54:9
    |
 LL |         x.f().0.4 as f32 => (),
    |         ^^^^^^^^^^^^^^^^ not a pattern
@@ -410,7 +410,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:59:9
+  --> $DIR/recover-pat-exprs.rs:61:9
    |
 LL |         1 + 1 => (),
    |         ^^^^^ not a pattern
@@ -429,7 +429,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:60:9
+  --> $DIR/recover-pat-exprs.rs:62:9
    |
 LL |         (1 + 2) * 3 => (),
    |         ^^^^^^^^^^^ not a pattern
@@ -449,7 +449,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:63:9
+  --> $DIR/recover-pat-exprs.rs:65:9
    |
 LL |         x.0 > 2 => (),
    |         ^^^^^^^ not a pattern
@@ -471,7 +471,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:64:9
+  --> $DIR/recover-pat-exprs.rs:66:9
    |
 LL |         x.0 == 2 => (),
    |         ^^^^^^^^ not a pattern
@@ -493,7 +493,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:69:13
+  --> $DIR/recover-pat-exprs.rs:71:13
    |
 LL |         (x, y.0 > 2) if x != 0 => (),
    |             ^^^^^^^ not a pattern
@@ -512,7 +512,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:70:13
+  --> $DIR/recover-pat-exprs.rs:72:13
    |
 LL |         (x, y.0 > 2) if x != 0 || x != 1 => (),
    |             ^^^^^^^ not a pattern
@@ -532,7 +532,7 @@
    |
 
 error: left-hand side of `@` must be a binding
-  --> $DIR/recover-pat-exprs.rs:83:9
+  --> $DIR/recover-pat-exprs.rs:85:9
    |
 LL |         x.sqrt() @ .. => (),
    |         --------^^^--
@@ -543,13 +543,13 @@
    = note: bindings are `x`, `mut x`, `ref x`, and `ref mut x`
 
 error: expected one of `)`, `,`, `if`, or `|`, found `+`
-  --> $DIR/recover-pat-exprs.rs:97:12
+  --> $DIR/recover-pat-exprs.rs:99:12
    |
 LL |         (_ + 1) => (),
    |            ^ expected one of `)`, `,`, `if`, or `|`
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:81:9
+  --> $DIR/recover-pat-exprs.rs:83:9
    |
 LL |         u8::MAX.abs() => (),
    |         ^^^^^^^^^^^^^ not a pattern
@@ -568,7 +568,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:86:17
+  --> $DIR/recover-pat-exprs.rs:88:17
    |
 LL |         z @ w @ v.u() => (),
    |                 ^^^^^ not a pattern
@@ -590,7 +590,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:88:9
+  --> $DIR/recover-pat-exprs.rs:90:9
    |
 LL |         y.ilog(3) => (),
    |         ^^^^^^^^^ not a pattern
@@ -612,7 +612,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:90:9
+  --> $DIR/recover-pat-exprs.rs:92:9
    |
 LL |         n + 1 => (),
    |         ^^^^^ not a pattern
@@ -634,7 +634,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:92:10
+  --> $DIR/recover-pat-exprs.rs:94:10
    |
 LL |         ("".f() + 14 * 8) => (),
    |          ^^^^^^^^^^^^^^^ not a pattern
@@ -656,7 +656,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:95:9
+  --> $DIR/recover-pat-exprs.rs:97:9
    |
 LL |         f?() => (),
    |         ^^^^ not a pattern
@@ -678,7 +678,7 @@
    |
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:101:9
+  --> $DIR/recover-pat-exprs.rs:103:9
    |
 LL |     let 1 + 1 = 2;
    |         ^^^^^ not a pattern
@@ -686,7 +686,7 @@
    = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html>
 
 error: expected one of `)`, `,`, `@`, `if`, or `|`, found `*`
-  --> $DIR/recover-pat-exprs.rs:104:28
+  --> $DIR/recover-pat-exprs.rs:106:28
    |
 LL |     let b = matches!(x, (x * x | x.f()) | x[0]);
    |                            ^ expected one of `)`, `,`, `@`, `if`, or `|`
@@ -695,7 +695,7 @@
    = note: while parsing argument for this `pat` macro fragment
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:60:10
+  --> $DIR/recover-pat-exprs.rs:62:10
    |
 LL |         (1 + 2) * 3 => (),
    |          ^^^^^ not a pattern
@@ -703,7 +703,7 @@
    = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html>
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:75:5
+  --> $DIR/recover-pat-exprs.rs:77:5
    |
 LL |     1 + 2 * PI.cos() => 2,
    |     ^^^^^^^^^^^^^^^^ not a pattern
@@ -711,7 +711,7 @@
    = note: arbitrary expressions are not allowed in patterns: <https://doc.rust-lang.org/book/ch19-00-patterns.html>
 
 error: expected a pattern, found an expression
-  --> $DIR/recover-pat-exprs.rs:83:9
+  --> $DIR/recover-pat-exprs.rs:85:9
    |
 LL |         x.sqrt() @ .. => (),
    |         ^^^^^^^^ not a pattern
diff --git a/tests/ui/pattern/byte-string-mutability-mismatch.rs b/tests/ui/pattern/byte-string-mutability-mismatch.rs
index 4ffdb5f..9f7054a 100644
--- a/tests/ui/pattern/byte-string-mutability-mismatch.rs
+++ b/tests/ui/pattern/byte-string-mutability-mismatch.rs
@@ -2,18 +2,20 @@
 //! the pattern's scrutinee. Since byte string literals are always shared references, it's a
 //! mismatch to use a byte string literal pattern to match on a mutable array or slice reference.
 
+//@ dont-require-annotations: NOTE
+
 fn main() {
     let mut val = [97u8, 10u8];
     match &mut val {
         b"a\n" => {},
         //~^ ERROR mismatched types
-        //~| types differ in mutability
+        //~| NOTE types differ in mutability
         _ => {},
     }
     match &mut val[..] {
          b"a\n" => {},
         //~^ ERROR mismatched types
-        //~| types differ in mutability
+        //~| NOTE types differ in mutability
          _ => {},
     }
 }
diff --git a/tests/ui/pattern/byte-string-mutability-mismatch.stderr b/tests/ui/pattern/byte-string-mutability-mismatch.stderr
index ee79627..f64b452 100644
--- a/tests/ui/pattern/byte-string-mutability-mismatch.stderr
+++ b/tests/ui/pattern/byte-string-mutability-mismatch.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/byte-string-mutability-mismatch.rs:8:9
+  --> $DIR/byte-string-mutability-mismatch.rs:10:9
    |
 LL |     match &mut val {
    |           -------- this expression has type `&mut [u8; 2]`
@@ -10,7 +10,7 @@
                       found reference `&'static _`
 
 error[E0308]: mismatched types
-  --> $DIR/byte-string-mutability-mismatch.rs:14:10
+  --> $DIR/byte-string-mutability-mismatch.rs:16:10
    |
 LL |     match &mut val[..] {
    |           ------------ this expression has type `&mut [u8]`
diff --git a/tests/ui/pattern/deref-patterns/byte-string-type-errors.rs b/tests/ui/pattern/deref-patterns/byte-string-type-errors.rs
index 29a33e3..64acc47 100644
--- a/tests/ui/pattern/deref-patterns/byte-string-type-errors.rs
+++ b/tests/ui/pattern/deref-patterns/byte-string-type-errors.rs
@@ -2,6 +2,8 @@
 //! patterns to have type `[u8]` or `[u8; N]` when matching on a slice or array; this can affect the
 //! "found" type reported in error messages when matching on a slice or array of the wrong type.
 
+//@ dont-require-annotations: NOTE
+
 #![feature(deref_patterns)]
 #![expect(incomplete_features)]
 
@@ -10,25 +12,25 @@ fn main() {
     // the same as byte string literals.
     if let b"test" = () {}
     //~^ ERROR mismatched types
-    //~| expected `()`, found `&[u8; 4]`
+    //~| NOTE expected `()`, found `&[u8; 4]`
 
     // Baseline 2: there's a special case for byte string patterns in stable rust, allowing them to
     // match on slice references. This affects the error when matching on a non-`&[u8]` slice ref,
     // reporting the "found" type as `&[u8]`.
     if let b"test" = &[] as &[i8] {}
     //~^ ERROR mismatched types
-    //~| expected `&[i8]`, found `&[u8]`
+    //~| NOTE expected `&[i8]`, found `&[u8]`
 
     // Test matching on a non-`[u8]` slice: the pattern has type `[u8]` if a slice is expected.
     if let b"test" = *(&[] as &[i8]) {}
     //~^ ERROR mismatched types
-    //~| expected `[i8]`, found `[u8]`
+    //~| NOTE expected `[i8]`, found `[u8]`
 
     // Test matching on a non-`[u8;4]` array: the pattern has type `[u8;4]` if an array is expected.
     if let b"test" = [()] {}
     //~^ ERROR mismatched types
-    //~| expected `[(); 1]`, found `[u8; 4]`
+    //~| NOTE expected `[(); 1]`, found `[u8; 4]`
     if let b"test" = *b"this array is too long" {}
     //~^ ERROR mismatched types
-    //~| expected an array with a size of 22, found one with a size of 4
+    //~| NOTE expected an array with a size of 22, found one with a size of 4
 }
diff --git a/tests/ui/pattern/deref-patterns/byte-string-type-errors.stderr b/tests/ui/pattern/deref-patterns/byte-string-type-errors.stderr
index d29a5b5..0317b72 100644
--- a/tests/ui/pattern/deref-patterns/byte-string-type-errors.stderr
+++ b/tests/ui/pattern/deref-patterns/byte-string-type-errors.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/byte-string-type-errors.rs:11:12
+  --> $DIR/byte-string-type-errors.rs:13:12
    |
 LL |     if let b"test" = () {}
    |            ^^^^^^^   -- this expression has type `()`
@@ -7,7 +7,7 @@
    |            expected `()`, found `&[u8; 4]`
 
 error[E0308]: mismatched types
-  --> $DIR/byte-string-type-errors.rs:18:12
+  --> $DIR/byte-string-type-errors.rs:20:12
    |
 LL |     if let b"test" = &[] as &[i8] {}
    |            ^^^^^^^   ------------ this expression has type `&[i8]`
@@ -18,7 +18,7 @@
               found reference `&'static [u8]`
 
 error[E0308]: mismatched types
-  --> $DIR/byte-string-type-errors.rs:23:12
+  --> $DIR/byte-string-type-errors.rs:25:12
    |
 LL |     if let b"test" = *(&[] as &[i8]) {}
    |            ^^^^^^^   --------------- this expression has type `[i8]`
@@ -29,7 +29,7 @@
               found slice `[u8]`
 
 error[E0308]: mismatched types
-  --> $DIR/byte-string-type-errors.rs:28:12
+  --> $DIR/byte-string-type-errors.rs:30:12
    |
 LL |     if let b"test" = [()] {}
    |            ^^^^^^^   ---- this expression has type `[(); 1]`
@@ -40,7 +40,7 @@
               found array `[u8; 4]`
 
 error[E0308]: mismatched types
-  --> $DIR/byte-string-type-errors.rs:31:12
+  --> $DIR/byte-string-type-errors.rs:33:12
    |
 LL |     if let b"test" = *b"this array is too long" {}
    |            ^^^^^^^   -------------------------- this expression has type `[u8; 22]`
diff --git a/tests/ui/pattern/deref-patterns/unsatisfied-bounds.rs b/tests/ui/pattern/deref-patterns/unsatisfied-bounds.rs
index 00064b2..9e95f4e 100644
--- a/tests/ui/pattern/deref-patterns/unsatisfied-bounds.rs
+++ b/tests/ui/pattern/deref-patterns/unsatisfied-bounds.rs
@@ -15,7 +15,7 @@ fn main() {
     // FIXME(deref_patterns): there should be a special diagnostic for missing `DerefPure`.
     match MyPointer {
         () => {}
-        //~^ the trait bound `MyPointer: DerefPure` is not satisfied
+        //~^ ERROR the trait bound `MyPointer: DerefPure` is not satisfied
         _ => {}
     }
 }
diff --git a/tests/ui/pattern/pattern-error-continue.rs b/tests/ui/pattern/pattern-error-continue.rs
index bed9494..664d4e8 100644
--- a/tests/ui/pattern/pattern-error-continue.rs
+++ b/tests/ui/pattern/pattern-error-continue.rs
@@ -1,5 +1,7 @@
 // Test that certain pattern-match type errors are non-fatal
 
+//@ dont-require-annotations: NOTE
+
 enum A {
     B(isize, isize),
     C(isize, isize, isize),
@@ -21,13 +23,13 @@ fn main() {
     match 'c' {
         S { .. } => (),
         //~^ ERROR mismatched types
-        //~| expected `char`, found `S`
+        //~| NOTE expected `char`, found `S`
 
         _ => ()
     }
     f(true);
     //~^ ERROR mismatched types
-    //~| expected `char`, found `bool`
+    //~| NOTE expected `char`, found `bool`
 
     match () {
         E::V => {} //~ ERROR failed to resolve: use of undeclared type `E`
diff --git a/tests/ui/pattern/pattern-error-continue.stderr b/tests/ui/pattern/pattern-error-continue.stderr
index bb5582d..a9ac96e 100644
--- a/tests/ui/pattern/pattern-error-continue.stderr
+++ b/tests/ui/pattern/pattern-error-continue.stderr
@@ -1,5 +1,5 @@
 error[E0532]: expected tuple struct or tuple variant, found unit variant `A::D`
-  --> $DIR/pattern-error-continue.rs:18:9
+  --> $DIR/pattern-error-continue.rs:20:9
    |
 LL |     B(isize, isize),
    |     --------------- similarly named tuple variant `B` defined here
@@ -22,7 +22,7 @@
    |
 
 error[E0023]: this pattern has 3 fields, but the corresponding tuple variant has 2 fields
-  --> $DIR/pattern-error-continue.rs:17:14
+  --> $DIR/pattern-error-continue.rs:19:14
    |
 LL |     B(isize, isize),
    |       -----  ----- tuple variant has 2 fields
@@ -31,7 +31,7 @@
    |              ^  ^  ^ expected 2 fields, found 3
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-error-continue.rs:22:9
+  --> $DIR/pattern-error-continue.rs:24:9
    |
 LL |     match 'c' {
    |           --- this expression has type `char`
@@ -39,7 +39,7 @@
    |         ^^^^^^^^ expected `char`, found `S`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-error-continue.rs:28:7
+  --> $DIR/pattern-error-continue.rs:30:7
    |
 LL |     f(true);
    |     - ^^^^ expected `char`, found `bool`
@@ -47,13 +47,13 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/pattern-error-continue.rs:13:4
+  --> $DIR/pattern-error-continue.rs:15:4
    |
 LL | fn f(_c: char) {}
    |    ^ --------
 
 error[E0433]: failed to resolve: use of undeclared type `E`
-  --> $DIR/pattern-error-continue.rs:33:9
+  --> $DIR/pattern-error-continue.rs:35:9
    |
 LL |         E::V => {}
    |         ^
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.classic2021.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.classic2021.stderr
index 355a8af..4d795d5 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.classic2021.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.classic2021.stderr
@@ -1,5 +1,5 @@
 error[E0507]: cannot move out of a shared reference
-  --> $DIR/borrowck-errors.rs:31:29
+  --> $DIR/borrowck-errors.rs:33:29
    |
 LL |     if let Some(&Some(x)) = Some(&Some(&mut 0)) {
    |                       -     ^^^^^^^^^^^^^^^^^^^
@@ -14,19 +14,19 @@
    |
 
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/borrowck-errors.rs:36:10
+  --> $DIR/borrowck-errors.rs:38:10
    |
 LL |     let &ref mut x = &0;
    |          ^^^^^^^^^ cannot borrow as mutable
 
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/borrowck-errors.rs:41:23
+  --> $DIR/borrowck-errors.rs:43:23
    |
 LL |     if let &Some(Some(x)) = &Some(&mut Some(0)) {
    |                       ^ cannot borrow as mutable
 
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/borrowck-errors.rs:46:11
+  --> $DIR/borrowck-errors.rs:48:11
    |
 LL |     let &[x] = &&mut [0];
    |           ^ cannot borrow as mutable
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.classic2024.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.classic2024.stderr
index d40bdb9..6cc6c58 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.classic2024.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.classic2024.stderr
@@ -1,5 +1,5 @@
 error[E0508]: cannot move out of type `[&mut i32; 1]`, a non-copy array
-  --> $DIR/borrowck-errors.rs:15:16
+  --> $DIR/borrowck-errors.rs:17:16
    |
 LL |     let [&x] = &[&mut 0];
    |           -    ^^^^^^^^^ cannot move out of here
@@ -13,7 +13,7 @@
    |           +++
 
 error[E0508]: cannot move out of type `[&mut i32; 1]`, a non-copy array
-  --> $DIR/borrowck-errors.rs:22:16
+  --> $DIR/borrowck-errors.rs:24:16
    |
 LL |     let [&x] = &mut [&mut 0];
    |           -    ^^^^^^^^^^^^^ cannot move out of here
@@ -27,7 +27,7 @@
    |           +++
 
 error[E0507]: cannot move out of a shared reference
-  --> $DIR/borrowck-errors.rs:31:29
+  --> $DIR/borrowck-errors.rs:33:29
    |
 LL |     if let Some(&Some(x)) = Some(&Some(&mut 0)) {
    |                       -     ^^^^^^^^^^^^^^^^^^^
@@ -42,25 +42,25 @@
    |
 
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/borrowck-errors.rs:36:10
+  --> $DIR/borrowck-errors.rs:38:10
    |
 LL |     let &ref mut x = &0;
    |          ^^^^^^^^^ cannot borrow as mutable
 
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/borrowck-errors.rs:41:23
+  --> $DIR/borrowck-errors.rs:43:23
    |
 LL |     if let &Some(Some(x)) = &Some(&mut Some(0)) {
    |                       ^ cannot borrow as mutable
 
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/borrowck-errors.rs:46:11
+  --> $DIR/borrowck-errors.rs:48:11
    |
 LL |     let &[x] = &&mut [0];
    |           ^ cannot borrow as mutable
 
 error[E0508]: cannot move out of type `[&mut i32; 1]`, a non-copy array
-  --> $DIR/borrowck-errors.rs:50:20
+  --> $DIR/borrowck-errors.rs:52:20
    |
 LL |     let [&mut x] = &mut [&mut 0];
    |               -    ^^^^^^^^^^^^^ cannot move out of here
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.rs
index c171dcf..1557551 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.rs
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.rs
@@ -4,6 +4,8 @@
 //@[structural2021] edition: 2021
 //@[classic2024] edition: 2024
 //@[structural2024] edition: 2024
+//@ dont-require-annotations: NOTE
+
 //! Tests for pattern errors not handled by the pattern typing rules, but by borrowck.
 #![allow(incomplete_features)]
 #![cfg_attr(any(classic2021, classic2024), feature(ref_pat_eat_one_layer_2024))]
@@ -14,14 +16,14 @@
 fn errors_caught_in_hir_typeck_on_stable() {
     let [&x] = &[&mut 0];
     //[stable2021]~^ ERROR mismatched types
-    //[stable2021]~| types differ in mutability
+    //[stable2021]~| NOTE types differ in mutability
     //[classic2024]~^^^ ERROR: cannot move out of type
     #[cfg(any(classic2021, structural2021))] let _: u32 = x;
     #[cfg(structural2024)] let _: &u32 = x;
 
     let [&x] = &mut [&mut 0];
     //[stable2021]~^ ERROR mismatched types
-    //[stable2021]~| types differ in mutability
+    //[stable2021]~| NOTE types differ in mutability
     //[classic2024]~^^^ ERROR: cannot move out of type
     #[cfg(any(classic2021, structural2021))] let _: u32 = x;
     #[cfg(structural2024)] let _: &u32 = x;
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.stable2021.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.stable2021.stderr
index edcf9f3..036b3db 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.stable2021.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.stable2021.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/borrowck-errors.rs:15:10
+  --> $DIR/borrowck-errors.rs:17:10
    |
 LL |     let [&x] = &[&mut 0];
    |          ^^    --------- this expression has type `&[&mut {integer}; 1]`
@@ -15,7 +15,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/borrowck-errors.rs:22:10
+  --> $DIR/borrowck-errors.rs:24:10
    |
 LL |     let [&x] = &mut [&mut 0];
    |          ^^    ------------- this expression has type `&mut [&mut {integer}; 1]`
@@ -31,7 +31,7 @@
    |
 
 error[E0507]: cannot move out of a shared reference
-  --> $DIR/borrowck-errors.rs:31:29
+  --> $DIR/borrowck-errors.rs:33:29
    |
 LL |     if let Some(&Some(x)) = Some(&Some(&mut 0)) {
    |                       -     ^^^^^^^^^^^^^^^^^^^
@@ -46,19 +46,19 @@
    |
 
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/borrowck-errors.rs:36:10
+  --> $DIR/borrowck-errors.rs:38:10
    |
 LL |     let &ref mut x = &0;
    |          ^^^^^^^^^ cannot borrow as mutable
 
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/borrowck-errors.rs:41:23
+  --> $DIR/borrowck-errors.rs:43:23
    |
 LL |     if let &Some(Some(x)) = &Some(&mut Some(0)) {
    |                       ^ cannot borrow as mutable
 
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/borrowck-errors.rs:46:11
+  --> $DIR/borrowck-errors.rs:48:11
    |
 LL |     let &[x] = &&mut [0];
    |           ^ cannot borrow as mutable
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.structural2021.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.structural2021.stderr
index 208f6c8..e1764fa 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.structural2021.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.structural2021.stderr
@@ -1,5 +1,5 @@
 error[E0507]: cannot move out of a shared reference
-  --> $DIR/borrowck-errors.rs:31:29
+  --> $DIR/borrowck-errors.rs:33:29
    |
 LL |     if let Some(&Some(x)) = Some(&Some(&mut 0)) {
    |                       -     ^^^^^^^^^^^^^^^^^^^
@@ -14,7 +14,7 @@
    |
 
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/borrowck-errors.rs:36:10
+  --> $DIR/borrowck-errors.rs:38:10
    |
 LL |     let &ref mut x = &0;
    |          ^^^^^^^^^ cannot borrow as mutable
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.structural2024.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.structural2024.stderr
index 208f6c8..e1764fa 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.structural2024.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/borrowck-errors.structural2024.stderr
@@ -1,5 +1,5 @@
 error[E0507]: cannot move out of a shared reference
-  --> $DIR/borrowck-errors.rs:31:29
+  --> $DIR/borrowck-errors.rs:33:29
    |
 LL |     if let Some(&Some(x)) = Some(&Some(&mut 0)) {
    |                       -     ^^^^^^^^^^^^^^^^^^^
@@ -14,7 +14,7 @@
    |
 
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/borrowck-errors.rs:36:10
+  --> $DIR/borrowck-errors.rs:38:10
    |
 LL |     let &ref mut x = &0;
    |          ^^^^^^^^^ cannot borrow as mutable
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mut-ref-mut.classic2024.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mut-ref-mut.classic2024.stderr
index 6ddced3..97c74b5 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mut-ref-mut.classic2024.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mut-ref-mut.classic2024.stderr
@@ -1,5 +1,5 @@
 error[E0658]: binding cannot be both mutable and by-reference
-  --> $DIR/mut-ref-mut.rs:18:13
+  --> $DIR/mut-ref-mut.rs:20:13
    |
 LL |     let Foo(mut a) = &Foo(0);
    |             ^^^^
@@ -9,7 +9,7 @@
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: binding cannot be both mutable and by-reference
-  --> $DIR/mut-ref-mut.rs:23:13
+  --> $DIR/mut-ref-mut.rs:25:13
    |
 LL |     let Foo(mut a) = &mut Foo(0);
    |             ^^^^
@@ -19,7 +19,7 @@
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0308]: mismatched types
-  --> $DIR/mut-ref-mut.rs:28:10
+  --> $DIR/mut-ref-mut.rs:30:10
    |
 LL |     let [&mut mut x] = &[&mut 0];
    |          ^^^^^
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mut-ref-mut.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mut-ref-mut.rs
index 94691e7..814c7d9 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mut-ref-mut.rs
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mut-ref-mut.rs
@@ -7,6 +7,8 @@
 //@[stable2021] run-pass
 //@[classic2021] run-pass
 //@[structural2021] run-pass
+//@ dont-require-annotations: NOTE
+
 //! Test diagnostics for binding with `mut` when the default binding mode is by-ref.
 #![allow(incomplete_features, unused_assignments, unused_variables)]
 #![cfg_attr(any(classic2021, classic2024), feature(ref_pat_eat_one_layer_2024))]
@@ -27,7 +29,7 @@ pub fn main() {
 
     let [&mut mut x] = &[&mut 0];
     //[classic2024]~^ ERROR: mismatched types
-    //[classic2024]~| cannot match inherited `&` with `&mut` pattern
+    //[classic2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     //[structural2024]~^^^ ERROR binding cannot be both mutable and by-reference
     #[cfg(any(stable2021, classic2021, structural2021))] { x = 0 }
 }
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mut-ref-mut.structural2024.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mut-ref-mut.structural2024.stderr
index c0c0f96..a3e8f2a 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mut-ref-mut.structural2024.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/mut-ref-mut.structural2024.stderr
@@ -1,5 +1,5 @@
 error[E0658]: binding cannot be both mutable and by-reference
-  --> $DIR/mut-ref-mut.rs:18:13
+  --> $DIR/mut-ref-mut.rs:20:13
    |
 LL |     let Foo(mut a) = &Foo(0);
    |             ^^^^
@@ -9,7 +9,7 @@
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: binding cannot be both mutable and by-reference
-  --> $DIR/mut-ref-mut.rs:23:13
+  --> $DIR/mut-ref-mut.rs:25:13
    |
 LL |     let Foo(mut a) = &mut Foo(0);
    |             ^^^^
@@ -19,7 +19,7 @@
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: binding cannot be both mutable and by-reference
-  --> $DIR/mut-ref-mut.rs:28:15
+  --> $DIR/mut-ref-mut.rs:30:15
    |
 LL |     let [&mut mut x] = &[&mut 0];
    |               ^^^^
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.classic2021.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.classic2021.stderr
index a856a0e..208873c1 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.classic2021.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.classic2021.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:20:27
+  --> $DIR/pattern-errors.rs:22:27
    |
 LL |     if let Some(&mut Some(&x)) = &Some(&mut Some(0)) {
    |                           ^^     ------------------- this expression has type `&Option<&mut Option<{integer}>>`
@@ -15,7 +15,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:33:17
+  --> $DIR/pattern-errors.rs:35:17
    |
 LL |     if let Some(&mut Some(&_)) = &Some(&Some(0)) {
    |                 ^^^^^^^^^^^^^    --------------- this expression has type `&Option<&Option<{integer}>>`
@@ -26,7 +26,7 @@
            found mutable reference `&mut _`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:38:23
+  --> $DIR/pattern-errors.rs:40:23
    |
 LL |     if let Some(&Some(&mut x)) = &Some(&mut Some(0)) {
    |                       ^^^^^^     ------------------- this expression has type `&Option<&mut Option<{integer}>>`
@@ -36,7 +36,7 @@
    = note:           expected type `{integer}`
            found mutable reference `&mut _`
 note: to declare a mutable binding use: `mut x`
-  --> $DIR/pattern-errors.rs:38:23
+  --> $DIR/pattern-errors.rs:40:23
    |
 LL |     if let Some(&Some(&mut x)) = &Some(&mut Some(0)) {
    |                       ^^^^^^
@@ -47,7 +47,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:45:23
+  --> $DIR/pattern-errors.rs:47:23
    |
 LL |     if let Some(&Some(&mut _)) = &mut Some(&Some(0)) {
    |                       ^^^^^^     ------------------- this expression has type `&mut Option<&Option<{integer}>>`
@@ -58,7 +58,7 @@
            found mutable reference `&mut _`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:56:17
+  --> $DIR/pattern-errors.rs:58:17
    |
 LL |     if let Some(&mut Some(x)) = &Some(Some(0)) {
    |                 ^^^^^
@@ -71,7 +71,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:114:11
+  --> $DIR/pattern-errors.rs:116:11
    |
 LL |     let [&&mut x] = &[&mut 0];
    |           ^^^^^^    --------- this expression has type `&[&mut {integer}; 1]`
@@ -87,7 +87,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:121:11
+  --> $DIR/pattern-errors.rs:123:11
    |
 LL |     let [&&mut x] = &mut [&mut 0];
    |           ^^^^^^    ------------- this expression has type `&mut [&mut {integer}; 1]`
@@ -103,7 +103,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:128:11
+  --> $DIR/pattern-errors.rs:130:11
    |
 LL |     let [&&mut ref x] = &[&mut 0];
    |           ^^^^^^^^^^    --------- this expression has type `&[&mut {integer}; 1]`
@@ -119,7 +119,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:135:11
+  --> $DIR/pattern-errors.rs:137:11
    |
 LL |     let [&&mut ref x] = &mut [&mut 0];
    |           ^^^^^^^^^^    ------------- this expression has type `&mut [&mut {integer}; 1]`
@@ -135,7 +135,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:142:11
+  --> $DIR/pattern-errors.rs:144:11
    |
 LL |     let [&&mut mut x] = &[&mut 0];
    |           ^^^^^^^^^^    --------- this expression has type `&[&mut {integer}; 1]`
@@ -151,7 +151,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:149:11
+  --> $DIR/pattern-errors.rs:151:11
    |
 LL |     let [&&mut mut x] = &mut [&mut 0];
    |           ^^^^^^^^^^    ------------- this expression has type `&mut [&mut {integer}; 1]`
@@ -167,7 +167,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:164:15
+  --> $DIR/pattern-errors.rs:166:15
    |
 LL |     let [&mut &x] = &[&mut 0];
    |               ^^    --------- this expression has type `&[&mut {integer}; 1]`
@@ -183,7 +183,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:170:15
+  --> $DIR/pattern-errors.rs:172:15
    |
 LL |     let [&mut &ref x] = &[&mut 0];
    |               ^^^^^^    --------- this expression has type `&[&mut {integer}; 1]`
@@ -199,7 +199,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:176:15
+  --> $DIR/pattern-errors.rs:178:15
    |
 LL |     let [&mut &(mut x)] = &[&mut 0];
    |               ^^^^^^^^    --------- this expression has type `&[&mut {integer}; 1]`
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.classic2024.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.classic2024.stderr
index 90510d2..4f778e0 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.classic2024.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.classic2024.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:14:17
+  --> $DIR/pattern-errors.rs:16:17
    |
 LL |     if let Some(&mut x) = &Some(&mut 0) {
    |                 ^^^^^
@@ -12,7 +12,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:20:17
+  --> $DIR/pattern-errors.rs:22:17
    |
 LL |     if let Some(&mut Some(&x)) = &Some(&mut Some(0)) {
    |                 ^^^^^
@@ -25,7 +25,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:26:22
+  --> $DIR/pattern-errors.rs:28:22
    |
 LL |     if let Some(Some(&mut x)) = &Some(Some(&mut 0)) {
    |                      ^^^^^
@@ -38,7 +38,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:33:17
+  --> $DIR/pattern-errors.rs:35:17
    |
 LL |     if let Some(&mut Some(&_)) = &Some(&Some(0)) {
    |                 ^^^^^
@@ -51,7 +51,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:45:23
+  --> $DIR/pattern-errors.rs:47:23
    |
 LL |     if let Some(&Some(&mut _)) = &mut Some(&Some(0)) {
    |                       ^^^^^
@@ -64,7 +64,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:56:17
+  --> $DIR/pattern-errors.rs:58:17
    |
 LL |     if let Some(&mut Some(x)) = &Some(Some(0)) {
    |                 ^^^^^
@@ -77,7 +77,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:158:10
+  --> $DIR/pattern-errors.rs:160:10
    |
 LL |     let [&mut x] = &[&mut 0];
    |          ^^^^^
@@ -90,7 +90,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:164:10
+  --> $DIR/pattern-errors.rs:166:10
    |
 LL |     let [&mut &x] = &[&mut 0];
    |          ^^^^^
@@ -103,7 +103,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:170:10
+  --> $DIR/pattern-errors.rs:172:10
    |
 LL |     let [&mut &ref x] = &[&mut 0];
    |          ^^^^^
@@ -116,7 +116,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:176:10
+  --> $DIR/pattern-errors.rs:178:10
    |
 LL |     let [&mut &(mut x)] = &[&mut 0];
    |          ^^^^^
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.rs
index 5e67744..70a5bde 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.rs
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.rs
@@ -4,6 +4,8 @@
 //@[structural2021] edition: 2021
 //@[classic2024] edition: 2024
 //@[structural2024] edition: 2024
+//@ dont-require-annotations: NOTE
+
 //! Test cases for poorly-typed patterns in edition 2024 which are caught by HIR typeck. These must
 //! be separate from cases caught by MIR borrowck or the latter errors may not be emitted.
 #![allow(incomplete_features)]
@@ -13,88 +15,88 @@
 pub fn main() {
     if let Some(&mut x) = &Some(&mut 0) {
         //[classic2024]~^ ERROR: mismatched types
-        //[classic2024]~| cannot match inherited `&` with `&mut` pattern
+        //[classic2024]~| NOTE cannot match inherited `&` with `&mut` pattern
         #[cfg(any(stable2021, classic2021, structural2021))] let _: u32 = x;
         #[cfg(structural2024)] let _: &u32 = x;
     }
     if let Some(&mut Some(&x)) = &Some(&mut Some(0)) {
         //[stable2021,classic2021,structural2021,classic2024]~^ ERROR: mismatched types
-        //[stable2021,classic2021,structural2021]~| expected integer, found `&_`
-        //[classic2024]~| cannot match inherited `&` with `&mut` pattern
+        //[stable2021,classic2021,structural2021]~| NOTE expected integer, found `&_`
+        //[classic2024]~| NOTE cannot match inherited `&` with `&mut` pattern
         #[cfg(structural2024)] let _: u32 = x;
     }
     if let Some(Some(&mut x)) = &Some(Some(&mut 0)) {
         //[classic2024]~^ ERROR: mismatched types
-        //[classic2024]~| cannot match inherited `&` with `&mut` pattern
+        //[classic2024]~| NOTE cannot match inherited `&` with `&mut` pattern
         #[cfg(any(stable2021, classic2021, structural2021))] let _: u32 = x;
         #[cfg(structural2024)] let _: &u32 = x;
     }
 
     if let Some(&mut Some(&_)) = &Some(&Some(0)) {
         //~^ ERROR: mismatched types
-        //[stable2021,classic2021,structural2021]~| types differ in mutability
-        //[classic2024,structural2024]~| cannot match inherited `&` with `&mut` pattern
+        //[stable2021,classic2021,structural2021]~| NOTE types differ in mutability
+        //[classic2024,structural2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     }
     if let Some(&Some(&mut x)) = &Some(&mut Some(0)) {
         //[stable2021,classic2021,structural2021,structural2024]~^ ERROR: mismatched types
-        //[stable2021]~| types differ in mutability
-        //[classic2021,structural2021]~| expected integer, found `&mut _`
-        //[structural2024]~| cannot match inherited `&` with `&mut` pattern
+        //[stable2021]~| NOTE types differ in mutability
+        //[classic2021,structural2021]~| NOTE expected integer, found `&mut _`
+        //[structural2024]~| NOTE cannot match inherited `&` with `&mut` pattern
         #[cfg(classic2024)] let _: u32 = x;
     }
     if let Some(&Some(&mut _)) = &mut Some(&Some(0)) {
         //~^ ERROR: mismatched types
-        //[stable2021,classic2021,structural2021]~| expected integer, found `&mut _`
-        //[classic2024,structural2024]~| cannot match inherited `&` with `&mut` pattern
+        //[stable2021,classic2021,structural2021]~| NOTE expected integer, found `&mut _`
+        //[classic2024,structural2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     }
     if let Some(&Some(Some(&mut x))) = &Some(Some(&mut Some(0))) {
         //[stable2021,structural2021,structural2024]~^ ERROR: mismatched types
-        //[stable2021]~| expected `Option<&mut Option<{integer}>>`, found `&_`
-        //[structural2021,structural2024]~| cannot match inherited `&` with `&mut` pattern
+        //[stable2021]~| NOTE expected `Option<&mut Option<{integer}>>`, found `&_`
+        //[structural2021,structural2024]~| NOTE cannot match inherited `&` with `&mut` pattern
         #[cfg(any(classic2021, classic2024))] let _: u32 = x;
     }
     if let Some(&mut Some(x)) = &Some(Some(0)) {
         //~^ ERROR: mismatched types
-        //[stable2021]~| expected `Option<{integer}>`, found `&mut _`
-        //[classic2021,structural2021,classic2024,structural2024]~| cannot match inherited `&` with `&mut` pattern
+        //[stable2021]~| NOTE expected `Option<{integer}>`, found `&mut _`
+        //[classic2021,structural2021,classic2024,structural2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     }
 }
 
 fn structural_errors_0() {
     let &[&mut x] = &&mut [0];
     //[stable2021,structural2021,structural2024]~^ ERROR: mismatched types
-    //[stable2021]~| expected integer, found `&mut _`
-    //[structural2021,structural2024]~| cannot match inherited `&` with `&mut` pattern
+    //[stable2021]~| NOTE expected integer, found `&mut _`
+    //[structural2021,structural2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     #[cfg(any(classic2021, classic2024))] let _: u32 = x;
 
     let &[&mut x] = &mut &mut [0];
     //[stable2021,structural2021,structural2024]~^ ERROR: mismatched types
-    //[stable2021]~| types differ in mutability
-    //[structural2021,structural2024]~| cannot match inherited `&` with `&mut` pattern
+    //[stable2021]~| NOTE types differ in mutability
+    //[structural2021,structural2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     #[cfg(any(classic2021, classic2024))] let _: u32 = x;
 
     let &[&mut ref x] = &&mut [0];
     //[stable2021,structural2021,structural2024]~^ ERROR: mismatched types
-    //[stable2021]~| expected integer, found `&mut _`
-    //[structural2021,structural2024]~| cannot match inherited `&` with `&mut` pattern
+    //[stable2021]~| NOTE expected integer, found `&mut _`
+    //[structural2021,structural2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     #[cfg(any(classic2021, classic2024))] let _: &u32 = x;
 
     let &[&mut ref x] = &mut &mut [0];
     //[stable2021,structural2021,structural2024]~^ ERROR: mismatched types
-    //[stable2021]~| types differ in mutability
-    //[structural2021,structural2024]~| cannot match inherited `&` with `&mut` pattern
+    //[stable2021]~| NOTE types differ in mutability
+    //[structural2021,structural2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     #[cfg(any(classic2021, classic2024))] let _: &u32 = x;
 
     let &[&mut mut x] = &&mut [0];
     //[stable2021,structural2021,structural2024]~^ ERROR: mismatched types
-    //[stable2021]~| expected integer, found `&mut _`
-    //[structural2021,structural2024]~| cannot match inherited `&` with `&mut` pattern
+    //[stable2021]~| NOTE expected integer, found `&mut _`
+    //[structural2021,structural2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     #[cfg(any(classic2021, classic2024))] let _: u32 = x;
 
     let &[&mut mut x] = &mut &mut [0];
     //[stable2021,structural2021,structural2024]~^ ERROR: mismatched types
-    //[stable2021]~| types differ in mutability
-    //[structural2021,structural2024]~| cannot match inherited `&` with `&mut` pattern
+    //[stable2021]~| NOTE types differ in mutability
+    //[structural2021,structural2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     #[cfg(any(classic2021, classic2024))] let _: u32 = x;
 }
 
@@ -113,69 +115,69 @@ fn structural_errors_1() {
 fn structural_errors_2() {
     let [&&mut x] = &[&mut 0];
     //[stable2021,classic2021,structural2021,structural2024]~^ ERROR: mismatched types
-    //[stable2021]~| types differ in mutability
-    //[classic2021,structural2021] expected integer, found `&mut _`
-    //[structural2024]~| cannot match inherited `&` with `&mut` pattern
+    //[stable2021]~| NOTE types differ in mutability
+    //[classic2021,structural2021] NOTE expected integer, found `&mut _`
+    //[structural2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     #[cfg(classic2024)] let _: u32 = x;
 
     let [&&mut x] = &mut [&mut 0];
     //[stable2021,classic2021,structural2021,structural2024]~^ ERROR: mismatched types
-    //[stable2021]~| types differ in mutability
-    //[classic2021,structural2021] expected integer, found `&mut _`
-    //[structural2024]~| cannot match inherited `&` with `&mut` pattern
+    //[stable2021]~| NOTE types differ in mutability
+    //[classic2021,structural2021] NOTE expected integer, found `&mut _`
+    //[structural2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     #[cfg(classic2024)] let _: u32 = x;
 
     let [&&mut ref x] = &[&mut 0];
     //[stable2021,classic2021,structural2021,structural2024]~^ ERROR: mismatched types
-    //[stable2021]~| types differ in mutability
-    //[classic2021,structural2021] expected integer, found `&mut _`
-    //[structural2024]~| cannot match inherited `&` with `&mut` pattern
+    //[stable2021]~| NOTE types differ in mutability
+    //[classic2021,structural2021] NOTE expected integer, found `&mut _`
+    //[structural2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     #[cfg(classic2024)] let _: &u32 = x;
 
     let [&&mut ref x] = &mut [&mut 0];
     //[stable2021,classic2021,structural2021,structural2024]~^ ERROR: mismatched types
-    //[stable2021]~| types differ in mutability
-    //[classic2021,structural2021] expected integer, found `&mut _`
-    //[structural2024]~| cannot match inherited `&` with `&mut` pattern
+    //[stable2021]~| NOTE types differ in mutability
+    //[classic2021,structural2021] NOTE expected integer, found `&mut _`
+    //[structural2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     #[cfg(classic2024)] let _: &u32 = x;
 
     let [&&mut mut x] = &[&mut 0];
     //[stable2021,classic2021,structural2021,structural2024]~^ ERROR: mismatched types
-    //[stable2021]~| types differ in mutability
-    //[classic2021,structural2021] expected integer, found `&mut _`
-    //[structural2024]~| cannot match inherited `&` with `&mut` pattern
+    //[stable2021]~| NOTE types differ in mutability
+    //[classic2021,structural2021] NOTE expected integer, found `&mut _`
+    //[structural2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     #[cfg(classic2024)] let _: u32 = x;
 
     let [&&mut mut x] = &mut [&mut 0];
     //[stable2021,classic2021,structural2021,structural2024]~^ ERROR: mismatched types
-    //[stable2021]~| types differ in mutability
-    //[classic2021,structural2021] expected integer, found `&mut _`
-    //[structural2024]~| cannot match inherited `&` with `&mut` pattern
+    //[stable2021]~| NOTE types differ in mutability
+    //[classic2021,structural2021] NOTE expected integer, found `&mut _`
+    //[structural2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     #[cfg(classic2024)] let _: u32 = x;
 }
 
 fn classic_errors_0() {
     let [&mut x] = &[&mut 0];
     //[classic2024]~^ ERROR: mismatched types
-    //[classic2024]~| cannot match inherited `&` with `&mut` pattern
+    //[classic2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     #[cfg(any(stable2021, classic2021, structural2021))] let _: u32 = x;
     #[cfg(structural2024)] let _: &u32 = x;
 
     let [&mut &x] = &[&mut 0];
     //[stable2021,classic2021,structural2021,classic2024]~^ ERROR: mismatched types
-    //[stable2021]~| expected integer, found `&_`
-    //[classic2024]~| cannot match inherited `&` with `&mut` pattern
+    //[stable2021]~| NOTE expected integer, found `&_`
+    //[classic2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     #[cfg(structural2024)] let _: u32 = x;
 
     let [&mut &ref x] = &[&mut 0];
     //[stable2021,classic2021,structural2021,classic2024]~^ ERROR: mismatched types
-    //[stable2021]~| expected integer, found `&_`
-    //[classic2024]~| cannot match inherited `&` with `&mut` pattern
+    //[stable2021]~| NOTE expected integer, found `&_`
+    //[classic2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     #[cfg(structural2024)] let _: &u32 = x;
 
     let [&mut &(mut x)] = &[&mut 0];
     //[stable2021,classic2021,structural2021,classic2024]~^ ERROR: mismatched types
-    //[stable2021]~| expected integer, found `&_`
-    //[classic2024]~| cannot match inherited `&` with `&mut` pattern
+    //[stable2021]~| NOTE expected integer, found `&_`
+    //[classic2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     #[cfg(structural2024)] let _: u32 = x;
 }
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.stable2021.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.stable2021.stderr
index 76e6d2f..8b32e4f 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.stable2021.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.stable2021.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:20:27
+  --> $DIR/pattern-errors.rs:22:27
    |
 LL |     if let Some(&mut Some(&x)) = &Some(&mut Some(0)) {
    |                           ^^     ------------------- this expression has type `&Option<&mut Option<{integer}>>`
@@ -15,7 +15,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:33:17
+  --> $DIR/pattern-errors.rs:35:17
    |
 LL |     if let Some(&mut Some(&_)) = &Some(&Some(0)) {
    |                 ^^^^^^^^^^^^^    --------------- this expression has type `&Option<&Option<{integer}>>`
@@ -26,7 +26,7 @@
            found mutable reference `&mut _`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:38:17
+  --> $DIR/pattern-errors.rs:40:17
    |
 LL |     if let Some(&Some(&mut x)) = &Some(&mut Some(0)) {
    |                 ^^^^^^^^^^^^^    ------------------- this expression has type `&Option<&mut Option<{integer}>>`
@@ -37,7 +37,7 @@
                       found reference `&_`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:45:23
+  --> $DIR/pattern-errors.rs:47:23
    |
 LL |     if let Some(&Some(&mut _)) = &mut Some(&Some(0)) {
    |                       ^^^^^^     ------------------- this expression has type `&mut Option<&Option<{integer}>>`
@@ -48,7 +48,7 @@
            found mutable reference `&mut _`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:50:17
+  --> $DIR/pattern-errors.rs:52:17
    |
 LL |     if let Some(&Some(Some(&mut x))) = &Some(Some(&mut Some(0))) {
    |                 ^^^^^^^^^^^^^^^^^^^    ------------------------- this expression has type `&Option<Option<&mut Option<{integer}>>>`
@@ -59,7 +59,7 @@
            found reference `&_`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:56:17
+  --> $DIR/pattern-errors.rs:58:17
    |
 LL |     if let Some(&mut Some(x)) = &Some(Some(0)) {
    |                 ^^^^^^^^^^^^    -------------- this expression has type `&Option<Option<{integer}>>`
@@ -70,7 +70,7 @@
            found mutable reference `&mut _`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:64:11
+  --> $DIR/pattern-errors.rs:66:11
    |
 LL |     let &[&mut x] = &&mut [0];
    |           ^^^^^^    --------- this expression has type `&&mut [{integer}; 1]`
@@ -80,7 +80,7 @@
    = note:           expected type `{integer}`
            found mutable reference `&mut _`
 note: to declare a mutable binding use: `mut x`
-  --> $DIR/pattern-errors.rs:64:11
+  --> $DIR/pattern-errors.rs:66:11
    |
 LL |     let &[&mut x] = &&mut [0];
    |           ^^^^^^
@@ -91,7 +91,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:70:9
+  --> $DIR/pattern-errors.rs:72:9
    |
 LL |     let &[&mut x] = &mut &mut [0];
    |         ^^^^^^^^^   ------------- this expression has type `&mut &mut [{integer}; 1]`
@@ -102,7 +102,7 @@
                       found reference `&_`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:76:11
+  --> $DIR/pattern-errors.rs:78:11
    |
 LL |     let &[&mut ref x] = &&mut [0];
    |           ^^^^^^^^^^    --------- this expression has type `&&mut [{integer}; 1]`
@@ -112,7 +112,7 @@
    = note:           expected type `{integer}`
            found mutable reference `&mut _`
 note: to declare a mutable binding use: `mut x`
-  --> $DIR/pattern-errors.rs:76:11
+  --> $DIR/pattern-errors.rs:78:11
    |
 LL |     let &[&mut ref x] = &&mut [0];
    |           ^^^^^^^^^^
@@ -123,7 +123,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:82:9
+  --> $DIR/pattern-errors.rs:84:9
    |
 LL |     let &[&mut ref x] = &mut &mut [0];
    |         ^^^^^^^^^^^^^   ------------- this expression has type `&mut &mut [{integer}; 1]`
@@ -134,7 +134,7 @@
                       found reference `&_`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:88:11
+  --> $DIR/pattern-errors.rs:90:11
    |
 LL |     let &[&mut mut x] = &&mut [0];
    |           ^^^^^^^^^^    --------- this expression has type `&&mut [{integer}; 1]`
@@ -144,7 +144,7 @@
    = note:           expected type `{integer}`
            found mutable reference `&mut _`
 note: to declare a mutable binding use: `mut x`
-  --> $DIR/pattern-errors.rs:88:11
+  --> $DIR/pattern-errors.rs:90:11
    |
 LL |     let &[&mut mut x] = &&mut [0];
    |           ^^^^^^^^^^
@@ -155,7 +155,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:94:9
+  --> $DIR/pattern-errors.rs:96:9
    |
 LL |     let &[&mut mut x] = &mut &mut [0];
    |         ^^^^^^^^^^^^^   ------------- this expression has type `&mut &mut [{integer}; 1]`
@@ -166,7 +166,7 @@
                       found reference `&_`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:114:10
+  --> $DIR/pattern-errors.rs:116:10
    |
 LL |     let [&&mut x] = &[&mut 0];
    |          ^^^^^^^    --------- this expression has type `&[&mut {integer}; 1]`
@@ -177,7 +177,7 @@
                       found reference `&_`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:121:10
+  --> $DIR/pattern-errors.rs:123:10
    |
 LL |     let [&&mut x] = &mut [&mut 0];
    |          ^^^^^^^    ------------- this expression has type `&mut [&mut {integer}; 1]`
@@ -188,7 +188,7 @@
                       found reference `&_`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:128:10
+  --> $DIR/pattern-errors.rs:130:10
    |
 LL |     let [&&mut ref x] = &[&mut 0];
    |          ^^^^^^^^^^^    --------- this expression has type `&[&mut {integer}; 1]`
@@ -199,7 +199,7 @@
                       found reference `&_`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:135:10
+  --> $DIR/pattern-errors.rs:137:10
    |
 LL |     let [&&mut ref x] = &mut [&mut 0];
    |          ^^^^^^^^^^^    ------------- this expression has type `&mut [&mut {integer}; 1]`
@@ -210,7 +210,7 @@
                       found reference `&_`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:142:10
+  --> $DIR/pattern-errors.rs:144:10
    |
 LL |     let [&&mut mut x] = &[&mut 0];
    |          ^^^^^^^^^^^    --------- this expression has type `&[&mut {integer}; 1]`
@@ -221,7 +221,7 @@
                       found reference `&_`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:149:10
+  --> $DIR/pattern-errors.rs:151:10
    |
 LL |     let [&&mut mut x] = &mut [&mut 0];
    |          ^^^^^^^^^^^    ------------- this expression has type `&mut [&mut {integer}; 1]`
@@ -232,7 +232,7 @@
                       found reference `&_`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:164:15
+  --> $DIR/pattern-errors.rs:166:15
    |
 LL |     let [&mut &x] = &[&mut 0];
    |               ^^    --------- this expression has type `&[&mut {integer}; 1]`
@@ -248,7 +248,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:170:15
+  --> $DIR/pattern-errors.rs:172:15
    |
 LL |     let [&mut &ref x] = &[&mut 0];
    |               ^^^^^^    --------- this expression has type `&[&mut {integer}; 1]`
@@ -264,7 +264,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:176:15
+  --> $DIR/pattern-errors.rs:178:15
    |
 LL |     let [&mut &(mut x)] = &[&mut 0];
    |               ^^^^^^^^    --------- this expression has type `&[&mut {integer}; 1]`
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.structural2021.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.structural2021.stderr
index 1ca6bff..09cff1f 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.structural2021.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.structural2021.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:20:27
+  --> $DIR/pattern-errors.rs:22:27
    |
 LL |     if let Some(&mut Some(&x)) = &Some(&mut Some(0)) {
    |                           ^^     ------------------- this expression has type `&Option<&mut Option<{integer}>>`
@@ -15,7 +15,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:33:17
+  --> $DIR/pattern-errors.rs:35:17
    |
 LL |     if let Some(&mut Some(&_)) = &Some(&Some(0)) {
    |                 ^^^^^^^^^^^^^    --------------- this expression has type `&Option<&Option<{integer}>>`
@@ -26,7 +26,7 @@
            found mutable reference `&mut _`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:38:23
+  --> $DIR/pattern-errors.rs:40:23
    |
 LL |     if let Some(&Some(&mut x)) = &Some(&mut Some(0)) {
    |                       ^^^^^^     ------------------- this expression has type `&Option<&mut Option<{integer}>>`
@@ -36,7 +36,7 @@
    = note:           expected type `{integer}`
            found mutable reference `&mut _`
 note: to declare a mutable binding use: `mut x`
-  --> $DIR/pattern-errors.rs:38:23
+  --> $DIR/pattern-errors.rs:40:23
    |
 LL |     if let Some(&Some(&mut x)) = &Some(&mut Some(0)) {
    |                       ^^^^^^
@@ -47,7 +47,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:45:23
+  --> $DIR/pattern-errors.rs:47:23
    |
 LL |     if let Some(&Some(&mut _)) = &mut Some(&Some(0)) {
    |                       ^^^^^^     ------------------- this expression has type `&mut Option<&Option<{integer}>>`
@@ -58,7 +58,7 @@
            found mutable reference `&mut _`
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:50:28
+  --> $DIR/pattern-errors.rs:52:28
    |
 LL |     if let Some(&Some(Some(&mut x))) = &Some(Some(&mut Some(0))) {
    |                            ^^^^^
@@ -71,7 +71,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:56:17
+  --> $DIR/pattern-errors.rs:58:17
    |
 LL |     if let Some(&mut Some(x)) = &Some(Some(0)) {
    |                 ^^^^^
@@ -84,7 +84,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:64:11
+  --> $DIR/pattern-errors.rs:66:11
    |
 LL |     let &[&mut x] = &&mut [0];
    |           ^^^^^
@@ -97,7 +97,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:70:11
+  --> $DIR/pattern-errors.rs:72:11
    |
 LL |     let &[&mut x] = &mut &mut [0];
    |           ^^^^^
@@ -110,7 +110,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:76:11
+  --> $DIR/pattern-errors.rs:78:11
    |
 LL |     let &[&mut ref x] = &&mut [0];
    |           ^^^^^
@@ -123,7 +123,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:82:11
+  --> $DIR/pattern-errors.rs:84:11
    |
 LL |     let &[&mut ref x] = &mut &mut [0];
    |           ^^^^^
@@ -136,7 +136,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:88:11
+  --> $DIR/pattern-errors.rs:90:11
    |
 LL |     let &[&mut mut x] = &&mut [0];
    |           ^^^^^
@@ -149,7 +149,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:94:11
+  --> $DIR/pattern-errors.rs:96:11
    |
 LL |     let &[&mut mut x] = &mut &mut [0];
    |           ^^^^^
@@ -162,7 +162,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:114:11
+  --> $DIR/pattern-errors.rs:116:11
    |
 LL |     let [&&mut x] = &[&mut 0];
    |           ^^^^^^    --------- this expression has type `&[&mut {integer}; 1]`
@@ -178,7 +178,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:121:11
+  --> $DIR/pattern-errors.rs:123:11
    |
 LL |     let [&&mut x] = &mut [&mut 0];
    |           ^^^^^^    ------------- this expression has type `&mut [&mut {integer}; 1]`
@@ -194,7 +194,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:128:11
+  --> $DIR/pattern-errors.rs:130:11
    |
 LL |     let [&&mut ref x] = &[&mut 0];
    |           ^^^^^^^^^^    --------- this expression has type `&[&mut {integer}; 1]`
@@ -210,7 +210,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:135:11
+  --> $DIR/pattern-errors.rs:137:11
    |
 LL |     let [&&mut ref x] = &mut [&mut 0];
    |           ^^^^^^^^^^    ------------- this expression has type `&mut [&mut {integer}; 1]`
@@ -226,7 +226,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:142:11
+  --> $DIR/pattern-errors.rs:144:11
    |
 LL |     let [&&mut mut x] = &[&mut 0];
    |           ^^^^^^^^^^    --------- this expression has type `&[&mut {integer}; 1]`
@@ -242,7 +242,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:149:11
+  --> $DIR/pattern-errors.rs:151:11
    |
 LL |     let [&&mut mut x] = &mut [&mut 0];
    |           ^^^^^^^^^^    ------------- this expression has type `&mut [&mut {integer}; 1]`
@@ -258,7 +258,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:164:15
+  --> $DIR/pattern-errors.rs:166:15
    |
 LL |     let [&mut &x] = &[&mut 0];
    |               ^^    --------- this expression has type `&[&mut {integer}; 1]`
@@ -274,7 +274,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:170:15
+  --> $DIR/pattern-errors.rs:172:15
    |
 LL |     let [&mut &ref x] = &[&mut 0];
    |               ^^^^^^    --------- this expression has type `&[&mut {integer}; 1]`
@@ -290,7 +290,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:176:15
+  --> $DIR/pattern-errors.rs:178:15
    |
 LL |     let [&mut &(mut x)] = &[&mut 0];
    |               ^^^^^^^^    --------- this expression has type `&[&mut {integer}; 1]`
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.structural2024.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.structural2024.stderr
index 3658893..d3d2c47 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.structural2024.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/pattern-errors.structural2024.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:33:17
+  --> $DIR/pattern-errors.rs:35:17
    |
 LL |     if let Some(&mut Some(&_)) = &Some(&Some(0)) {
    |                 ^^^^^
@@ -12,7 +12,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:38:23
+  --> $DIR/pattern-errors.rs:40:23
    |
 LL |     if let Some(&Some(&mut x)) = &Some(&mut Some(0)) {
    |                       ^^^^^
@@ -25,7 +25,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:45:23
+  --> $DIR/pattern-errors.rs:47:23
    |
 LL |     if let Some(&Some(&mut _)) = &mut Some(&Some(0)) {
    |                       ^^^^^
@@ -38,7 +38,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:50:28
+  --> $DIR/pattern-errors.rs:52:28
    |
 LL |     if let Some(&Some(Some(&mut x))) = &Some(Some(&mut Some(0))) {
    |                            ^^^^^
@@ -51,7 +51,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:56:17
+  --> $DIR/pattern-errors.rs:58:17
    |
 LL |     if let Some(&mut Some(x)) = &Some(Some(0)) {
    |                 ^^^^^
@@ -64,7 +64,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:64:11
+  --> $DIR/pattern-errors.rs:66:11
    |
 LL |     let &[&mut x] = &&mut [0];
    |           ^^^^^
@@ -77,7 +77,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:70:11
+  --> $DIR/pattern-errors.rs:72:11
    |
 LL |     let &[&mut x] = &mut &mut [0];
    |           ^^^^^
@@ -90,7 +90,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:76:11
+  --> $DIR/pattern-errors.rs:78:11
    |
 LL |     let &[&mut ref x] = &&mut [0];
    |           ^^^^^
@@ -103,7 +103,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:82:11
+  --> $DIR/pattern-errors.rs:84:11
    |
 LL |     let &[&mut ref x] = &mut &mut [0];
    |           ^^^^^
@@ -116,7 +116,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:88:11
+  --> $DIR/pattern-errors.rs:90:11
    |
 LL |     let &[&mut mut x] = &&mut [0];
    |           ^^^^^
@@ -129,7 +129,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:94:11
+  --> $DIR/pattern-errors.rs:96:11
    |
 LL |     let &[&mut mut x] = &mut &mut [0];
    |           ^^^^^
@@ -142,7 +142,7 @@
    |
 
 error[E0658]: binding cannot be both mutable and by-reference
-  --> $DIR/pattern-errors.rs:102:12
+  --> $DIR/pattern-errors.rs:104:12
    |
 LL |     let [&(mut x)] = &[&0];
    |            ^^^^
@@ -152,7 +152,7 @@
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: binding cannot be both mutable and by-reference
-  --> $DIR/pattern-errors.rs:107:12
+  --> $DIR/pattern-errors.rs:109:12
    |
 LL |     let [&(mut x)] = &mut [&0];
    |            ^^^^
@@ -162,7 +162,7 @@
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:114:11
+  --> $DIR/pattern-errors.rs:116:11
    |
 LL |     let [&&mut x] = &[&mut 0];
    |           ^^^^^
@@ -175,7 +175,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:121:11
+  --> $DIR/pattern-errors.rs:123:11
    |
 LL |     let [&&mut x] = &mut [&mut 0];
    |           ^^^^^
@@ -188,7 +188,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:128:11
+  --> $DIR/pattern-errors.rs:130:11
    |
 LL |     let [&&mut ref x] = &[&mut 0];
    |           ^^^^^
@@ -201,7 +201,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:135:11
+  --> $DIR/pattern-errors.rs:137:11
    |
 LL |     let [&&mut ref x] = &mut [&mut 0];
    |           ^^^^^
@@ -214,7 +214,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:142:11
+  --> $DIR/pattern-errors.rs:144:11
    |
 LL |     let [&&mut mut x] = &[&mut 0];
    |           ^^^^^
@@ -227,7 +227,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pattern-errors.rs:149:11
+  --> $DIR/pattern-errors.rs:151:11
    |
 LL |     let [&&mut mut x] = &mut [&mut 0];
    |           ^^^^^
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.classic2021.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.classic2021.stderr
index 1dda2dc..dbb8ae8 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.classic2021.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.classic2021.stderr
@@ -1,5 +1,5 @@
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:71:10
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:73:10
    |
 LL |     let [ref mut x] = &[0];
    |          ^^^^^^^^^ cannot borrow as mutable
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.classic2024.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.classic2024.stderr
index 44cb005..04e53e0 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.classic2024.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.classic2024.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:58:10
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:60:10
    |
 LL |     let [&mut ref x] = &[&mut 0];
    |          ^^^^^
@@ -12,14 +12,14 @@
    |
 
 error: binding modifiers may only be written when the default binding mode is `move`
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:71:10
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:73:10
    |
 LL |     let [ref mut x] = &[0];
    |          ^^^^^^^ binding modifier not allowed under `ref` default binding mode
    |
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
 note: matching on a reference type with a non-reference pattern changes the default binding mode
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:71:9
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:73:9
    |
 LL |     let [ref mut x] = &[0];
    |         ^^^^^^^^^^^ this matches on type `&_`
@@ -29,20 +29,20 @@
    |         +
 
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:71:10
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:73:10
    |
 LL |     let [ref mut x] = &[0];
    |          ^^^^^^^^^ cannot borrow as mutable
 
 error: binding modifiers may only be written when the default binding mode is `move`
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:79:10
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:81:10
    |
 LL |     let [ref x] = &[0];
    |          ^^^ binding modifier not allowed under `ref` default binding mode
    |
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
 note: matching on a reference type with a non-reference pattern changes the default binding mode
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:79:9
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:81:9
    |
 LL |     let [ref x] = &[0];
    |         ^^^^^^^ this matches on type `&_`
@@ -52,14 +52,14 @@
    |         +
 
 error: binding modifiers may only be written when the default binding mode is `move`
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:83:10
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:85:10
    |
 LL |     let [ref x] = &mut [0];
    |          ^^^ binding modifier not allowed under `ref mut` default binding mode
    |
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
 note: matching on a reference type with a non-reference pattern changes the default binding mode
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:83:9
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:85:9
    |
 LL |     let [ref x] = &mut [0];
    |         ^^^^^^^ this matches on type `&mut _`
@@ -69,14 +69,14 @@
    |         ++++
 
 error: binding modifiers may only be written when the default binding mode is `move`
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:87:10
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:89:10
    |
 LL |     let [ref mut x] = &mut [0];
    |          ^^^^^^^ binding modifier not allowed under `ref mut` default binding mode
    |
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
 note: matching on a reference type with a non-reference pattern changes the default binding mode
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:87:9
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:89:9
    |
 LL |     let [ref mut x] = &mut [0];
    |         ^^^^^^^^^^^ this matches on type `&mut _`
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.rs
index ea6f028..c9e3f75 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.rs
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.rs
@@ -4,6 +4,8 @@
 //@[structural2021] edition: 2021
 //@[classic2024] edition: 2024
 //@[structural2024] edition: 2024
+//@ dont-require-annotations: NOTE
+
 //! Tests for errors from binding with `ref x` under a by-ref default binding mode in edition 2024.
 //! These can't be in the same body as tests for other errors, since they're emitted during THIR
 //! construction. The errors on stable edition 2021 Rust are unrelated.
@@ -40,14 +42,14 @@ fn errors_from_eating_the_real_reference() {
 fn errors_from_eating_the_real_reference_caught_in_hir_typeck_on_stable() {
     let [&ref x] = &[&mut 0];
     //[stable2021]~^ ERROR: mismatched types
-    //[stable2021]~| types differ in mutability
+    //[stable2021]~| NOTE types differ in mutability
     //[structural2024]~^^^ ERROR: binding modifiers may only be written when the default binding mode is `move`
     #[cfg(any(classic2021, structural2021))] let _: &u32 = x;
     #[cfg(classic2024)] let _: &&mut u32 = x;
 
     let [&ref x] = &mut [&mut 0];
     //[stable2021]~^ ERROR: mismatched types
-    //[stable2021]~| types differ in mutability
+    //[stable2021]~| NOTE types differ in mutability
     //[structural2024]~^^^ ERROR: binding modifiers may only be written when the default binding mode is `move`
     #[cfg(any(classic2021, structural2021))] let _: &u32 = x;
     #[cfg(classic2024)] let _: &&mut u32 = x;
@@ -57,7 +59,7 @@ fn errors_from_eating_the_real_reference_caught_in_hir_typeck_on_stable() {
 fn errors_dependent_on_eating_order_caught_in_hir_typeck_when_eating_outer() {
     let [&mut ref x] = &[&mut 0];
     //[classic2024]~^ ERROR: mismatched types
-    //[classic2024]~| cannot match inherited `&` with `&mut` pattern
+    //[classic2024]~| NOTE cannot match inherited `&` with `&mut` pattern
     //[structural2024]~^^^ ERROR: binding modifiers may only be written when the default binding mode is `move`
     #[cfg(any(stable2021, classic2021, structural2021))] let _: &u32 = x;
 }
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.stable2021.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.stable2021.stderr
index 2ec6650..33119c4 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.stable2021.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.stable2021.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:41:10
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:43:10
    |
 LL |     let [&ref x] = &[&mut 0];
    |          ^^^^^^    --------- this expression has type `&[&mut {integer}; 1]`
@@ -15,7 +15,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:48:10
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:50:10
    |
 LL |     let [&ref x] = &mut [&mut 0];
    |          ^^^^^^    ------------- this expression has type `&mut [&mut {integer}; 1]`
@@ -31,7 +31,7 @@
    |
 
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:71:10
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:73:10
    |
 LL |     let [ref mut x] = &[0];
    |          ^^^^^^^^^ cannot borrow as mutable
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.structural2021.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.structural2021.stderr
index 1dda2dc..dbb8ae8 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.structural2021.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.structural2021.stderr
@@ -1,5 +1,5 @@
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:71:10
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:73:10
    |
 LL |     let [ref mut x] = &[0];
    |          ^^^^^^^^^ cannot borrow as mutable
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.structural2024.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.structural2024.stderr
index 6f62ad0..def6deb 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.structural2024.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/ref-binding-on-inh-ref-errors.structural2024.stderr
@@ -1,12 +1,12 @@
 error: binding modifiers may only be written when the default binding mode is `move`
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:17:11
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:19:11
    |
 LL |     let [&ref x] = &[&0];
    |           ^^^ binding modifier not allowed under `ref` default binding mode
    |
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
 note: matching on a reference type with a non-reference pattern changes the default binding mode
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:17:9
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:19:9
    |
 LL |     let [&ref x] = &[&0];
    |         ^^^^^^^^ this matches on type `&_`
@@ -16,14 +16,14 @@
    |         +
 
 error: binding modifiers may only be written when the default binding mode is `move`
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:22:11
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:24:11
    |
 LL |     let [&ref x] = &mut [&0];
    |           ^^^ binding modifier not allowed under `ref` default binding mode
    |
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
 note: matching on a reference type with a non-reference pattern changes the default binding mode
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:22:9
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:24:9
    |
 LL |     let [&ref x] = &mut [&0];
    |         ^^^^^^^^ this matches on type `&mut _`
@@ -33,14 +33,14 @@
    |         ++++
 
 error: binding modifiers may only be written when the default binding mode is `move`
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:27:15
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:29:15
    |
 LL |     let [&mut ref x] = &mut [&mut 0];
    |               ^^^ binding modifier not allowed under `ref mut` default binding mode
    |
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
 note: matching on a reference type with a non-reference pattern changes the default binding mode
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:27:9
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:29:9
    |
 LL |     let [&mut ref x] = &mut [&mut 0];
    |         ^^^^^^^^^^^^ this matches on type `&mut _`
@@ -50,14 +50,14 @@
    |         ++++
 
 error: binding modifiers may only be written when the default binding mode is `move`
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:32:15
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:34:15
    |
 LL |     let [&mut ref mut x] = &mut [&mut 0];
    |               ^^^^^^^ binding modifier not allowed under `ref mut` default binding mode
    |
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
 note: matching on a reference type with a non-reference pattern changes the default binding mode
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:32:9
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:34:9
    |
 LL |     let [&mut ref mut x] = &mut [&mut 0];
    |         ^^^^^^^^^^^^^^^^ this matches on type `&mut _`
@@ -67,14 +67,14 @@
    |         ++++
 
 error: binding modifiers may only be written when the default binding mode is `move`
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:41:11
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:43:11
    |
 LL |     let [&ref x] = &[&mut 0];
    |           ^^^ binding modifier not allowed under `ref` default binding mode
    |
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
 note: matching on a reference type with a non-reference pattern changes the default binding mode
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:41:9
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:43:9
    |
 LL |     let [&ref x] = &[&mut 0];
    |         ^^^^^^^^ this matches on type `&_`
@@ -84,14 +84,14 @@
    |         +
 
 error: binding modifiers may only be written when the default binding mode is `move`
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:48:11
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:50:11
    |
 LL |     let [&ref x] = &mut [&mut 0];
    |           ^^^ binding modifier not allowed under `ref` default binding mode
    |
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
 note: matching on a reference type with a non-reference pattern changes the default binding mode
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:48:9
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:50:9
    |
 LL |     let [&ref x] = &mut [&mut 0];
    |         ^^^^^^^^ this matches on type `&mut _`
@@ -101,14 +101,14 @@
    |         ++++
 
 error: binding modifiers may only be written when the default binding mode is `move`
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:58:15
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:60:15
    |
 LL |     let [&mut ref x] = &[&mut 0];
    |               ^^^ binding modifier not allowed under `ref` default binding mode
    |
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
 note: matching on a reference type with a non-reference pattern changes the default binding mode
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:58:9
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:60:9
    |
 LL |     let [&mut ref x] = &[&mut 0];
    |         ^^^^^^^^^^^^ this matches on type `&_`
@@ -118,14 +118,14 @@
    |         +
 
 error: binding modifiers may only be written when the default binding mode is `move`
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:71:10
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:73:10
    |
 LL |     let [ref mut x] = &[0];
    |          ^^^^^^^ binding modifier not allowed under `ref` default binding mode
    |
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
 note: matching on a reference type with a non-reference pattern changes the default binding mode
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:71:9
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:73:9
    |
 LL |     let [ref mut x] = &[0];
    |         ^^^^^^^^^^^ this matches on type `&_`
@@ -135,20 +135,20 @@
    |         +
 
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:71:10
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:73:10
    |
 LL |     let [ref mut x] = &[0];
    |          ^^^^^^^^^ cannot borrow as mutable
 
 error: binding modifiers may only be written when the default binding mode is `move`
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:79:10
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:81:10
    |
 LL |     let [ref x] = &[0];
    |          ^^^ binding modifier not allowed under `ref` default binding mode
    |
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
 note: matching on a reference type with a non-reference pattern changes the default binding mode
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:79:9
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:81:9
    |
 LL |     let [ref x] = &[0];
    |         ^^^^^^^ this matches on type `&_`
@@ -158,14 +158,14 @@
    |         +
 
 error: binding modifiers may only be written when the default binding mode is `move`
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:83:10
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:85:10
    |
 LL |     let [ref x] = &mut [0];
    |          ^^^ binding modifier not allowed under `ref mut` default binding mode
    |
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
 note: matching on a reference type with a non-reference pattern changes the default binding mode
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:83:9
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:85:9
    |
 LL |     let [ref x] = &mut [0];
    |         ^^^^^^^ this matches on type `&mut _`
@@ -175,14 +175,14 @@
    |         ++++
 
 error: binding modifiers may only be written when the default binding mode is `move`
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:87:10
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:89:10
    |
 LL |     let [ref mut x] = &mut [0];
    |          ^^^^^^^ binding modifier not allowed under `ref mut` default binding mode
    |
    = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html>
 note: matching on a reference type with a non-reference pattern changes the default binding mode
-  --> $DIR/ref-binding-on-inh-ref-errors.rs:87:9
+  --> $DIR/ref-binding-on-inh-ref-errors.rs:89:9
    |
 LL |     let [ref mut x] = &mut [0];
    |         ^^^^^^^^^^^ this matches on type `&mut _`
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.classic2021.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.classic2021.stderr
index f8c2bd9..9bf5c95 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.classic2021.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.classic2021.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:32:23
+  --> $DIR/well-typed-edition-2024.rs:34:23
    |
 LL |     if let Some(Some(&&x)) = &Some(Some(&0)) {
    |                       ^^     --------------- this expression has type `&Option<Option<&{integer}>>`
@@ -15,7 +15,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:63:23
+  --> $DIR/well-typed-edition-2024.rs:65:23
    |
 LL |     if let Some(&Some(&x)) = &Some(&Some(0)) {
    |                       ^^     --------------- this expression has type `&Option<&Option<{integer}>>`
@@ -31,7 +31,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:82:23
+  --> $DIR/well-typed-edition-2024.rs:84:23
    |
 LL |     if let Some(&Some(&x)) = &Some(&mut Some(0)) {
    |                       ^^     ------------------- this expression has type `&Option<&mut Option<{integer}>>`
@@ -47,7 +47,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:88:23
+  --> $DIR/well-typed-edition-2024.rs:90:23
    |
 LL |     if let Some(&Some(&x)) = &mut Some(&Some(0)) {
    |                       ^^     ------------------- this expression has type `&mut Option<&Option<{integer}>>`
@@ -63,7 +63,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:123:15
+  --> $DIR/well-typed-edition-2024.rs:125:15
    |
 LL |     let [&mut &x] = &mut [&0];
    |               ^^    --------- this expression has type `&mut [&{integer}; 1]`
@@ -79,7 +79,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:129:15
+  --> $DIR/well-typed-edition-2024.rs:131:15
    |
 LL |     let [&mut &ref x] = &mut [&0];
    |               ^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
@@ -95,7 +95,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:135:15
+  --> $DIR/well-typed-edition-2024.rs:137:15
    |
 LL |     let [&mut &(mut x)] = &mut [&0];
    |               ^^^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
@@ -111,7 +111,7 @@
    |
 
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/well-typed-edition-2024.rs:109:19
+  --> $DIR/well-typed-edition-2024.rs:111:19
    |
 LL |         let [&mut ref mut x] = &mut [&0];
    |                   ^^^^^^^^^ cannot borrow as mutable
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.rs b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.rs
index 877b10d..e2913e0 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.rs
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.rs
@@ -6,6 +6,8 @@
 //@[structural2024] edition: 2024
 //@[classic2024] run-pass
 //@[structural2024] run-pass
+//@ dont-require-annotations: NOTE
+
 //! Test cases for well-typed patterns in edition 2024. These are in their own file to ensure we
 //! pass both HIR typeck and MIR borrowck, as we may skip the latter if grouped with failing tests.
 #![allow(incomplete_features, unused_mut)]
@@ -31,63 +33,63 @@ pub fn main() {
     }
     if let Some(Some(&&x)) = &Some(Some(&0)) {
         //[stable2021,classic2021,structural2021]~^ ERROR mismatched types
-        //[stable2021,classic2021,structural2021]~| expected integer, found `&_`
+        //[stable2021,classic2021,structural2021]~| NOTE expected integer, found `&_`
         #[cfg(any(classic2024, structural2024))] let _: u32 = x;
     }
 
     // Tests for eating a lone inherited reference
     if let Some(Some(&x)) = &Some(&Some(0)) {
         //[stable2021]~^ ERROR mismatched types
-        //[stable2021]~| expected integer, found `&_`
+        //[stable2021]~| NOTE expected integer, found `&_`
         #[cfg(any(classic2021, structural2021, classic2024, structural2024))] let _: u32 = x;
     }
     if let Some(&Some(x)) = &Some(Some(0)) {
         //[stable2021]~^ ERROR mismatched types
-        //[stable2021]~| expected `Option<{integer}>`, found `&_`
+        //[stable2021]~| NOTE expected `Option<{integer}>`, found `&_`
         #[cfg(any(classic2021, structural2021, classic2024, structural2024))] let _: u32 = x;
     }
     if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) {
         //[stable2021]~^ ERROR mismatched types
-        //[stable2021]~| expected integer, found `&mut _`
+        //[stable2021]~| NOTE expected integer, found `&mut _`
         #[cfg(any(classic2021, structural2021, classic2024, structural2024))] let _: u32 = x;
     }
 
     // Tests for `&` patterns matching real `&mut` reference types
     if let Some(&Some(&x)) = Some(&Some(&mut 0)) {
         //[stable2021]~^ ERROR mismatched types
-        //[stable2021]~| types differ in mutability
+        //[stable2021]~| NOTE types differ in mutability
         #[cfg(any(classic2021, structural2021, classic2024, structural2024))] let _: u32 = x;
     }
 
     // Tests for eating only one layer and also eating a lone inherited reference
     if let Some(&Some(&x)) = &Some(&Some(0)) {
         //[stable2021,classic2021,structural2021]~^ ERROR mismatched types
-        //[stable2021,classic2021,structural2021]~| expected integer, found `&_`
+        //[stable2021,classic2021,structural2021]~| NOTE expected integer, found `&_`
         #[cfg(any(classic2024, structural2024))] let _: u32 = x;
     }
 
     // Tests for `&` matching a lone inherited possibly-`&mut` reference
     if let Some(&Some(Some(&x))) = &Some(Some(&mut Some(0))) {
         //[stable2021]~^ ERROR mismatched types
-        //[stable2021]~| expected `Option<&mut Option<{integer}>>`, found `&_`
+        //[stable2021]~| NOTE expected `Option<&mut Option<{integer}>>`, found `&_`
         #[cfg(any(classic2021, structural2021, classic2024, structural2024))] let _: u32 = x;
     }
     if let Some(&Some(x)) = &mut Some(Some(0)) {
         //[stable2021]~^ ERROR mismatched types
-        //[stable2021]~| expected `Option<{integer}>`, found `&_`
+        //[stable2021]~| NOTE expected `Option<{integer}>`, found `&_`
         #[cfg(any(classic2021, structural2021, classic2024, structural2024))] let _: u32 = x;
     }
 
     // Tests eating one layer, eating a lone inherited ref, and `&` eating `&mut` (realness varies)
     if let Some(&Some(&x)) = &Some(&mut Some(0)) {
         //[stable2021,classic2021,structural2021]~^ ERROR mismatched types
-        //[stable2021]~| types differ in mutability
-        //[classic2021,structural2021]~| expected integer, found `&_`
+        //[stable2021]~| NOTE types differ in mutability
+        //[classic2021,structural2021]~| NOTE expected integer, found `&_`
         #[cfg(any(classic2024, structural2024))] let _: u32 = x;
     }
     if let Some(&Some(&x)) = &mut Some(&Some(0)) {
         //[stable2021,classic2021,structural2021]~^ ERROR mismatched types
-        //[stable2021,classic2021,structural2021]~| expected integer, found `&_`
+        //[stable2021,classic2021,structural2021]~| NOTE expected integer, found `&_`
         #[cfg(any(classic2024, structural2024))] let _: u32 = x;
     }
 
@@ -95,20 +97,20 @@ pub fn main() {
     // inner reference causes a mutability mismatch. i.e. tests for "fallback-to-outer" deref rules.
     let [&mut x] = &mut [&0];
     //[stable2021]~^ ERROR mismatched types
-    //[stable2021]~| types differ in mutability
+    //[stable2021]~| NOTE types differ in mutability
     #[cfg(any(classic2021, structural2021))] let _: u32 = x;
     #[cfg(any(classic2024, structural2024))] let _: &u32 = x;
 
     let [&mut ref x] = &mut [&0];
     //[stable2021]~^ ERROR mismatched types
-    //[stable2021]~| types differ in mutability
+    //[stable2021]~| NOTE types differ in mutability
     #[cfg(any(classic2021, structural2021))] let _: &u32 = x;
     #[cfg(any(classic2024, structural2024))] let _: &&u32 = x;
 
     fn borrowck_error_on_structural2021() {
         let [&mut ref mut x] = &mut [&0];
         //[stable2021]~^ ERROR mismatched types
-        //[stable2021]~| types differ in mutability
+        //[stable2021]~| NOTE types differ in mutability
         //[classic2021,structural2021]~^^^ ERROR cannot borrow data in a `&` reference as mutable
         #[cfg(any(classic2024, structural2024))] let _: &mut &u32 = x;
     }
@@ -116,25 +118,25 @@ fn borrowck_error_on_structural2021() {
 
     let [&mut mut x] = &mut [&0];
     //[stable2021]~^ ERROR mismatched types
-    //[stable2021]~| types differ in mutability
+    //[stable2021]~| NOTE types differ in mutability
     #[cfg(any(classic2021, structural2021))] let _: u32 = x;
     #[cfg(any(classic2024, structural2024))] let _: &u32 = x;
 
     let [&mut &x] = &mut [&0];
     //[stable2021,classic2021,structural2021]~^ ERROR mismatched types
-    //[stable2021]~| types differ in mutability
-    //[classic2021,structural2021]~| expected integer, found `&_`
+    //[stable2021]~| NOTE types differ in mutability
+    //[classic2021,structural2021]~| NOTE expected integer, found `&_`
     #[cfg(any(classic2024, structural2024))] let _: u32 = x;
 
     let [&mut &ref x] = &mut [&0];
     //[stable2021,classic2021,structural2021]~^ ERROR mismatched types
-    //[stable2021]~| types differ in mutability
-    //[classic2021,structural2021]~| expected integer, found `&_`
+    //[stable2021]~| NOTE types differ in mutability
+    //[classic2021,structural2021]~| NOTE expected integer, found `&_`
     #[cfg(any(classic2024, structural2024))] let _: &u32 = x;
 
     let [&mut &(mut x)] = &mut [&0];
     //[stable2021,classic2021,structural2021]~^ ERROR mismatched types
-    //[stable2021]~| types differ in mutability
-    //[classic2021,structural2021]~| expected integer, found `&_`
+    //[stable2021]~| NOTE types differ in mutability
+    //[classic2021,structural2021]~| NOTE expected integer, found `&_`
     #[cfg(any(classic2024, structural2024))] let _: u32 = x;
 }
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.stable2021.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.stable2021.stderr
index adb4717..4f9dfaf 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.stable2021.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.stable2021.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:32:23
+  --> $DIR/well-typed-edition-2024.rs:34:23
    |
 LL |     if let Some(Some(&&x)) = &Some(Some(&0)) {
    |                       ^^     --------------- this expression has type `&Option<Option<&{integer}>>`
@@ -15,7 +15,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:39:22
+  --> $DIR/well-typed-edition-2024.rs:41:22
    |
 LL |     if let Some(Some(&x)) = &Some(&Some(0)) {
    |                      ^^     --------------- this expression has type `&Option<&Option<{integer}>>`
@@ -31,7 +31,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:44:17
+  --> $DIR/well-typed-edition-2024.rs:46:17
    |
 LL |     if let Some(&Some(x)) = &Some(Some(0)) {
    |                 ^^^^^^^^    -------------- this expression has type `&Option<Option<{integer}>>`
@@ -42,7 +42,7 @@
            found reference `&_`
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:49:22
+  --> $DIR/well-typed-edition-2024.rs:51:22
    |
 LL |     if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) {
    |                      ^^^^^^     ----------------------- this expression has type `&mut Option<&mut Option<{integer}>>`
@@ -52,7 +52,7 @@
    = note:           expected type `{integer}`
            found mutable reference `&mut _`
 note: to declare a mutable binding use: `mut x`
-  --> $DIR/well-typed-edition-2024.rs:49:22
+  --> $DIR/well-typed-edition-2024.rs:51:22
    |
 LL |     if let Some(Some(&mut x)) = &mut Some(&mut Some(0)) {
    |                      ^^^^^^
@@ -63,7 +63,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:56:23
+  --> $DIR/well-typed-edition-2024.rs:58:23
    |
 LL |     if let Some(&Some(&x)) = Some(&Some(&mut 0)) {
    |                       ^^     ------------------- this expression has type `Option<&Option<&mut {integer}>>`
@@ -79,7 +79,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:63:23
+  --> $DIR/well-typed-edition-2024.rs:65:23
    |
 LL |     if let Some(&Some(&x)) = &Some(&Some(0)) {
    |                       ^^     --------------- this expression has type `&Option<&Option<{integer}>>`
@@ -95,7 +95,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:70:17
+  --> $DIR/well-typed-edition-2024.rs:72:17
    |
 LL |     if let Some(&Some(Some(&x))) = &Some(Some(&mut Some(0))) {
    |                 ^^^^^^^^^^^^^^^    ------------------------- this expression has type `&Option<Option<&mut Option<{integer}>>>`
@@ -106,7 +106,7 @@
            found reference `&_`
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:75:17
+  --> $DIR/well-typed-edition-2024.rs:77:17
    |
 LL |     if let Some(&Some(x)) = &mut Some(Some(0)) {
    |                 ^^^^^^^^    ------------------ this expression has type `&mut Option<Option<{integer}>>`
@@ -117,7 +117,7 @@
            found reference `&_`
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:82:17
+  --> $DIR/well-typed-edition-2024.rs:84:17
    |
 LL |     if let Some(&Some(&x)) = &Some(&mut Some(0)) {
    |                 ^^^^^^^^^    ------------------- this expression has type `&Option<&mut Option<{integer}>>`
@@ -128,7 +128,7 @@
                       found reference `&_`
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:88:23
+  --> $DIR/well-typed-edition-2024.rs:90:23
    |
 LL |     if let Some(&Some(&x)) = &mut Some(&Some(0)) {
    |                       ^^     ------------------- this expression has type `&mut Option<&Option<{integer}>>`
@@ -144,7 +144,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:96:10
+  --> $DIR/well-typed-edition-2024.rs:98:10
    |
 LL |     let [&mut x] = &mut [&0];
    |          ^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
@@ -154,7 +154,7 @@
    = note:      expected reference `&{integer}`
            found mutable reference `&mut _`
 note: to declare a mutable binding use: `mut x`
-  --> $DIR/well-typed-edition-2024.rs:96:10
+  --> $DIR/well-typed-edition-2024.rs:98:10
    |
 LL |     let [&mut x] = &mut [&0];
    |          ^^^^^^
@@ -165,7 +165,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:102:10
+  --> $DIR/well-typed-edition-2024.rs:104:10
    |
 LL |     let [&mut ref x] = &mut [&0];
    |          ^^^^^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
@@ -175,7 +175,7 @@
    = note:      expected reference `&{integer}`
            found mutable reference `&mut _`
 note: to declare a mutable binding use: `mut x`
-  --> $DIR/well-typed-edition-2024.rs:102:10
+  --> $DIR/well-typed-edition-2024.rs:104:10
    |
 LL |     let [&mut ref x] = &mut [&0];
    |          ^^^^^^^^^^
@@ -186,7 +186,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:117:10
+  --> $DIR/well-typed-edition-2024.rs:119:10
    |
 LL |     let [&mut mut x] = &mut [&0];
    |          ^^^^^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
@@ -196,7 +196,7 @@
    = note:      expected reference `&{integer}`
            found mutable reference `&mut _`
 note: to declare a mutable binding use: `mut x`
-  --> $DIR/well-typed-edition-2024.rs:117:10
+  --> $DIR/well-typed-edition-2024.rs:119:10
    |
 LL |     let [&mut mut x] = &mut [&0];
    |          ^^^^^^^^^^
@@ -207,7 +207,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:123:10
+  --> $DIR/well-typed-edition-2024.rs:125:10
    |
 LL |     let [&mut &x] = &mut [&0];
    |          ^^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
@@ -218,7 +218,7 @@
            found mutable reference `&mut _`
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:129:10
+  --> $DIR/well-typed-edition-2024.rs:131:10
    |
 LL |     let [&mut &ref x] = &mut [&0];
    |          ^^^^^^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
@@ -229,7 +229,7 @@
            found mutable reference `&mut _`
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:135:10
+  --> $DIR/well-typed-edition-2024.rs:137:10
    |
 LL |     let [&mut &(mut x)] = &mut [&0];
    |          ^^^^^^^^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
@@ -240,7 +240,7 @@
            found mutable reference `&mut _`
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:109:14
+  --> $DIR/well-typed-edition-2024.rs:111:14
    |
 LL |         let [&mut ref mut x] = &mut [&0];
    |              ^^^^^^^^^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
@@ -250,7 +250,7 @@
    = note:      expected reference `&{integer}`
            found mutable reference `&mut _`
 note: to declare a mutable binding use: `mut x`
-  --> $DIR/well-typed-edition-2024.rs:109:14
+  --> $DIR/well-typed-edition-2024.rs:111:14
    |
 LL |         let [&mut ref mut x] = &mut [&0];
    |              ^^^^^^^^^^^^^^
diff --git a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.structural2021.stderr b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.structural2021.stderr
index f8c2bd9..9bf5c95 100644
--- a/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.structural2021.stderr
+++ b/tests/ui/pattern/rfc-3627-match-ergonomics-2024/experimental/well-typed-edition-2024.structural2021.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:32:23
+  --> $DIR/well-typed-edition-2024.rs:34:23
    |
 LL |     if let Some(Some(&&x)) = &Some(Some(&0)) {
    |                       ^^     --------------- this expression has type `&Option<Option<&{integer}>>`
@@ -15,7 +15,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:63:23
+  --> $DIR/well-typed-edition-2024.rs:65:23
    |
 LL |     if let Some(&Some(&x)) = &Some(&Some(0)) {
    |                       ^^     --------------- this expression has type `&Option<&Option<{integer}>>`
@@ -31,7 +31,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:82:23
+  --> $DIR/well-typed-edition-2024.rs:84:23
    |
 LL |     if let Some(&Some(&x)) = &Some(&mut Some(0)) {
    |                       ^^     ------------------- this expression has type `&Option<&mut Option<{integer}>>`
@@ -47,7 +47,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:88:23
+  --> $DIR/well-typed-edition-2024.rs:90:23
    |
 LL |     if let Some(&Some(&x)) = &mut Some(&Some(0)) {
    |                       ^^     ------------------- this expression has type `&mut Option<&Option<{integer}>>`
@@ -63,7 +63,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:123:15
+  --> $DIR/well-typed-edition-2024.rs:125:15
    |
 LL |     let [&mut &x] = &mut [&0];
    |               ^^    --------- this expression has type `&mut [&{integer}; 1]`
@@ -79,7 +79,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:129:15
+  --> $DIR/well-typed-edition-2024.rs:131:15
    |
 LL |     let [&mut &ref x] = &mut [&0];
    |               ^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
@@ -95,7 +95,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/well-typed-edition-2024.rs:135:15
+  --> $DIR/well-typed-edition-2024.rs:137:15
    |
 LL |     let [&mut &(mut x)] = &mut [&0];
    |               ^^^^^^^^    --------- this expression has type `&mut [&{integer}; 1]`
@@ -111,7 +111,7 @@
    |
 
 error[E0596]: cannot borrow data in a `&` reference as mutable
-  --> $DIR/well-typed-edition-2024.rs:109:19
+  --> $DIR/well-typed-edition-2024.rs:111:19
    |
 LL |         let [&mut ref mut x] = &mut [&0];
    |                   ^^^^^^^^^ cannot borrow as mutable
diff --git a/tests/ui/pattern/usefulness/issue-31561.rs b/tests/ui/pattern/usefulness/issue-31561.rs
index 82414f0..fe1b2bb 100644
--- a/tests/ui/pattern/usefulness/issue-31561.rs
+++ b/tests/ui/pattern/usefulness/issue-31561.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 enum Thing {
     Foo(u8),
     Bar,
@@ -7,5 +9,5 @@
 fn main() {
     let Thing::Foo(y) = Thing::Foo(1);
     //~^ ERROR refutable pattern in local binding
-    //~| `Thing::Bar` and `Thing::Baz` not covered
+    //~| NOTE `Thing::Bar` and `Thing::Baz` not covered
 }
diff --git a/tests/ui/pattern/usefulness/issue-31561.stderr b/tests/ui/pattern/usefulness/issue-31561.stderr
index ba7ae3f..382b233 100644
--- a/tests/ui/pattern/usefulness/issue-31561.stderr
+++ b/tests/ui/pattern/usefulness/issue-31561.stderr
@@ -1,5 +1,5 @@
 error[E0005]: refutable pattern in local binding
-  --> $DIR/issue-31561.rs:8:9
+  --> $DIR/issue-31561.rs:10:9
    |
 LL |     let Thing::Foo(y) = Thing::Foo(1);
    |         ^^^^^^^^^^^^^ patterns `Thing::Bar` and `Thing::Baz` not covered
@@ -7,7 +7,7 @@
    = note: `let` bindings require an "irrefutable pattern", like a `struct` or an `enum` with only one variant
    = note: for more information, visit https://doc.rust-lang.org/book/ch19-02-refutability.html
 note: `Thing` defined here
-  --> $DIR/issue-31561.rs:1:6
+  --> $DIR/issue-31561.rs:3:6
    |
 LL | enum Thing {
    |      ^^^^^
diff --git a/tests/ui/pattern/usefulness/issue-39362.rs b/tests/ui/pattern/usefulness/issue-39362.rs
index ea3c8f8..0db3980 100644
--- a/tests/ui/pattern/usefulness/issue-39362.rs
+++ b/tests/ui/pattern/usefulness/issue-39362.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 enum Foo {
     Bar { bar: Bar, id: usize }
 }
@@ -9,7 +11,7 @@ enum Bar {
 fn test(f: Foo) {
     match f {
         //~^ ERROR non-exhaustive patterns
-        //~| patterns
+        //~| NOTE patterns
         Foo::Bar { bar: Bar::A, .. } => (),
         Foo::Bar { bar: Bar::B, .. } => (),
     }
diff --git a/tests/ui/pattern/usefulness/issue-39362.stderr b/tests/ui/pattern/usefulness/issue-39362.stderr
index 9cce87a..18d542c 100644
--- a/tests/ui/pattern/usefulness/issue-39362.stderr
+++ b/tests/ui/pattern/usefulness/issue-39362.stderr
@@ -1,11 +1,11 @@
 error[E0004]: non-exhaustive patterns: `Foo::Bar { bar: Bar::C, .. }`, `Foo::Bar { bar: Bar::D, .. }`, `Foo::Bar { bar: Bar::E, .. }` and 1 more not covered
-  --> $DIR/issue-39362.rs:10:11
+  --> $DIR/issue-39362.rs:12:11
    |
 LL |     match f {
    |           ^ patterns `Foo::Bar { bar: Bar::C, .. }`, `Foo::Bar { bar: Bar::D, .. }`, `Foo::Bar { bar: Bar::E, .. }` and 1 more not covered
    |
 note: `Foo` defined here
-  --> $DIR/issue-39362.rs:1:6
+  --> $DIR/issue-39362.rs:3:6
    |
 LL | enum Foo {
    |      ^^^
diff --git a/tests/ui/pattern/usefulness/issue-72377.rs b/tests/ui/pattern/usefulness/issue-72377.rs
index b5ad307..782a996 100644
--- a/tests/ui/pattern/usefulness/issue-72377.rs
+++ b/tests/ui/pattern/usefulness/issue-72377.rs
@@ -7,7 +7,8 @@ fn main() {
 
     match (x, y) {
         //~^ ERROR non-exhaustive patterns: `(X::A, Some(X::A))`, `(X::A, Some(X::B))`, `(X::B, Some(X::B))` and 2
-        //~| more not covered
+        //~| NOTE more not covered
+        //~| NOTE the matched value is of type `(X, Option<X>)`
         (_, None) => false,
         (v, Some(w)) if v == w => true,
         (X::B, Some(X::C)) => false,
diff --git a/tests/ui/pattern/usefulness/refutable-pattern-errors.rs b/tests/ui/pattern/usefulness/refutable-pattern-errors.rs
index 7603da1..de9fc24 100644
--- a/tests/ui/pattern/usefulness/refutable-pattern-errors.rs
+++ b/tests/ui/pattern/usefulness/refutable-pattern-errors.rs
@@ -1,9 +1,11 @@
+//@ dont-require-annotations: NOTE
+
 fn func((1, (Some(1), 2..=3)): (isize, (Option<isize>, isize))) {}
 //~^ ERROR refutable pattern in function argument
-//~| `(..=0_isize, _)` and `(2_isize.., _)` not covered
+//~| NOTE `(..=0_isize, _)` and `(2_isize.., _)` not covered
 
 fn main() {
     let (1, (Some(1), 2..=3)) = (1, (None, 2));
     //~^ ERROR refutable pattern in local binding
-    //~| `(i32::MIN..=0_i32, _)` and `(2_i32..=i32::MAX, _)` not covered
+    //~| NOTE `(i32::MIN..=0_i32, _)` and `(2_i32..=i32::MAX, _)` not covered
 }
diff --git a/tests/ui/pattern/usefulness/refutable-pattern-errors.stderr b/tests/ui/pattern/usefulness/refutable-pattern-errors.stderr
index 23a5d89..37d1dc3 100644
--- a/tests/ui/pattern/usefulness/refutable-pattern-errors.stderr
+++ b/tests/ui/pattern/usefulness/refutable-pattern-errors.stderr
@@ -1,5 +1,5 @@
 error[E0005]: refutable pattern in function argument
-  --> $DIR/refutable-pattern-errors.rs:1:9
+  --> $DIR/refutable-pattern-errors.rs:3:9
    |
 LL | fn func((1, (Some(1), 2..=3)): (isize, (Option<isize>, isize))) {}
    |         ^^^^^^^^^^^^^^^^^^^^^ patterns `(..=0_isize, _)` and `(2_isize.., _)` not covered
@@ -7,7 +7,7 @@
    = note: the matched value is of type `(isize, (Option<isize>, isize))`
 
 error[E0005]: refutable pattern in local binding
-  --> $DIR/refutable-pattern-errors.rs:6:9
+  --> $DIR/refutable-pattern-errors.rs:8:9
    |
 LL |     let (1, (Some(1), 2..=3)) = (1, (None, 2));
    |         ^^^^^^^^^^^^^^^^^^^^^ patterns `(i32::MIN..=0_i32, _)` and `(2_i32..=i32::MAX, _)` not covered
diff --git a/tests/ui/pattern/usefulness/refutable-pattern-in-fn-arg.rs b/tests/ui/pattern/usefulness/refutable-pattern-in-fn-arg.rs
index 51ff641..416564d 100644
--- a/tests/ui/pattern/usefulness/refutable-pattern-in-fn-arg.rs
+++ b/tests/ui/pattern/usefulness/refutable-pattern-in-fn-arg.rs
@@ -1,6 +1,7 @@
 fn main() {
     let f = |3: isize| println!("hello");
     //~^ ERROR refutable pattern in closure argument
-    //~| `..=2_isize` and `4_isize..` not covered
+    //~| NOTE `..=2_isize` and `4_isize..` not covered
+    //~| NOTE the matched value is of type `isize`
     f(4);
 }
diff --git a/tests/ui/pptypedef.rs b/tests/ui/pptypedef.rs
index e28d323..d5f43df 100644
--- a/tests/ui/pptypedef.rs
+++ b/tests/ui/pptypedef.rs
@@ -1,11 +1,13 @@
+//@ dont-require-annotations: NOTE
+
 fn let_in<T, F>(x: T, f: F) where F: FnOnce(T) {}
 
 fn main() {
     let_in(3u32, |i| { assert!(i == 3i32); });
     //~^ ERROR mismatched types
-    //~| expected `u32`, found `i32`
+    //~| NOTE expected `u32`, found `i32`
 
     let_in(3i32, |i| { assert!(i == 3u32); });
     //~^ ERROR mismatched types
-    //~| expected `i32`, found `u32`
+    //~| NOTE expected `i32`, found `u32`
 }
diff --git a/tests/ui/pptypedef.stderr b/tests/ui/pptypedef.stderr
index 96327cf..a6d673e 100644
--- a/tests/ui/pptypedef.stderr
+++ b/tests/ui/pptypedef.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/pptypedef.rs:4:37
+  --> $DIR/pptypedef.rs:6:37
    |
 LL |     let_in(3u32, |i| { assert!(i == 3i32); });
    |                                -    ^^^^ expected `u32`, found `i32`
@@ -13,7 +13,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/pptypedef.rs:8:37
+  --> $DIR/pptypedef.rs:10:37
    |
 LL |     let_in(3i32, |i| { assert!(i == 3u32); });
    |                                -    ^^^^ expected `i32`, found `u32`
diff --git a/tests/ui/privacy/privacy2.rs b/tests/ui/privacy/privacy2.rs
index c82cd44..e44100a 100644
--- a/tests/ui/privacy/privacy2.rs
+++ b/tests/ui/privacy/privacy2.rs
@@ -1,4 +1,5 @@
 //@ compile-flags: -Zdeduplicate-diagnostics=yes
+//@ dont-require-annotations: NOTE
 
 #![feature(no_core)]
 #![no_core] // makes debugging this test *a lot* easier (during resolve)
@@ -20,7 +21,7 @@ fn test1() {
     //~^ ERROR requires `sized` lang_item
     use bar::foo;
     //~^ ERROR unresolved import `bar::foo` [E0432]
-    //~| no `foo` in `bar`
+    //~| NOTE no `foo` in `bar`
 }
 
 fn test2() {
diff --git a/tests/ui/privacy/privacy2.stderr b/tests/ui/privacy/privacy2.stderr
index 39bab67..b701349 100644
--- a/tests/ui/privacy/privacy2.stderr
+++ b/tests/ui/privacy/privacy2.stderr
@@ -1,34 +1,34 @@
 error[E0432]: unresolved import `bar::foo`
-  --> $DIR/privacy2.rs:21:9
+  --> $DIR/privacy2.rs:22:9
    |
 LL |     use bar::foo;
    |         ^^^^^^^^ no `foo` in `bar`
 
 error[E0603]: function import `foo` is private
-  --> $DIR/privacy2.rs:28:20
+  --> $DIR/privacy2.rs:29:20
    |
 LL |     use bar::glob::foo;
    |                    ^^^ private function import
    |
 note: the function import `foo` is defined here...
-  --> $DIR/privacy2.rs:12:13
+  --> $DIR/privacy2.rs:13:13
    |
 LL |         use foo;
    |             ^^^
 note: ...and refers to the function `foo` which is defined here
-  --> $DIR/privacy2.rs:16:1
+  --> $DIR/privacy2.rs:17:1
    |
 LL | pub fn foo() {}
    | ^^^^^^^^^^^^ you could import this directly
 
 error: requires `sized` lang_item
-  --> $DIR/privacy2.rs:16:14
+  --> $DIR/privacy2.rs:17:14
    |
 LL | pub fn foo() {}
    |              ^^
 
 error: requires `sized` lang_item
-  --> $DIR/privacy2.rs:19:12
+  --> $DIR/privacy2.rs:20:12
    |
 LL |   fn test1() {
    |  ____________^
@@ -39,7 +39,7 @@
    | |_^
 
 error: requires `sized` lang_item
-  --> $DIR/privacy2.rs:26:12
+  --> $DIR/privacy2.rs:27:12
    |
 LL |   fn test2() {
    |  ____________^
@@ -50,7 +50,7 @@
    | |_^
 
 error: requires `sized` lang_item
-  --> $DIR/privacy2.rs:32:11
+  --> $DIR/privacy2.rs:33:11
    |
 LL | fn main() {}
    |           ^^
diff --git a/tests/ui/proc-macro/attr-complex-fn.stdout b/tests/ui/proc-macro/attr-complex-fn.stdout
index 7c23d1e..9bbb746 100644
--- a/tests/ui/proc-macro/attr-complex-fn.stdout
+++ b/tests/ui/proc-macro/attr-complex-fn.stdout
@@ -77,7 +77,7 @@
         span: $DIR/attr-complex-fn.rs:19:42: 19:44 (#0),
     },
 ]
-PRINT-ATTR INPUT (DISPLAY): impl<T> MyTrait<T> for MyStruct<{ true }> { #![rustc_dummy] }
+PRINT-ATTR INPUT (DISPLAY): impl<T> MyTrait<T> for MyStruct<{true}> { #![rustc_dummy] }
 PRINT-ATTR RE-COLLECTED (DISPLAY): impl < T > MyTrait < T > for MyStruct < { true } > { #![rustc_dummy] }
 PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): impl < T > MyTrait < T > for MyStruct < { true } > { #! [rustc_dummy] }
 PRINT-ATTR INPUT (DEBUG): TokenStream [
diff --git a/tests/ui/proc-macro/weird-braces.stdout b/tests/ui/proc-macro/weird-braces.stdout
index 7da769e..0215deb 100644
--- a/tests/ui/proc-macro/weird-braces.stdout
+++ b/tests/ui/proc-macro/weird-braces.stdout
@@ -5,7 +5,7 @@
         span: $DIR/weird-braces.rs:16:25: 16:36 (#0),
     },
 ]
-PRINT-ATTR INPUT (DISPLAY): #[print_target_and_args(second_outer)] impl Bar<{ 1 > 0 }> for Foo<{ true }>
+PRINT-ATTR INPUT (DISPLAY): #[print_target_and_args(second_outer)] impl Bar<{1 > 0}> for Foo<{true}>
 {
     #![print_target_and_args(first_inner)]
     #![print_target_and_args(second_inner)]
@@ -191,7 +191,7 @@
         span: $DIR/weird-braces.rs:17:25: 17:37 (#0),
     },
 ]
-PRINT-ATTR INPUT (DISPLAY): impl Bar<{ 1 > 0 }> for Foo<{ true }>
+PRINT-ATTR INPUT (DISPLAY): impl Bar<{1 > 0}> for Foo<{true}>
 {
     #![print_target_and_args(first_inner)]
     #![print_target_and_args(second_inner)]
@@ -350,8 +350,7 @@
         span: $DIR/weird-braces.rs:19:30: 19:41 (#0),
     },
 ]
-PRINT-ATTR INPUT (DISPLAY): impl Bar<{ 1 > 0 }> for Foo<{ true }>
-{ #![print_target_and_args(second_inner)] }
+PRINT-ATTR INPUT (DISPLAY): impl Bar<{1 > 0}> for Foo<{true}> { #![print_target_and_args(second_inner)] }
 PRINT-ATTR RE-COLLECTED (DISPLAY): impl Bar < { 1 > 0 } > for Foo < { true } >
 { #![print_target_and_args(second_inner)] }
 PRINT-ATTR DEEP-RE-COLLECTED (DISPLAY): impl Bar < { 1 > 0 } > for Foo < { true } >
@@ -470,7 +469,7 @@
         span: $DIR/weird-braces.rs:20:30: 20:42 (#0),
     },
 ]
-PRINT-ATTR INPUT (DISPLAY): impl Bar<{ 1 > 0 }> for Foo<{ true }> {}
+PRINT-ATTR INPUT (DISPLAY): impl Bar<{1 > 0}> for Foo<{true}> {}
 PRINT-ATTR RE-COLLECTED (DISPLAY): impl Bar < { 1 > 0 } > for Foo < { true } > {}
 PRINT-ATTR INPUT (DEBUG): TokenStream [
     Ident {
diff --git a/tests/ui/ptr-coercion.rs b/tests/ui/ptr-coercion.rs
index 1938990..2549bd6 100644
--- a/tests/ui/ptr-coercion.rs
+++ b/tests/ui/ptr-coercion.rs
@@ -1,23 +1,25 @@
 // Test coercions between pointers which don't do anything fancy like unsizing.
 // These are testing that we don't lose mutability when converting to raw pointers.
 
+//@ dont-require-annotations: NOTE
+
 pub fn main() {
     // *const -> *mut
     let x: *const isize = &42;
     let x: *mut isize = x; //~  ERROR mismatched types
-                           //~| expected raw pointer `*mut isize`
-                           //~| found raw pointer `*const isize`
-                           //~| types differ in mutability
+                           //~| NOTE expected raw pointer `*mut isize`
+                           //~| NOTE found raw pointer `*const isize`
+                           //~| NOTE types differ in mutability
 
     // & -> *mut
     let x: *mut isize = &42; //~  ERROR mismatched types
-                             //~| expected raw pointer `*mut isize`
-                             //~| found reference `&isize`
-                             //~| types differ in mutability
+                             //~| NOTE expected raw pointer `*mut isize`
+                             //~| NOTE found reference `&isize`
+                             //~| NOTE types differ in mutability
 
     let x: *const isize = &42;
     let x: *mut isize = x; //~  ERROR mismatched types
-                           //~| expected raw pointer `*mut isize`
-                           //~| found raw pointer `*const isize`
-                           //~| types differ in mutability
+                           //~| NOTE expected raw pointer `*mut isize`
+                           //~| NOTE found raw pointer `*const isize`
+                           //~| NOTE types differ in mutability
 }
diff --git a/tests/ui/ptr-coercion.stderr b/tests/ui/ptr-coercion.stderr
index 29b7e5d..8de41d2 100644
--- a/tests/ui/ptr-coercion.stderr
+++ b/tests/ui/ptr-coercion.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/ptr-coercion.rs:7:25
+  --> $DIR/ptr-coercion.rs:9:25
    |
 LL |     let x: *mut isize = x;
    |            ----------   ^ types differ in mutability
@@ -10,7 +10,7 @@
               found raw pointer `*const isize`
 
 error[E0308]: mismatched types
-  --> $DIR/ptr-coercion.rs:13:25
+  --> $DIR/ptr-coercion.rs:15:25
    |
 LL |     let x: *mut isize = &42;
    |            ----------   ^^^ types differ in mutability
@@ -21,7 +21,7 @@
                 found reference `&isize`
 
 error[E0308]: mismatched types
-  --> $DIR/ptr-coercion.rs:19:25
+  --> $DIR/ptr-coercion.rs:21:25
    |
 LL |     let x: *mut isize = x;
    |            ----------   ^ types differ in mutability
diff --git a/tests/ui/recursion_limit/empty.rs b/tests/ui/recursion_limit/empty.rs
index 59dae10..5987fa2 100644
--- a/tests/ui/recursion_limit/empty.rs
+++ b/tests/ui/recursion_limit/empty.rs
@@ -1,8 +1,9 @@
 // Test the parse error for an empty recursion_limit
 
 #![recursion_limit = ""] //~ ERROR `limit` must be a non-negative integer
-                         //~| `limit` must be a non-negative integer
+                         //~| NOTE `limit` must be a non-negative integer
                          //~| ERROR `limit` must be a non-negative integer
-                         //~| `limit` must be a non-negative integer
+                         //~| NOTE `limit` must be a non-negative integer
+                         //~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 fn main() {}
diff --git a/tests/ui/recursion_limit/invalid_digit.rs b/tests/ui/recursion_limit/invalid_digit.rs
index 03df3e7..79d8f37 100644
--- a/tests/ui/recursion_limit/invalid_digit.rs
+++ b/tests/ui/recursion_limit/invalid_digit.rs
@@ -1,7 +1,8 @@
 // Test the parse error for an invalid digit in recursion_limit
 
 #![recursion_limit = "-100"] //~ ERROR `limit` must be a non-negative integer
-                             //~| not a valid integer
+                             //~| NOTE not a valid integer
                              //~| ERROR `limit` must be a non-negative integer
-                             //~| not a valid integer
+                             //~| NOTE not a valid integer
+                             //~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 fn main() {}
diff --git a/tests/ui/recursion_limit/overflow.rs b/tests/ui/recursion_limit/overflow.rs
index c733ba6..7cd1d57 100644
--- a/tests/ui/recursion_limit/overflow.rs
+++ b/tests/ui/recursion_limit/overflow.rs
@@ -2,8 +2,9 @@
 
 #![recursion_limit = "999999999999999999999999"]
 //~^ ERROR `limit` must be a non-negative integer
-//~| `limit` is too large
+//~| NOTE `limit` is too large
 //~| ERROR `limit` must be a non-negative integer
-//~| `limit` is too large
+//~| NOTE `limit` is too large
+//~| NOTE duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
 
 fn main() {}
diff --git a/tests/ui/repeat-expr/repeat_count.rs b/tests/ui/repeat-expr/repeat_count.rs
index 18610bc..2febcdc 100644
--- a/tests/ui/repeat-expr/repeat_count.rs
+++ b/tests/ui/repeat-expr/repeat_count.rs
@@ -1,34 +1,36 @@
 // Regression test for issue #3645
 
+//@ dont-require-annotations: NOTE
+
 fn main() {
     let n = 1;
     let a = [0; n];
     //~^ ERROR attempt to use a non-constant value in a constant [E0435]
     let b = [0; ()];
     //~^ ERROR mismatched types
-    //~| expected `usize`, found `()`
+    //~| NOTE expected `usize`, found `()`
     let c = [0; true];
     //~^ ERROR mismatched types
-    //~| expected `usize`, found `bool`
+    //~| NOTE expected `usize`, found `bool`
     let d = [0; 0.5];
     //~^ ERROR mismatched types
-    //~| expected `usize`, found floating-point number
+    //~| NOTE expected `usize`, found floating-point number
     let e = [0; "foo"];
     //~^ ERROR mismatched types
-    //~| expected `usize`, found `&str`
+    //~| NOTE expected `usize`, found `&str`
     let f = [0; -4_isize];
     //~^ ERROR mismatched types
-    //~| expected `usize`, found `isize`
+    //~| NOTE expected `usize`, found `isize`
     let f = [0_usize; -1_isize];
     //~^ ERROR mismatched types
-    //~| expected `usize`, found `isize`
+    //~| NOTE expected `usize`, found `isize`
     let f = [0; 4u8];
     //~^ ERROR mismatched types
-    //~| expected `usize`, found `u8`
+    //~| NOTE expected `usize`, found `u8`
     struct G {
         g: (),
     }
     let g = [0; G { g: () }];
     //~^ ERROR mismatched types
-    //~| expected `usize`, found `G`
+    //~| NOTE expected `usize`, found `G`
 }
diff --git a/tests/ui/repeat-expr/repeat_count.stderr b/tests/ui/repeat-expr/repeat_count.stderr
index 34e29e8..cf94ad4 100644
--- a/tests/ui/repeat-expr/repeat_count.stderr
+++ b/tests/ui/repeat-expr/repeat_count.stderr
@@ -1,5 +1,5 @@
 error[E0435]: attempt to use a non-constant value in a constant
-  --> $DIR/repeat_count.rs:5:17
+  --> $DIR/repeat_count.rs:7:17
    |
 LL |     let a = [0; n];
    |                 ^ non-constant value
@@ -11,37 +11,37 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/repeat_count.rs:7:17
+  --> $DIR/repeat_count.rs:9:17
    |
 LL |     let b = [0; ()];
    |                 ^^ expected `usize`, found `()`
 
 error[E0308]: mismatched types
-  --> $DIR/repeat_count.rs:31:17
+  --> $DIR/repeat_count.rs:33:17
    |
 LL |     let g = [0; G { g: () }];
    |                 ^^^^^^^^^^^ expected `usize`, found `G`
 
 error[E0308]: mismatched types
-  --> $DIR/repeat_count.rs:10:17
+  --> $DIR/repeat_count.rs:12:17
    |
 LL |     let c = [0; true];
    |                 ^^^^ expected `usize`, found `bool`
 
 error[E0308]: mismatched types
-  --> $DIR/repeat_count.rs:13:17
+  --> $DIR/repeat_count.rs:15:17
    |
 LL |     let d = [0; 0.5];
    |                 ^^^ expected `usize`, found floating-point number
 
 error[E0308]: mismatched types
-  --> $DIR/repeat_count.rs:16:17
+  --> $DIR/repeat_count.rs:18:17
    |
 LL |     let e = [0; "foo"];
    |                 ^^^^^ expected `usize`, found `&str`
 
 error[E0308]: mismatched types
-  --> $DIR/repeat_count.rs:19:17
+  --> $DIR/repeat_count.rs:21:17
    |
 LL |     let f = [0; -4_isize];
    |                 ^^^^^^^^ expected `usize`, found `isize`
@@ -49,7 +49,7 @@
    = note: `-4_isize` cannot fit into type `usize`
 
 error[E0308]: mismatched types
-  --> $DIR/repeat_count.rs:22:23
+  --> $DIR/repeat_count.rs:24:23
    |
 LL |     let f = [0_usize; -1_isize];
    |                       ^^^^^^^^ expected `usize`, found `isize`
@@ -57,7 +57,7 @@
    = note: `-1_isize` cannot fit into type `usize`
 
 error[E0308]: mismatched types
-  --> $DIR/repeat_count.rs:25:17
+  --> $DIR/repeat_count.rs:27:17
    |
 LL |     let f = [0; 4u8];
    |                 ^^^ expected `usize`, found `u8`
diff --git a/tests/ui/resolve/issue-23716.rs b/tests/ui/resolve/issue-23716.rs
index e9139c0..61b42e2 100644
--- a/tests/ui/resolve/issue-23716.rs
+++ b/tests/ui/resolve/issue-23716.rs
@@ -1,8 +1,10 @@
+//@ dont-require-annotations: NOTE
+
 static foo: i32 = 0;
 
 fn bar(foo: i32) {}
 //~^ ERROR function parameters cannot shadow statics
-//~| cannot be named the same as a static
+//~| NOTE cannot be named the same as a static
 
 mod submod {
     pub static answer: i32 = 42;
@@ -12,6 +14,6 @@ mod submod {
 
 fn question(answer: i32) {}
 //~^ ERROR function parameters cannot shadow statics
-//~| cannot be named the same as a static
+//~| NOTE cannot be named the same as a static
 fn main() {
 }
diff --git a/tests/ui/resolve/issue-23716.stderr b/tests/ui/resolve/issue-23716.stderr
index 8b89c35..23650c4 100644
--- a/tests/ui/resolve/issue-23716.stderr
+++ b/tests/ui/resolve/issue-23716.stderr
@@ -1,5 +1,5 @@
 error[E0530]: function parameters cannot shadow statics
-  --> $DIR/issue-23716.rs:3:8
+  --> $DIR/issue-23716.rs:5:8
    |
 LL | static foo: i32 = 0;
    | -------------------- the static `foo` is defined here
@@ -8,7 +8,7 @@
    |        ^^^ cannot be named the same as a static
 
 error[E0530]: function parameters cannot shadow statics
-  --> $DIR/issue-23716.rs:13:13
+  --> $DIR/issue-23716.rs:15:13
    |
 LL | use self::submod::answer;
    |     -------------------- the static `answer` is imported here
diff --git a/tests/ui/resolve/issue-5035.rs b/tests/ui/resolve/issue-5035.rs
index 49fa312f9..82c4bc0 100644
--- a/tests/ui/resolve/issue-5035.rs
+++ b/tests/ui/resolve/issue-5035.rs
@@ -1,9 +1,11 @@
+//@ dont-require-annotations: NOTE
+
 trait I {}
 type K = dyn I;
 impl K for isize {} //~ ERROR expected trait, found type alias `K`
 
 use ImportError; //~ ERROR unresolved import `ImportError` [E0432]
-                 //~^ no `ImportError` in the root
+                 //~^ NOTE no `ImportError` in the root
 impl ImportError for () {} // check that this is not an additional error (cf. issue #35142)
 
 fn main() {}
diff --git a/tests/ui/resolve/issue-5035.stderr b/tests/ui/resolve/issue-5035.stderr
index b249aaa..f571743 100644
--- a/tests/ui/resolve/issue-5035.stderr
+++ b/tests/ui/resolve/issue-5035.stderr
@@ -1,11 +1,11 @@
 error[E0432]: unresolved import `ImportError`
-  --> $DIR/issue-5035.rs:5:5
+  --> $DIR/issue-5035.rs:7:5
    |
 LL | use ImportError;
    |     ^^^^^^^^^^^ no `ImportError` in the root
 
 error[E0404]: expected trait, found type alias `K`
-  --> $DIR/issue-5035.rs:3:6
+  --> $DIR/issue-5035.rs:5:6
    |
 LL | trait I {}
    | ------- similarly named trait `I` defined here
diff --git a/tests/ui/resolve/resolve-conflict-item-vs-import.rs b/tests/ui/resolve/resolve-conflict-item-vs-import.rs
index 4308c7a..830f02c 100644
--- a/tests/ui/resolve/resolve-conflict-item-vs-import.rs
+++ b/tests/ui/resolve/resolve-conflict-item-vs-import.rs
@@ -1,8 +1,8 @@
-use std::mem::transmute;
+use std::mem::transmute; //~ NOTE previous import of the value `transmute` here
 
 fn transmute() {}
 //~^ ERROR the name `transmute` is defined multiple times
-//~| `transmute` redefined here
-//~| `transmute` must be defined only once in the value namespace of this module
+//~| NOTE `transmute` redefined here
+//~| NOTE `transmute` must be defined only once in the value namespace of this module
 fn main() {
 }
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs
index 69a283c3..167f90b 100644
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs
@@ -1,22 +1,24 @@
+//@ dont-require-annotations: NOTE
+
 #![deny(unreachable_patterns)]
 
 #[non_exhaustive]
 pub enum NonExhaustiveEnum {
     Unit,
-    //~^ not covered
+    //~^ NOTE not covered
     Tuple(u32),
-    //~^ not covered
+    //~^ NOTE not covered
     Struct { field: u32 }
-    //~^ not covered
+    //~^ NOTE not covered
 }
 
 pub enum NormalEnum {
     Unit,
-    //~^ not covered
+    //~^ NOTE not covered
     Tuple(u32),
-    //~^ not covered
+    //~^ NOTE not covered
     Struct { field: u32 }
-    //~^ not covered
+    //~^ NOTE not covered
 }
 
 #[non_exhaustive]
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr
index 100e0a5..2112344 100644
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr
@@ -1,5 +1,5 @@
 error: unreachable pattern
-  --> $DIR/enum_same_crate_empty_match.rs:28:9
+  --> $DIR/enum_same_crate_empty_match.rs:30:9
    |
 LL |         _ => {}
    |         ^------
@@ -9,19 +9,19 @@
    |
    = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types
 note: the lint level is defined here
-  --> $DIR/enum_same_crate_empty_match.rs:1:9
+  --> $DIR/enum_same_crate_empty_match.rs:3:9
    |
 LL | #![deny(unreachable_patterns)]
    |         ^^^^^^^^^^^^^^^^^^^^
 
 error[E0004]: non-exhaustive patterns: `NonExhaustiveEnum::Unit`, `NonExhaustiveEnum::Tuple(_)` and `NonExhaustiveEnum::Struct { .. }` not covered
-  --> $DIR/enum_same_crate_empty_match.rs:33:11
+  --> $DIR/enum_same_crate_empty_match.rs:35:11
    |
 LL |     match NonExhaustiveEnum::Unit {}
    |           ^^^^^^^^^^^^^^^^^^^^^^^ patterns `NonExhaustiveEnum::Unit`, `NonExhaustiveEnum::Tuple(_)` and `NonExhaustiveEnum::Struct { .. }` not covered
    |
 note: `NonExhaustiveEnum` defined here
-  --> $DIR/enum_same_crate_empty_match.rs:4:10
+  --> $DIR/enum_same_crate_empty_match.rs:6:10
    |
 LL | pub enum NonExhaustiveEnum {
    |          ^^^^^^^^^^^^^^^^^
@@ -42,13 +42,13 @@
    |
 
 error[E0004]: non-exhaustive patterns: `NormalEnum::Unit`, `NormalEnum::Tuple(_)` and `NormalEnum::Struct { .. }` not covered
-  --> $DIR/enum_same_crate_empty_match.rs:35:11
+  --> $DIR/enum_same_crate_empty_match.rs:37:11
    |
 LL |     match NormalEnum::Unit {}
    |           ^^^^^^^^^^^^^^^^ patterns `NormalEnum::Unit`, `NormalEnum::Tuple(_)` and `NormalEnum::Struct { .. }` not covered
    |
 note: `NormalEnum` defined here
-  --> $DIR/enum_same_crate_empty_match.rs:13:10
+  --> $DIR/enum_same_crate_empty_match.rs:15:10
    |
 LL | pub enum NormalEnum {
    |          ^^^^^^^^^^
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.rs
index ba800e3..1e746fd 100644
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.rs
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.rs
@@ -1,5 +1,7 @@
 // Test that the `non_exhaustive_omitted_patterns` lint is triggered correctly.
 
+//@ dont-require-annotations: NOTE
+
 #![feature(non_exhaustive_omitted_patterns_lint, unstable_test_feature)]
 #![deny(unreachable_patterns)]
 
@@ -231,7 +233,7 @@ fn main() {
     // Check that matching on a reference results in a correct diagnostic
     match &non_enum {
         //~^ ERROR some variants are not matched explicitly
-        //~| pattern `&NonExhaustiveEnum::Struct { .. }` not covered
+        //~| NOTE pattern `&NonExhaustiveEnum::Struct { .. }` not covered
         NonExhaustiveEnum::Unit => {}
         NonExhaustiveEnum::Tuple(_) => {}
         _ => {}
@@ -239,21 +241,21 @@ fn main() {
 
     match (true, &non_enum) {
         //~^ ERROR some variants are not matched explicitly
-        //~| patterns `(_, &NonExhaustiveEnum::Tuple(_))` and `(_, &NonExhaustiveEnum::Struct { .. })` not covered
+        //~| NOTE patterns `(_, &NonExhaustiveEnum::Tuple(_))` and `(_, &NonExhaustiveEnum::Struct { .. })` not covered
         (true, NonExhaustiveEnum::Unit) => {}
         _ => {}
     }
 
     match (&non_enum, true) {
         //~^ ERROR some variants are not matched explicitly
-        //~| patterns `(&NonExhaustiveEnum::Tuple(_), _)` and `(&NonExhaustiveEnum::Struct { .. }, _)` not covered
+        //~| NOTE patterns `(&NonExhaustiveEnum::Tuple(_), _)` and `(&NonExhaustiveEnum::Struct { .. }, _)` not covered
         (NonExhaustiveEnum::Unit, true) => {}
         _ => {}
     }
 
     match Some(&non_enum) {
         //~^ ERROR some variants are not matched explicitly
-        //~| pattern `Some(&NonExhaustiveEnum::Struct { .. })` not covered
+        //~| NOTE pattern `Some(&NonExhaustiveEnum::Struct { .. })` not covered
         Some(NonExhaustiveEnum::Unit | NonExhaustiveEnum::Tuple(_)) => {}
         _ => {}
     }
diff --git a/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.stderr
index f89ae24..c2c9ac1 100644
--- a/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.stderr
+++ b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.stderr
@@ -1,5 +1,5 @@
 error: some fields are not explicitly listed
-  --> $DIR/omitted-patterns.rs:139:9
+  --> $DIR/omitted-patterns.rs:141:9
    |
 LL |         VariantNonExhaustive::Bar { x, .. } => {}
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `y` not listed
@@ -7,13 +7,13 @@
    = help: ensure that all fields are mentioned explicitly by adding the suggested fields
    = note: the pattern is of type `VariantNonExhaustive` and the `non_exhaustive_omitted_patterns` attribute was found
 note: the lint level is defined here
-  --> $DIR/omitted-patterns.rs:45:8
+  --> $DIR/omitted-patterns.rs:47:8
    |
 LL | #[deny(non_exhaustive_omitted_patterns)]
    |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: some fields are not explicitly listed
-  --> $DIR/omitted-patterns.rs:143:9
+  --> $DIR/omitted-patterns.rs:145:9
    |
 LL |     let FunctionalRecord { first_field, second_field, .. } = FunctionalRecord::default();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `third_field` not listed
@@ -22,7 +22,7 @@
    = note: the pattern is of type `FunctionalRecord` and the `non_exhaustive_omitted_patterns` attribute was found
 
 error: some fields are not explicitly listed
-  --> $DIR/omitted-patterns.rs:149:29
+  --> $DIR/omitted-patterns.rs:151:29
    |
 LL |     let NestedStruct { bar: NormalStruct { first_field, .. }, .. } = NestedStruct::default();
    |                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `second_field` not listed
@@ -31,7 +31,7 @@
    = note: the pattern is of type `NormalStruct` and the `non_exhaustive_omitted_patterns` attribute was found
 
 error: some fields are not explicitly listed
-  --> $DIR/omitted-patterns.rs:149:9
+  --> $DIR/omitted-patterns.rs:151:9
    |
 LL |     let NestedStruct { bar: NormalStruct { first_field, .. }, .. } = NestedStruct::default();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `foo` not listed
@@ -40,7 +40,7 @@
    = note: the pattern is of type `NestedStruct` and the `non_exhaustive_omitted_patterns` attribute was found
 
 error: some fields are not explicitly listed
-  --> $DIR/omitted-patterns.rs:212:9
+  --> $DIR/omitted-patterns.rs:214:9
    |
 LL |     let OnlyUnstableStruct { unstable, .. } = OnlyUnstableStruct::new();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `unstable2` not listed
@@ -49,7 +49,7 @@
    = note: the pattern is of type `OnlyUnstableStruct` and the `non_exhaustive_omitted_patterns` attribute was found
 
 error: some fields are not explicitly listed
-  --> $DIR/omitted-patterns.rs:218:9
+  --> $DIR/omitted-patterns.rs:220:9
    |
 LL |     let UnstableStruct { stable, stable2, .. } = UnstableStruct::default();
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ field `unstable` not listed
@@ -58,7 +58,7 @@
    = note: the pattern is of type `UnstableStruct` and the `non_exhaustive_omitted_patterns` attribute was found
 
 error: some variants are not matched explicitly
-  --> $DIR/omitted-patterns.rs:65:11
+  --> $DIR/omitted-patterns.rs:67:11
    |
 LL |     match non_enum {
    |           ^^^^^^^^ pattern `NonExhaustiveEnum::Struct { .. }` not covered
@@ -67,7 +67,7 @@
    = note: the matched value is of type `NonExhaustiveEnum` and the `non_exhaustive_omitted_patterns` attribute was found
 
 error: some variants are not matched explicitly
-  --> $DIR/omitted-patterns.rs:72:11
+  --> $DIR/omitted-patterns.rs:74:11
    |
 LL |     match non_enum {
    |           ^^^^^^^^ pattern `NonExhaustiveEnum::Tuple(_)` not covered
@@ -76,7 +76,7 @@
    = note: the matched value is of type `NonExhaustiveEnum` and the `non_exhaustive_omitted_patterns` attribute was found
 
 error: some variants are not matched explicitly
-  --> $DIR/omitted-patterns.rs:93:11
+  --> $DIR/omitted-patterns.rs:95:11
    |
 LL |     match (non_enum, true) {
    |           ^^^^^^^^^^^^^^^^ pattern `(NonExhaustiveEnum::Struct { .. }, _)` not covered
@@ -85,7 +85,7 @@
    = note: the matched value is of type `(NonExhaustiveEnum, bool)` and the `non_exhaustive_omitted_patterns` attribute was found
 
 error: some variants are not matched explicitly
-  --> $DIR/omitted-patterns.rs:106:11
+  --> $DIR/omitted-patterns.rs:108:11
    |
 LL |     match (true, non_enum) {
    |           ^^^^^^^^^^^^^^^^ pattern `(_, NonExhaustiveEnum::Struct { .. })` not covered
@@ -94,7 +94,7 @@
    = note: the matched value is of type `(bool, NonExhaustiveEnum)` and the `non_exhaustive_omitted_patterns` attribute was found
 
 error: some variants are not matched explicitly
-  --> $DIR/omitted-patterns.rs:113:11
+  --> $DIR/omitted-patterns.rs:115:11
    |
 LL |     match Some(non_enum) {
    |           ^^^^^^^^^^^^^^ pattern `Some(NonExhaustiveEnum::Struct { .. })` not covered
@@ -103,7 +103,7 @@
    = note: the matched value is of type `Option<NonExhaustiveEnum>` and the `non_exhaustive_omitted_patterns` attribute was found
 
 error: some variants are not matched explicitly
-  --> $DIR/omitted-patterns.rs:129:11
+  --> $DIR/omitted-patterns.rs:131:11
    |
 LL |     match NestedNonExhaustive::B {
    |           ^^^^^^^^^^^^^^^^^^^^^^ patterns `NestedNonExhaustive::C`, `NestedNonExhaustive::A(NonExhaustiveEnum::Tuple(_))` and `NestedNonExhaustive::A(NonExhaustiveEnum::Struct { .. })` not covered
@@ -112,7 +112,7 @@
    = note: the matched value is of type `NestedNonExhaustive` and the `non_exhaustive_omitted_patterns` attribute was found
 
 error: some variants are not matched explicitly
-  --> $DIR/omitted-patterns.rs:184:11
+  --> $DIR/omitted-patterns.rs:186:11
    |
 LL |     match UnstableEnum::Stable {
    |           ^^^^^^^^^^^^^^^^^^^^ pattern `UnstableEnum::Unstable` not covered
@@ -121,7 +121,7 @@
    = note: the matched value is of type `UnstableEnum` and the `non_exhaustive_omitted_patterns` attribute was found
 
 error: some variants are not matched explicitly
-  --> $DIR/omitted-patterns.rs:206:11
+  --> $DIR/omitted-patterns.rs:208:11
    |
 LL |     match OnlyUnstableEnum::Unstable {
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^ pattern `OnlyUnstableEnum::Unstable2` not covered
@@ -130,7 +130,7 @@
    = note: the matched value is of type `OnlyUnstableEnum` and the `non_exhaustive_omitted_patterns` attribute was found
 
 error[E0005]: refutable pattern in local binding
-  --> $DIR/omitted-patterns.rs:228:9
+  --> $DIR/omitted-patterns.rs:230:9
    |
 LL |     let local_refutable @ NonExhaustiveEnum::Unit = NonExhaustiveEnum::Unit;
    |         ^^^^^^^^^^^^^^^ pattern `_` not covered
@@ -144,7 +144,7 @@
    |                                                                             ++++++++++++++++
 
 error: some variants are not matched explicitly
-  --> $DIR/omitted-patterns.rs:232:11
+  --> $DIR/omitted-patterns.rs:234:11
    |
 LL |     match &non_enum {
    |           ^^^^^^^^^ pattern `&NonExhaustiveEnum::Struct { .. }` not covered
@@ -153,7 +153,7 @@
    = note: the matched value is of type `&NonExhaustiveEnum` and the `non_exhaustive_omitted_patterns` attribute was found
 
 error: some variants are not matched explicitly
-  --> $DIR/omitted-patterns.rs:240:11
+  --> $DIR/omitted-patterns.rs:242:11
    |
 LL |     match (true, &non_enum) {
    |           ^^^^^^^^^^^^^^^^^ patterns `(_, &NonExhaustiveEnum::Tuple(_))` and `(_, &NonExhaustiveEnum::Struct { .. })` not covered
@@ -162,7 +162,7 @@
    = note: the matched value is of type `(bool, &NonExhaustiveEnum)` and the `non_exhaustive_omitted_patterns` attribute was found
 
 error: some variants are not matched explicitly
-  --> $DIR/omitted-patterns.rs:247:11
+  --> $DIR/omitted-patterns.rs:249:11
    |
 LL |     match (&non_enum, true) {
    |           ^^^^^^^^^^^^^^^^^ patterns `(&NonExhaustiveEnum::Tuple(_), _)` and `(&NonExhaustiveEnum::Struct { .. }, _)` not covered
@@ -171,7 +171,7 @@
    = note: the matched value is of type `(&NonExhaustiveEnum, bool)` and the `non_exhaustive_omitted_patterns` attribute was found
 
 error: some variants are not matched explicitly
-  --> $DIR/omitted-patterns.rs:254:11
+  --> $DIR/omitted-patterns.rs:256:11
    |
 LL |     match Some(&non_enum) {
    |           ^^^^^^^^^^^^^^^ pattern `Some(&NonExhaustiveEnum::Struct { .. })` not covered
diff --git a/tests/ui/simd/const-err-trumps-simd-err.rs b/tests/ui/simd/const-err-trumps-simd-err.rs
index fb87fe1..05a224d 100644
--- a/tests/ui/simd/const-err-trumps-simd-err.rs
+++ b/tests/ui/simd/const-err-trumps-simd-err.rs
@@ -1,4 +1,6 @@
 //@build-fail
+//@ dont-require-annotations: NOTE
+
 //! Make sure that monomorphization-time const errors from `static_assert` take priority over the
 //! error from simd_extract. Basically this checks that if a const fails to evaluate in some
 //! function, we don't bother codegen'ing the function.
@@ -15,7 +17,7 @@
 fn get_elem<const LANE: u32>(a: int8x4_t) -> u8 {
     const { assert!(LANE < 4); } // the error should be here...
     //~^ ERROR failed
-    //~| assertion failed
+    //~| NOTE assertion failed
     unsafe { simd_extract(a, LANE) } // ...not here
 }
 
diff --git a/tests/ui/simd/const-err-trumps-simd-err.stderr b/tests/ui/simd/const-err-trumps-simd-err.stderr
index a0f1c66..389f754 100644
--- a/tests/ui/simd/const-err-trumps-simd-err.stderr
+++ b/tests/ui/simd/const-err-trumps-simd-err.stderr
@@ -1,17 +1,17 @@
 error[E0080]: evaluation of `get_elem::<4>::{constant#0}` failed
-  --> $DIR/const-err-trumps-simd-err.rs:16:13
+  --> $DIR/const-err-trumps-simd-err.rs:18:13
    |
 LL |     const { assert!(LANE < 4); } // the error should be here...
    |             ^^^^^^^^^^^^^^^^^ evaluation panicked: assertion failed: LANE < 4
 
 note: erroneous constant encountered
-  --> $DIR/const-err-trumps-simd-err.rs:16:5
+  --> $DIR/const-err-trumps-simd-err.rs:18:5
    |
 LL |     const { assert!(LANE < 4); } // the error should be here...
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 note: the above error was encountered while instantiating `fn get_elem::<4>`
-  --> $DIR/const-err-trumps-simd-err.rs:23:5
+  --> $DIR/const-err-trumps-simd-err.rs:25:5
    |
 LL |     get_elem::<4>(int8x4_t([0, 0, 0, 0]));
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/structs/default-field-values/failures.rs b/tests/ui/structs/default-field-values/failures.rs
index 4461302..dee6566 100644
--- a/tests/ui/structs/default-field-values/failures.rs
+++ b/tests/ui/structs/default-field-values/failures.rs
@@ -1,4 +1,6 @@
- #![feature(default_field_values)]
+//@ dont-require-annotations: HELP
+
+#![feature(default_field_values)]
 
 #[derive(Debug)]
 pub struct S;
@@ -56,10 +58,10 @@ fn main () {
     let _ = Bar { bar: S, .. }; // ok
     let _ = Qux::<4> { .. };
     let _ = Rak(..); //~ ERROR E0308
-    //~^ you might have meant to use `..` to skip providing
+    //~^ HELP you might have meant to use `..` to skip providing
     let _ = Rak(0, ..); //~ ERROR E0061
-    //~^ you might have meant to use `..` to skip providing
+    //~^ HELP you might have meant to use `..` to skip providing
     let _ = Rak(.., 0); //~ ERROR E0061
-    //~^ you might have meant to use `..` to skip providing
+    //~^ HELP you might have meant to use `..` to skip providing
     let _ = Rak { .. }; // ok
 }
diff --git a/tests/ui/structs/default-field-values/failures.stderr b/tests/ui/structs/default-field-values/failures.stderr
index 21c9bfb..aaa75fd 100644
--- a/tests/ui/structs/default-field-values/failures.stderr
+++ b/tests/ui/structs/default-field-values/failures.stderr
@@ -1,5 +1,5 @@
 error: the `#[default]` attribute may only be used on unit enum variants or variants where every field has a default value
-  --> $DIR/failures.rs:47:5
+  --> $DIR/failures.rs:49:5
    |
 LL |     Variant {}
    |     ^^^^^^^
@@ -7,13 +7,13 @@
    = help: consider a manual implementation of `Default`
 
 error: default fields are not supported in tuple structs
-  --> $DIR/failures.rs:26:22
+  --> $DIR/failures.rs:28:22
    |
 LL | pub struct Rak(i32 = 42);
    |                      ^^ default fields are only supported on structs
 
 error[E0277]: the trait bound `S: Default` is not satisfied
-  --> $DIR/failures.rs:14:5
+  --> $DIR/failures.rs:16:5
    |
 LL | #[derive(Debug, Default)]
    |                 ------- in this derive macro expansion
@@ -28,19 +28,19 @@
    |
 
 error: missing field `bar` in initializer
-  --> $DIR/failures.rs:53:19
+  --> $DIR/failures.rs:55:19
    |
 LL |     let _ = Bar { .. };
    |                   ^ fields that do not have a defaulted value must be provided explicitly
 
 error: missing field `bar` in initializer
-  --> $DIR/failures.rs:54:27
+  --> $DIR/failures.rs:56:27
    |
 LL |     let _ = Bar { baz: 0, .. };
    |                           ^ fields that do not have a defaulted value must be provided explicitly
 
 error[E0308]: mismatched types
-  --> $DIR/failures.rs:58:17
+  --> $DIR/failures.rs:60:17
    |
 LL |     let _ = Rak(..);
    |             --- ^^ expected `i32`, found `RangeFull`
@@ -48,29 +48,29 @@
    |             arguments to this struct are incorrect
    |
 note: tuple struct defined here
-  --> $DIR/failures.rs:26:12
+  --> $DIR/failures.rs:28:12
    |
 LL | pub struct Rak(i32 = 42);
    |            ^^^
 help: you might have meant to use `..` to skip providing a value for expected fields, but this is only supported on non-tuple struct literals; it is instead interpreted as a `std::ops::RangeFull` literal
-  --> $DIR/failures.rs:58:17
+  --> $DIR/failures.rs:60:17
    |
 LL |     let _ = Rak(..);
    |                 ^^
 
 error[E0061]: this struct takes 1 argument but 2 arguments were supplied
-  --> $DIR/failures.rs:60:13
+  --> $DIR/failures.rs:62:13
    |
 LL |     let _ = Rak(0, ..);
    |             ^^^    -- unexpected argument #2 of type `RangeFull`
    |
 help: you might have meant to use `..` to skip providing a value for expected fields, but this is only supported on non-tuple struct literals; it is instead interpreted as a `std::ops::RangeFull` literal
-  --> $DIR/failures.rs:60:20
+  --> $DIR/failures.rs:62:20
    |
 LL |     let _ = Rak(0, ..);
    |                    ^^
 note: tuple struct defined here
-  --> $DIR/failures.rs:26:12
+  --> $DIR/failures.rs:28:12
    |
 LL | pub struct Rak(i32 = 42);
    |            ^^^
@@ -81,18 +81,18 @@
    |
 
 error[E0061]: this struct takes 1 argument but 2 arguments were supplied
-  --> $DIR/failures.rs:62:13
+  --> $DIR/failures.rs:64:13
    |
 LL |     let _ = Rak(.., 0);
    |             ^^^ -- unexpected argument #1 of type `RangeFull`
    |
 help: you might have meant to use `..` to skip providing a value for expected fields, but this is only supported on non-tuple struct literals; it is instead interpreted as a `std::ops::RangeFull` literal
-  --> $DIR/failures.rs:62:17
+  --> $DIR/failures.rs:64:17
    |
 LL |     let _ = Rak(.., 0);
    |                 ^^
 note: tuple struct defined here
-  --> $DIR/failures.rs:26:12
+  --> $DIR/failures.rs:28:12
    |
 LL | pub struct Rak(i32 = 42);
    |            ^^^
diff --git a/tests/ui/structs/structure-constructor-type-mismatch.rs b/tests/ui/structs/structure-constructor-type-mismatch.rs
index 21cd9d0..495deb0 100644
--- a/tests/ui/structs/structure-constructor-type-mismatch.rs
+++ b/tests/ui/structs/structure-constructor-type-mismatch.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 struct Point<T> {
     x: T,
     y: T,
@@ -16,32 +18,32 @@ fn main() {
     let pt = PointF {
         x: 1,
         //~^ ERROR mismatched types
-        //~| expected `f32`, found integer
+        //~| NOTE expected `f32`, found integer
         y: 2,
         //~^ ERROR mismatched types
-        //~| expected `f32`, found integer
+        //~| NOTE expected `f32`, found integer
     };
 
     let pt2 = Point::<f32> {
         x: 3,
         //~^ ERROR mismatched types
-        //~| expected `f32`, found integer
+        //~| NOTE expected `f32`, found integer
         y: 4,
         //~^ ERROR mismatched types
-        //~| expected `f32`, found integer
+        //~| NOTE expected `f32`, found integer
     };
 
     let pair = PairF {
         x: 5,
         //~^ ERROR mismatched types
-        //~| expected `f32`, found integer
+        //~| NOTE expected `f32`, found integer
         y: 6,
     };
 
     let pair2 = PairF::<i32> {
         x: 7,
         //~^ ERROR mismatched types
-        //~| expected `f32`, found integer
+        //~| NOTE expected `f32`, found integer
         y: 8,
     };
 
diff --git a/tests/ui/structs/structure-constructor-type-mismatch.stderr b/tests/ui/structs/structure-constructor-type-mismatch.stderr
index 819b65f..7051891 100644
--- a/tests/ui/structs/structure-constructor-type-mismatch.stderr
+++ b/tests/ui/structs/structure-constructor-type-mismatch.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/structure-constructor-type-mismatch.rs:17:12
+  --> $DIR/structure-constructor-type-mismatch.rs:19:12
    |
 LL |         x: 1,
    |            ^ expected `f32`, found integer
@@ -10,7 +10,7 @@
    |             ++
 
 error[E0308]: mismatched types
-  --> $DIR/structure-constructor-type-mismatch.rs:20:12
+  --> $DIR/structure-constructor-type-mismatch.rs:22:12
    |
 LL |         y: 2,
    |            ^ expected `f32`, found integer
@@ -21,7 +21,7 @@
    |             ++
 
 error[E0308]: mismatched types
-  --> $DIR/structure-constructor-type-mismatch.rs:26:12
+  --> $DIR/structure-constructor-type-mismatch.rs:28:12
    |
 LL |         x: 3,
    |            ^ expected `f32`, found integer
@@ -32,7 +32,7 @@
    |             ++
 
 error[E0308]: mismatched types
-  --> $DIR/structure-constructor-type-mismatch.rs:29:12
+  --> $DIR/structure-constructor-type-mismatch.rs:31:12
    |
 LL |         y: 4,
    |            ^ expected `f32`, found integer
@@ -43,7 +43,7 @@
    |             ++
 
 error[E0308]: mismatched types
-  --> $DIR/structure-constructor-type-mismatch.rs:35:12
+  --> $DIR/structure-constructor-type-mismatch.rs:37:12
    |
 LL |         x: 5,
    |            ^ expected `f32`, found integer
@@ -54,7 +54,7 @@
    |             ++
 
 error[E0308]: mismatched types
-  --> $DIR/structure-constructor-type-mismatch.rs:42:12
+  --> $DIR/structure-constructor-type-mismatch.rs:44:12
    |
 LL |         x: 7,
    |            ^ expected `f32`, found integer
@@ -65,7 +65,7 @@
    |             ++
 
 error[E0107]: type alias takes 0 generic arguments but 1 generic argument was supplied
-  --> $DIR/structure-constructor-type-mismatch.rs:48:15
+  --> $DIR/structure-constructor-type-mismatch.rs:50:15
    |
 LL |     let pt3 = PointF::<i32> {
    |               ^^^^^^------- help: remove the unnecessary generics
@@ -73,13 +73,13 @@
    |               expected 0 generic arguments
    |
 note: type alias defined here, with 0 generic parameters
-  --> $DIR/structure-constructor-type-mismatch.rs:6:6
+  --> $DIR/structure-constructor-type-mismatch.rs:8:6
    |
 LL | type PointF = Point<f32>;
    |      ^^^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/structure-constructor-type-mismatch.rs:49:12
+  --> $DIR/structure-constructor-type-mismatch.rs:51:12
    |
 LL |         x: 9,
    |            ^ expected `f32`, found integer
@@ -90,7 +90,7 @@
    |             ++
 
 error[E0308]: mismatched types
-  --> $DIR/structure-constructor-type-mismatch.rs:50:12
+  --> $DIR/structure-constructor-type-mismatch.rs:52:12
    |
 LL |         y: 10,
    |            ^^ expected `f32`, found integer
@@ -101,7 +101,7 @@
    |              ++
 
 error[E0107]: type alias takes 0 generic arguments but 1 generic argument was supplied
-  --> $DIR/structure-constructor-type-mismatch.rs:54:9
+  --> $DIR/structure-constructor-type-mismatch.rs:56:9
    |
 LL |         PointF::<u32> { .. } => {}
    |         ^^^^^^------- help: remove the unnecessary generics
@@ -109,13 +109,13 @@
    |         expected 0 generic arguments
    |
 note: type alias defined here, with 0 generic parameters
-  --> $DIR/structure-constructor-type-mismatch.rs:6:6
+  --> $DIR/structure-constructor-type-mismatch.rs:8:6
    |
 LL | type PointF = Point<f32>;
    |      ^^^^^^
 
 error[E0308]: mismatched types
-  --> $DIR/structure-constructor-type-mismatch.rs:54:9
+  --> $DIR/structure-constructor-type-mismatch.rs:56:9
    |
 LL |     match (Point { x: 1, y: 2 }) {
    |           ---------------------- this expression has type `Point<{integer}>`
@@ -126,7 +126,7 @@
               found struct `Point<f32>`
 
 error[E0308]: mismatched types
-  --> $DIR/structure-constructor-type-mismatch.rs:59:9
+  --> $DIR/structure-constructor-type-mismatch.rs:61:9
    |
 LL |     match (Point { x: 1, y: 2 }) {
    |           ---------------------- this expression has type `Point<{integer}>`
@@ -137,7 +137,7 @@
               found struct `Point<f32>`
 
 error[E0308]: mismatched types
-  --> $DIR/structure-constructor-type-mismatch.rs:67:9
+  --> $DIR/structure-constructor-type-mismatch.rs:69:9
    |
 LL |     match (Pair { x: 1, y: 2 }) {
    |           --------------------- this expression has type `Pair<{integer}, {integer}>`
diff --git a/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs b/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs
index 1a440a9..ebe7117 100644
--- a/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs
+++ b/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.rs
@@ -1,10 +1,12 @@
+//@ dont-require-annotations: NOTE
+
 fn main() {
     let A = 3;
     //~^ ERROR refutable pattern in local binding
-    //~| patterns `i32::MIN..=1_i32` and `3_i32..=i32::MAX` not covered
+    //~| NOTE patterns `i32::MIN..=1_i32` and `3_i32..=i32::MAX` not covered
     //~| HELP introduce a variable instead
     //~| SUGGESTION A_var
 
     const A: i32 = 2;
-    //~^ missing patterns are not covered because `A` is interpreted as a constant pattern, not a new variable
+    //~^ NOTE missing patterns are not covered because `A` is interpreted as a constant pattern, not a new variable
 }
diff --git a/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr b/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr
index 0dc17f2..e670bac 100644
--- a/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr
+++ b/tests/ui/suggestions/const-pat-non-exaustive-let-new-var.stderr
@@ -1,5 +1,5 @@
 error[E0005]: refutable pattern in local binding
-  --> $DIR/const-pat-non-exaustive-let-new-var.rs:2:9
+  --> $DIR/const-pat-non-exaustive-let-new-var.rs:4:9
    |
 LL |     let A = 3;
    |         ^ patterns `i32::MIN..=1_i32` and `3_i32..=i32::MAX` not covered
diff --git a/tests/ui/test-attrs/test-should-panic-failed-show-span.run.stdout b/tests/ui/test-attrs/test-should-panic-failed-show-span.run.stdout
index 75600b4..93204ab 100644
--- a/tests/ui/test-attrs/test-should-panic-failed-show-span.run.stdout
+++ b/tests/ui/test-attrs/test-should-panic-failed-show-span.run.stdout
@@ -15,12 +15,12 @@
 note: test did not panic as expected at $DIR/test-should-panic-failed-show-span.rs:31:4
 ---- should_panic_with_substring_panics_with_incorrect_string stdout ----
 note: panic did not contain expected string
-      panic message: `"ZOMGWTFBBQ"`,
- expected substring: `"message"`
+      panic message: "ZOMGWTFBBQ"
+ expected substring: "message"
 ---- should_panic_with_substring_panics_with_non_string_value stdout ----
 note: expected panic with string value,
  found non-string value: `TypeId($HEX)`
-     expected substring: `"message"`
+     expected substring: "message"
 
 failures:
     should_panic_with_any_message_does_not_panic
diff --git a/tests/ui/traits/bound/same-crate-name.rs b/tests/ui/traits/bound/same-crate-name.rs
index 06d79a0..395b9630 100644
--- a/tests/ui/traits/bound/same-crate-name.rs
+++ b/tests/ui/traits/bound/same-crate-name.rs
@@ -1,5 +1,7 @@
 //@ aux-build:crate_a1.rs
 //@ aux-build:crate_a2.rs
+//@ dont-require-annotations: HELP
+//@ dont-require-annotations: NOTE
 
 // Issue 22750
 // This tests the extra help message reported when a trait bound
@@ -30,8 +32,8 @@ fn main() {
         extern crate crate_a1 as a;
         a::try_foo(foo);
         //~^ ERROR E0277
-        //~| trait impl with same name found
-        //~| perhaps two different versions of crate `crate_a2`
+        //~| HELP trait impl with same name found
+        //~| NOTE perhaps two different versions of crate `crate_a2`
 
         // We don't want to see the "version mismatch" help message here
         // because `implements_no_traits` has no impl for `Foo`
@@ -50,6 +52,6 @@ fn main() {
         // impls for the correct trait where the path is not misleading.
         a::try_foo(other_variant_implements_correct_trait);
         //~^ ERROR E0277
-        //~| the trait `main::a::Bar` is implemented for `ImplementsTraitForUsize<usize>`
+        //~| HELP the trait `main::a::Bar` is implemented for `ImplementsTraitForUsize<usize>`
     }
 }
diff --git a/tests/ui/traits/bound/same-crate-name.stderr b/tests/ui/traits/bound/same-crate-name.stderr
index f66cad7..71a8159 100644
--- a/tests/ui/traits/bound/same-crate-name.stderr
+++ b/tests/ui/traits/bound/same-crate-name.stderr
@@ -1,5 +1,5 @@
 error[E0277]: the trait bound `Foo: main::a::Bar` is not satisfied
-  --> $DIR/same-crate-name.rs:31:20
+  --> $DIR/same-crate-name.rs:33:20
    |
 LL |         a::try_foo(foo);
    |         ---------- ^^^ the trait `main::a::Bar` is not implemented for `Foo`
@@ -20,7 +20,7 @@
    |                        ^^^ required by this bound in `try_foo`
 
 error[E0277]: the trait bound `DoesNotImplementTrait: main::a::Bar` is not satisfied
-  --> $DIR/same-crate-name.rs:38:20
+  --> $DIR/same-crate-name.rs:40:20
    |
 LL |         a::try_foo(implements_no_traits);
    |         ---------- ^^^^^^^^^^^^^^^^^^^^ the trait `main::a::Bar` is not implemented for `DoesNotImplementTrait`
@@ -35,7 +35,7 @@
    |                        ^^^ required by this bound in `try_foo`
 
 error[E0277]: the trait bound `ImplementsWrongTraitConditionally<isize>: main::a::Bar` is not satisfied
-  --> $DIR/same-crate-name.rs:45:20
+  --> $DIR/same-crate-name.rs:47:20
    |
 LL |         a::try_foo(other_variant_implements_mismatched_trait);
    |         ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `main::a::Bar` is not implemented for `ImplementsWrongTraitConditionally<isize>`
@@ -56,7 +56,7 @@
    |                        ^^^ required by this bound in `try_foo`
 
 error[E0277]: the trait bound `ImplementsTraitForUsize<isize>: main::a::Bar` is not satisfied
-  --> $DIR/same-crate-name.rs:51:20
+  --> $DIR/same-crate-name.rs:53:20
    |
 LL |         a::try_foo(other_variant_implements_correct_trait);
    |         ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `main::a::Bar` is not implemented for `ImplementsTraitForUsize<isize>`
diff --git a/tests/ui/traits/const-traits/drop-manually-drop-no-drop-impl.rs b/tests/ui/traits/const-traits/drop-manually-drop-no-drop-impl.rs
new file mode 100644
index 0000000..060a543
--- /dev/null
+++ b/tests/ui/traits/const-traits/drop-manually-drop-no-drop-impl.rs
@@ -0,0 +1,17 @@
+//@[new] compile-flags: -Znext-solver
+//@ revisions: old new
+//@ check-pass
+
+use std::mem::ManuallyDrop;
+
+struct Moose;
+
+impl Drop for Moose {
+    fn drop(&mut self) {}
+}
+
+struct ConstDropper<T>(ManuallyDrop<T>);
+
+const fn foo(_var: ConstDropper<Moose>) {}
+
+fn main() {}
diff --git a/tests/ui/traits/const-traits/drop-manually-drop.rs b/tests/ui/traits/const-traits/drop-manually-drop.rs
new file mode 100644
index 0000000..62e8a81
--- /dev/null
+++ b/tests/ui/traits/const-traits/drop-manually-drop.rs
@@ -0,0 +1,24 @@
+//@[new] compile-flags: -Znext-solver
+//@ revisions: old new
+//@ check-pass
+
+#![feature(const_destruct)]
+#![feature(const_trait_impl)]
+
+use std::mem::ManuallyDrop;
+
+struct Moose;
+
+impl Drop for Moose {
+    fn drop(&mut self) {}
+}
+
+struct ConstDropper<T>(ManuallyDrop<T>);
+
+impl<T> const Drop for ConstDropper<T> {
+    fn drop(&mut self) {}
+}
+
+const fn foo(_var: ConstDropper<Moose>) {}
+
+fn main() {}
diff --git a/tests/ui/traits/impl-method-mismatch.rs b/tests/ui/traits/impl-method-mismatch.rs
index 6258075..a7de5e3 100644
--- a/tests/ui/traits/impl-method-mismatch.rs
+++ b/tests/ui/traits/impl-method-mismatch.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 trait Mumbo {
     fn jumbo(&self, x: &usize) -> usize;
 }
@@ -6,8 +8,8 @@ impl Mumbo for usize {
     // Cannot have a larger effect than the trait:
     unsafe fn jumbo(&self, x: &usize) { *self + *x; }
     //~^ ERROR method `jumbo` has an incompatible type for trait
-    //~| expected signature `fn
-    //~| found signature `unsafe fn
+    //~| NOTE expected signature `fn
+    //~| NOTE found signature `unsafe fn
 }
 
 fn main() {}
diff --git a/tests/ui/traits/impl-method-mismatch.stderr b/tests/ui/traits/impl-method-mismatch.stderr
index db457b7..ca8b35e 100644
--- a/tests/ui/traits/impl-method-mismatch.stderr
+++ b/tests/ui/traits/impl-method-mismatch.stderr
@@ -1,11 +1,11 @@
 error[E0053]: method `jumbo` has an incompatible type for trait
-  --> $DIR/impl-method-mismatch.rs:7:5
+  --> $DIR/impl-method-mismatch.rs:9:5
    |
 LL |     unsafe fn jumbo(&self, x: &usize) { *self + *x; }
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected safe fn, found unsafe fn
    |
 note: type in trait
-  --> $DIR/impl-method-mismatch.rs:2:5
+  --> $DIR/impl-method-mismatch.rs:4:5
    |
 LL |     fn jumbo(&self, x: &usize) -> usize;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/transmutability/unions/extension.rs b/tests/ui/transmutability/unions/extension.rs
new file mode 100644
index 0000000..eb4dcd4
--- /dev/null
+++ b/tests/ui/transmutability/unions/extension.rs
@@ -0,0 +1,12 @@
+#![crate_type = "lib"]
+#![feature(transmutability)]
+use std::mem::{Assume, MaybeUninit, TransmuteFrom};
+
+pub fn is_maybe_transmutable<Src, Dst>()
+    where Dst: TransmuteFrom<Src, { Assume::VALIDITY.and(Assume::SAFETY) }>
+{}
+
+fn extension() {
+    is_maybe_transmutable::<(), MaybeUninit<u8>>();
+    is_maybe_transmutable::<MaybeUninit<u8>, [u8; 2]>(); //~ ERROR  `MaybeUninit<u8>` cannot be safely transmuted into `[u8; 2]`
+}
diff --git a/tests/ui/transmutability/unions/extension.stderr b/tests/ui/transmutability/unions/extension.stderr
new file mode 100644
index 0000000..c99e46f
--- /dev/null
+++ b/tests/ui/transmutability/unions/extension.stderr
@@ -0,0 +1,17 @@
+error[E0277]: `MaybeUninit<u8>` cannot be safely transmuted into `[u8; 2]`
+  --> $DIR/extension.rs:11:46
+   |
+LL |     is_maybe_transmutable::<MaybeUninit<u8>, [u8; 2]>();
+   |                                              ^^^^^^^ the size of `MaybeUninit<u8>` is smaller than the size of `[u8; 2]`
+   |
+note: required by a bound in `is_maybe_transmutable`
+  --> $DIR/extension.rs:6:16
+   |
+LL | pub fn is_maybe_transmutable<Src, Dst>()
+   |        --------------------- required by a bound in this function
+LL |     where Dst: TransmuteFrom<Src, { Assume::VALIDITY.and(Assume::SAFETY) }>
+   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_maybe_transmutable`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/transmutability/unions/init_as_uninit.rs b/tests/ui/transmutability/unions/init_as_uninit.rs
new file mode 100644
index 0000000..d14eca8
--- /dev/null
+++ b/tests/ui/transmutability/unions/init_as_uninit.rs
@@ -0,0 +1,26 @@
+//@ check-pass
+// Regression test for issue #140337.
+#![crate_type = "lib"]
+#![feature(transmutability)]
+#![allow(dead_code)]
+use std::mem::{Assume, MaybeUninit, TransmuteFrom};
+
+pub fn is_transmutable<Src, Dst>()
+where
+    Dst: TransmuteFrom<Src, { Assume::SAFETY }>
+{}
+
+#[derive(Copy, Clone)]
+#[repr(u8)]
+pub enum B0 { Value = 0 }
+
+#[derive(Copy, Clone)]
+#[repr(u8)]
+pub enum B1 { Value = 1 }
+
+fn main() {
+    is_transmutable::<(B0, B0), MaybeUninit<(B0, B0)>>();
+    is_transmutable::<(B0, B0), MaybeUninit<(B0, B1)>>();
+    is_transmutable::<(B0, B0), MaybeUninit<(B1, B0)>>();
+    is_transmutable::<(B0, B0), MaybeUninit<(B1, B1)>>();
+}
diff --git a/tests/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs b/tests/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs
index 359ba51..24c6fa2 100644
--- a/tests/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs
+++ b/tests/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs
@@ -34,4 +34,19 @@ union B {
 
     assert::is_maybe_transmutable::<A, B>();
     assert::is_maybe_transmutable::<B, A>();
+
+    #[repr(C)]
+    struct C {
+        a: Ox00,
+        b: Ox00,
+    }
+
+    #[repr(C, align(2))]
+    struct D {
+        a: Ox00,
+    }
+
+    assert::is_maybe_transmutable::<C, D>();
+    // With Assume::VALIDITY a padding byte can hold any value.
+    assert::is_maybe_transmutable::<D, C>();
 }
diff --git a/tests/ui/tuple/tuple-arity-mismatch.rs b/tests/ui/tuple/tuple-arity-mismatch.rs
index f1e525c..0b7c9de 100644
--- a/tests/ui/tuple/tuple-arity-mismatch.rs
+++ b/tests/ui/tuple/tuple-arity-mismatch.rs
@@ -1,17 +1,19 @@
 // Issue #6155
 
+//@ dont-require-annotations: NOTE
+
 fn first((value, _): (isize, f64)) -> isize { value }
 
 fn main() {
     let y = first ((1,2.0,3));
     //~^ ERROR mismatched types
-    //~| expected tuple `(isize, f64)`
-    //~| found tuple `(isize, f64, {integer})`
-    //~| expected a tuple with 2 elements, found one with 3 elements
+    //~| NOTE expected tuple `(isize, f64)`
+    //~| NOTE found tuple `(isize, f64, {integer})`
+    //~| NOTE expected a tuple with 2 elements, found one with 3 elements
 
     let y = first ((1,));
     //~^ ERROR mismatched types
-    //~| expected tuple `(isize, f64)`
-    //~| found tuple `(isize,)`
-    //~| expected a tuple with 2 elements, found one with 1 element
+    //~| NOTE expected tuple `(isize, f64)`
+    //~| NOTE found tuple `(isize,)`
+    //~| NOTE expected a tuple with 2 elements, found one with 1 element
 }
diff --git a/tests/ui/tuple/tuple-arity-mismatch.stderr b/tests/ui/tuple/tuple-arity-mismatch.stderr
index fff7be9..49dd98b 100644
--- a/tests/ui/tuple/tuple-arity-mismatch.stderr
+++ b/tests/ui/tuple/tuple-arity-mismatch.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/tuple-arity-mismatch.rs:6:20
+  --> $DIR/tuple-arity-mismatch.rs:8:20
    |
 LL |     let y = first ((1,2.0,3));
    |             -----  ^^^^^^^^^ expected a tuple with 2 elements, found one with 3 elements
@@ -9,13 +9,13 @@
    = note: expected tuple `(isize, f64)`
               found tuple `(isize, f64, {integer})`
 note: function defined here
-  --> $DIR/tuple-arity-mismatch.rs:3:4
+  --> $DIR/tuple-arity-mismatch.rs:5:4
    |
 LL | fn first((value, _): (isize, f64)) -> isize { value }
    |    ^^^^^ ------------------------
 
 error[E0308]: mismatched types
-  --> $DIR/tuple-arity-mismatch.rs:12:20
+  --> $DIR/tuple-arity-mismatch.rs:14:20
    |
 LL |     let y = first ((1,));
    |             -----  ^^^^ expected a tuple with 2 elements, found one with 1 element
@@ -25,7 +25,7 @@
    = note: expected tuple `(isize, f64)`
               found tuple `(isize,)`
 note: function defined here
-  --> $DIR/tuple-arity-mismatch.rs:3:4
+  --> $DIR/tuple-arity-mismatch.rs:5:4
    |
 LL | fn first((value, _): (isize, f64)) -> isize { value }
    |    ^^^^^ ------------------------
diff --git a/tests/ui/type/type-mismatch-multiple.rs b/tests/ui/type/type-mismatch-multiple.rs
index 55d6cee..faae52c 100644
--- a/tests/ui/type/type-mismatch-multiple.rs
+++ b/tests/ui/type/type-mismatch-multiple.rs
@@ -1,7 +1,9 @@
 // Checking that the compiler reports multiple type errors at once
 
+//@ dont-require-annotations: NOTE
+
 fn main() { let a: bool = 1; let b: i32 = true; }
 //~^ ERROR mismatched types
-//~| expected `bool`, found integer
+//~| NOTE expected `bool`, found integer
 //~| ERROR mismatched types
-//~| expected `i32`, found `bool`
+//~| NOTE expected `i32`, found `bool`
diff --git a/tests/ui/type/type-mismatch-multiple.stderr b/tests/ui/type/type-mismatch-multiple.stderr
index 2e8654d..50078e5 100644
--- a/tests/ui/type/type-mismatch-multiple.stderr
+++ b/tests/ui/type/type-mismatch-multiple.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/type-mismatch-multiple.rs:3:27
+  --> $DIR/type-mismatch-multiple.rs:5:27
    |
 LL | fn main() { let a: bool = 1; let b: i32 = true; }
    |                    ----   ^ expected `bool`, found integer
@@ -7,7 +7,7 @@
    |                    expected due to this
 
 error[E0308]: mismatched types
-  --> $DIR/type-mismatch-multiple.rs:3:43
+  --> $DIR/type-mismatch-multiple.rs:5:43
    |
 LL | fn main() { let a: bool = 1; let b: i32 = true; }
    |                                     ---   ^^^^ expected `i32`, found `bool`
diff --git a/tests/ui/type/type-parameter-names.rs b/tests/ui/type/type-parameter-names.rs
index b54a3fa..fbd1885 100644
--- a/tests/ui/type/type-parameter-names.rs
+++ b/tests/ui/type/type-parameter-names.rs
@@ -1,12 +1,14 @@
 // Test that we print out the names of type parameters correctly in
 // our error messages.
 
+//@ dont-require-annotations: NOTE
+
 fn foo<Foo, Bar>(x: Foo) -> Bar {
     x
 //~^ ERROR mismatched types
-//~| expected type parameter `Bar`, found type parameter `Foo`
-//~| expected type parameter `Bar`
-//~| found type parameter `Foo`
+//~| NOTE expected type parameter `Bar`, found type parameter `Foo`
+//~| NOTE expected type parameter `Bar`
+//~| NOTE found type parameter `Foo`
 }
 
 fn main() {}
diff --git a/tests/ui/type/type-parameter-names.stderr b/tests/ui/type/type-parameter-names.stderr
index be9000a..795a260 100644
--- a/tests/ui/type/type-parameter-names.stderr
+++ b/tests/ui/type/type-parameter-names.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/type-parameter-names.rs:5:5
+  --> $DIR/type-parameter-names.rs:7:5
    |
 LL | fn foo<Foo, Bar>(x: Foo) -> Bar {
    |        ---  ---             --- expected `Bar` because of return type
diff --git a/tests/ui/type/type-params-in-different-spaces-1.rs b/tests/ui/type/type-params-in-different-spaces-1.rs
index 6efd14d..2cde1de 100644
--- a/tests/ui/type/type-params-in-different-spaces-1.rs
+++ b/tests/ui/type/type-params-in-different-spaces-1.rs
@@ -1,11 +1,13 @@
+//@ dont-require-annotations: NOTE
+
 use std::ops::Add;
 
 trait BrokenAdd: Copy + Add<Output=Self> {
     fn broken_add<T>(&self, rhs: T) -> Self {
         *self + rhs //~  ERROR mismatched types
-                    //~| expected type parameter `Self`, found type parameter `T`
-                    //~| expected type parameter `Self`
-                    //~| found type parameter `T`
+                    //~| NOTE expected type parameter `Self`, found type parameter `T`
+                    //~| NOTE expected type parameter `Self`
+                    //~| NOTE found type parameter `T`
     }
 }
 
diff --git a/tests/ui/type/type-params-in-different-spaces-1.stderr b/tests/ui/type/type-params-in-different-spaces-1.stderr
index 1d0e097..e9480b0 100644
--- a/tests/ui/type/type-params-in-different-spaces-1.stderr
+++ b/tests/ui/type/type-params-in-different-spaces-1.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/type-params-in-different-spaces-1.rs:5:17
+  --> $DIR/type-params-in-different-spaces-1.rs:7:17
    |
 LL | trait BrokenAdd: Copy + Add<Output=Self> {
    | ---------------------------------------- expected type parameter
diff --git a/tests/ui/typeck/issue-16338.rs b/tests/ui/typeck/issue-16338.rs
index 321b357..6c02eb9 100644
--- a/tests/ui/typeck/issue-16338.rs
+++ b/tests/ui/typeck/issue-16338.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 struct Slice<T> {
     data: *const T,
     len: usize,
@@ -6,5 +8,5 @@
 fn main() {
     let Slice { data: data, len: len } = "foo";
     //~^ ERROR mismatched types
-    //~| found struct `Slice<_>`
+    //~| NOTE found struct `Slice<_>`
 }
diff --git a/tests/ui/typeck/issue-16338.stderr b/tests/ui/typeck/issue-16338.stderr
index e24b9bfa..8c5c6ad 100644
--- a/tests/ui/typeck/issue-16338.stderr
+++ b/tests/ui/typeck/issue-16338.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-16338.rs:7:9
+  --> $DIR/issue-16338.rs:9:9
    |
 LL |     let Slice { data: data, len: len } = "foo";
    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^   ----- this expression has type `&str`
diff --git a/tests/ui/typeck/suppressed-error.rs b/tests/ui/typeck/suppressed-error.rs
index 1e39be4..b7e5b22 100644
--- a/tests/ui/typeck/suppressed-error.rs
+++ b/tests/ui/typeck/suppressed-error.rs
@@ -1,8 +1,9 @@
 fn main() {
     let (x, y) = ();
 //~^ ERROR mismatched types
-//~| expected unit type `()`
-//~| found tuple `(_, _)`
-//~| expected `()`, found
+//~| NOTE expected unit type `()`
+//~| NOTE found tuple `(_, _)`
+//~| NOTE expected `()`, found
+//~| NOTE this expression has type `()`
     return x;
 }
diff --git a/tests/ui/typeck/tag-that-dare-not-speak-its-name.rs b/tests/ui/typeck/tag-that-dare-not-speak-its-name.rs
index 0e76ec2..79aa1f2 100644
--- a/tests/ui/typeck/tag-that-dare-not-speak-its-name.rs
+++ b/tests/ui/typeck/tag-that-dare-not-speak-its-name.rs
@@ -10,7 +10,8 @@ fn main() {
     let y;
     let x : char = last(y);
     //~^ ERROR mismatched types
-    //~| expected type `char`
-    //~| found enum `Option<_>`
-    //~| expected `char`, found `Option<_>`
+    //~| NOTE expected type `char`
+    //~| NOTE found enum `Option<_>`
+    //~| NOTE expected `char`, found `Option<_>`
+    //~| NOTE expected due to this
 }
diff --git a/tests/ui/typeck/terr-in-field.rs b/tests/ui/typeck/terr-in-field.rs
index cfe350e..1b8f76f 100644
--- a/tests/ui/typeck/terr-in-field.rs
+++ b/tests/ui/typeck/terr-in-field.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 struct Foo {
     a: isize,
     b: isize,
@@ -11,7 +13,7 @@ struct Bar {
 fn want_foo(f: Foo) {}
 fn have_bar(b: Bar) {
     want_foo(b); //~  ERROR mismatched types
-                 //~| expected `Foo`, found `Bar`
+                 //~| NOTE expected `Foo`, found `Bar`
 }
 
 fn main() {}
diff --git a/tests/ui/typeck/terr-in-field.stderr b/tests/ui/typeck/terr-in-field.stderr
index adc336d..37e55af 100644
--- a/tests/ui/typeck/terr-in-field.stderr
+++ b/tests/ui/typeck/terr-in-field.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/terr-in-field.rs:13:14
+  --> $DIR/terr-in-field.rs:15:14
    |
 LL |     want_foo(b);
    |     -------- ^ expected `Foo`, found `Bar`
@@ -7,7 +7,7 @@
    |     arguments to this function are incorrect
    |
 note: function defined here
-  --> $DIR/terr-in-field.rs:11:4
+  --> $DIR/terr-in-field.rs:13:4
    |
 LL | fn want_foo(f: Foo) {}
    |    ^^^^^^^^ ------
diff --git a/tests/ui/typeck/terr-sorts.rs b/tests/ui/typeck/terr-sorts.rs
index c1e2f7d..439d271 100644
--- a/tests/ui/typeck/terr-sorts.rs
+++ b/tests/ui/typeck/terr-sorts.rs
@@ -1,3 +1,5 @@
+//@ dont-require-annotations: NOTE
+
 struct Foo {
     a: isize,
     b: isize,
@@ -8,8 +10,8 @@
 fn want_foo(f: Foo) {}
 fn have_bar(b: Bar) {
     want_foo(b); //~  ERROR mismatched types
-                 //~| expected struct `Foo`
-                 //~| found struct `Box<Foo>`
+                 //~| NOTE expected struct `Foo`
+                 //~| NOTE found struct `Box<Foo>`
 }
 
 fn main() {}
diff --git a/tests/ui/typeck/terr-sorts.stderr b/tests/ui/typeck/terr-sorts.stderr
index 59d9392..0f649f2 100644
--- a/tests/ui/typeck/terr-sorts.stderr
+++ b/tests/ui/typeck/terr-sorts.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/terr-sorts.rs:10:14
+  --> $DIR/terr-sorts.rs:12:14
    |
 LL |     want_foo(b);
    |     -------- ^ expected `Foo`, found `Box<Foo>`
@@ -9,7 +9,7 @@
    = note: expected struct `Foo`
               found struct `Box<Foo>`
 note: function defined here
-  --> $DIR/terr-sorts.rs:8:4
+  --> $DIR/terr-sorts.rs:10:4
    |
 LL | fn want_foo(f: Foo) {}
    |    ^^^^^^^^ ------
diff --git a/tests/ui/typeck/typeck_type_placeholder_mismatch.rs b/tests/ui/typeck/typeck_type_placeholder_mismatch.rs
index 718b6de..cedda4a6 100644
--- a/tests/ui/typeck/typeck_type_placeholder_mismatch.rs
+++ b/tests/ui/typeck/typeck_type_placeholder_mismatch.rs
@@ -1,6 +1,8 @@
 // This test checks that genuine type errors with partial
 // type hints are understandable.
 
+//@ dont-require-annotations: NOTE
+
 use std::marker::PhantomData;
 
 struct Foo<T>(PhantomData<T>);
@@ -12,16 +14,16 @@ pub fn main() {
 fn test1() {
     let x: Foo<_> = Bar::<usize>(PhantomData);
     //~^ ERROR mismatched types
-    //~| expected struct `Foo<_>`
-    //~| found struct `Bar<usize>`
-    //~| expected `Foo<_>`, found `Bar<usize>`
+    //~| NOTE expected struct `Foo<_>`
+    //~| NOTE found struct `Bar<usize>`
+    //~| NOTE expected `Foo<_>`, found `Bar<usize>`
     let y: Foo<usize> = x;
 }
 
 fn test2() {
     let x: Foo<_> = Bar::<usize>(PhantomData);
     //~^ ERROR mismatched types
-    //~| expected struct `Foo<_>`
-    //~| found struct `Bar<usize>`
-    //~| expected `Foo<_>`, found `Bar<usize>`
+    //~| NOTE expected struct `Foo<_>`
+    //~| NOTE found struct `Bar<usize>`
+    //~| NOTE expected `Foo<_>`, found `Bar<usize>`
 }
diff --git a/tests/ui/typeck/typeck_type_placeholder_mismatch.stderr b/tests/ui/typeck/typeck_type_placeholder_mismatch.stderr
index bf8e0bbb..c6e42ec 100644
--- a/tests/ui/typeck/typeck_type_placeholder_mismatch.stderr
+++ b/tests/ui/typeck/typeck_type_placeholder_mismatch.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/typeck_type_placeholder_mismatch.rs:13:21
+  --> $DIR/typeck_type_placeholder_mismatch.rs:15:21
    |
 LL |     let x: Foo<_> = Bar::<usize>(PhantomData);
    |            ------   ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Foo<_>`, found `Bar<usize>`
@@ -10,7 +10,7 @@
               found struct `Bar<usize>`
 
 error[E0308]: mismatched types
-  --> $DIR/typeck_type_placeholder_mismatch.rs:22:21
+  --> $DIR/typeck_type_placeholder_mismatch.rs:24:21
    |
 LL |     let x: Foo<_> = Bar::<usize>(PhantomData);
    |            ------   ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Foo<_>`, found `Bar<usize>`
diff --git a/tests/ui/typeof/type_mismatch.rs b/tests/ui/typeof/type_mismatch.rs
index 3f8339f..a3444d6 100644
--- a/tests/ui/typeof/type_mismatch.rs
+++ b/tests/ui/typeof/type_mismatch.rs
@@ -1,9 +1,12 @@
 // Test that using typeof results in the correct type mismatch errors instead of always assuming
 // `usize`, in addition to the pre-existing "typeof is reserved and unimplemented" error
+
+//@ dont-require-annotations: NOTE
+
 fn main() {
     const a: u8 = 1;
     let b: typeof(a) = 1i8;
     //~^ ERROR `typeof` is a reserved keyword but unimplemented
     //~| ERROR mismatched types
-    //~| expected `u8`, found `i8`
+    //~| NOTE expected `u8`, found `i8`
 }
diff --git a/tests/ui/typeof/type_mismatch.stderr b/tests/ui/typeof/type_mismatch.stderr
index d549492..6a414c1 100644
--- a/tests/ui/typeof/type_mismatch.stderr
+++ b/tests/ui/typeof/type_mismatch.stderr
@@ -1,5 +1,5 @@
 error[E0516]: `typeof` is a reserved keyword but unimplemented
-  --> $DIR/type_mismatch.rs:5:12
+  --> $DIR/type_mismatch.rs:8:12
    |
 LL |     let b: typeof(a) = 1i8;
    |            ^^^^^^^^^ reserved keyword
@@ -11,7 +11,7 @@
    |
 
 error[E0308]: mismatched types
-  --> $DIR/type_mismatch.rs:5:24
+  --> $DIR/type_mismatch.rs:8:24
    |
 LL |     let b: typeof(a) = 1i8;
    |            ---------   ^^^ expected `u8`, found `i8`
diff --git a/tests/ui/ufcs/ufcs-explicit-self-bad.rs b/tests/ui/ufcs/ufcs-explicit-self-bad.rs
index 29586dc..7039ab3 100644
--- a/tests/ui/ufcs/ufcs-explicit-self-bad.rs
+++ b/tests/ui/ufcs/ufcs-explicit-self-bad.rs
@@ -1,13 +1,13 @@
+//@ dont-require-annotations: NOTE
+
 struct Foo {
     f: isize,
 }
 
-
-
 impl Foo {
     fn foo(self: isize, x: isize) -> isize {
         //~^ ERROR invalid `self` parameter type
-        self.f + x //~ ERROR: doesn't have fields
+        self.f + x //~ ERROR doesn't have fields
     }
 }
 
@@ -39,13 +39,13 @@ fn dummy2(self: &Bar<T>) {} //~ ERROR mismatched `self` parameter type
     //~| ERROR has an incompatible type for trait
     fn dummy3(self: &&Bar<T>) {}
     //~^ ERROR mismatched `self` parameter type
-    //~| expected reference `&'a Bar<_>`
-    //~| found reference `&Bar<_>`
-    //~| lifetime mismatch
+    //~| NOTE expected reference `&'a Bar<_>`
+    //~| NOTE found reference `&Bar<_>`
+    //~| NOTE lifetime mismatch
     //~| ERROR mismatched `self` parameter type
-    //~| expected reference `&'a Bar<_>`
-    //~| found reference `&Bar<_>`
-    //~| lifetime mismatch
+    //~| NOTE expected reference `&'a Bar<_>`
+    //~| NOTE found reference `&Bar<_>`
+    //~| NOTE lifetime mismatch
 }
 
 fn main() {
diff --git a/tests/ui/unpretty/expanded-exhaustive.stdout b/tests/ui/unpretty/expanded-exhaustive.stdout
index 841edf6..c6ffbb0 100644
--- a/tests/ui/unpretty/expanded-exhaustive.stdout
+++ b/tests/ui/unpretty/expanded-exhaustive.stdout
@@ -505,7 +505,7 @@
     mod item_mac_call { }
     /// ItemKind::MacroDef
     mod item_macro_def {
-        macro_rules! mac { () => { ... }; }
+        macro_rules! mac { () => {...}; }
         pub macro stringify { () => {} }
     }
     /// ItemKind::Delegation
diff --git a/tests/ui/unsafe/unsafe-trait-impl.rs b/tests/ui/unsafe/unsafe-trait-impl.rs
index 9fd9ff6..dc7e119 100644
--- a/tests/ui/unsafe/unsafe-trait-impl.rs
+++ b/tests/ui/unsafe/unsafe-trait-impl.rs
@@ -1,5 +1,7 @@
 // Check that safe fns are not a subtype of unsafe fns.
 
+//@ dont-require-annotations: NOTE
+
 trait Foo {
     unsafe fn len(&self) -> u32;
 }
@@ -7,8 +9,8 @@ trait Foo {
 impl Foo for u32 {
     fn len(&self) -> u32 { *self }
     //~^ ERROR method `len` has an incompatible type for trait
-    //~| expected signature `unsafe fn(&_) -> _`
-    //~| found signature `fn(&_) -> _`
+    //~| NOTE expected signature `unsafe fn(&_) -> _`
+    //~| NOTE found signature `fn(&_) -> _`
 }
 
 fn main() { }
diff --git a/tests/ui/unsafe/unsafe-trait-impl.stderr b/tests/ui/unsafe/unsafe-trait-impl.stderr
index b9f2e1c..8febbb7 100644
--- a/tests/ui/unsafe/unsafe-trait-impl.stderr
+++ b/tests/ui/unsafe/unsafe-trait-impl.stderr
@@ -1,11 +1,11 @@
 error[E0053]: method `len` has an incompatible type for trait
-  --> $DIR/unsafe-trait-impl.rs:8:5
+  --> $DIR/unsafe-trait-impl.rs:10:5
    |
 LL |     fn len(&self) -> u32 { *self }
    |     ^^^^^^^^^^^^^^^^^^^^ expected unsafe fn, found safe fn
    |
 note: type in trait
-  --> $DIR/unsafe-trait-impl.rs:4:5
+  --> $DIR/unsafe-trait-impl.rs:6:5
    |
 LL |     unsafe fn len(&self) -> u32;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/wf/range-expr-root-of-constant-issue-40749.rs b/tests/ui/wf/range-expr-root-of-constant-issue-40749.rs
index 0a84785..7871612 100644
--- a/tests/ui/wf/range-expr-root-of-constant-issue-40749.rs
+++ b/tests/ui/wf/range-expr-root-of-constant-issue-40749.rs
@@ -1,6 +1,7 @@
 fn main() {
     [0; ..10];
     //~^ ERROR mismatched types
-    //~| expected type `usize`
-    //~| found struct `RangeTo<{integer}>`
+    //~| NOTE expected type `usize`
+    //~| NOTE found struct `RangeTo<{integer}>`
+    //~| NOTE expected `usize`, found `RangeTo<{integer}>
 }