about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_expand/messages.ftl26
-rw-r--r--compiler/rustc_expand/src/errors.rs44
-rw-r--r--compiler/rustc_expand/src/mbe/metavar_expr.rs98
-rw-r--r--compiler/rustc_lint_defs/src/builtin.rs3
-rw-r--r--library/core/src/slice/mod.rs32
-rw-r--r--library/proc_macro/src/bridge/symbol.rs4
m---------src/llvm-project0
-rw-r--r--tests/codegen/enum/enum-match.rs2
-rw-r--r--tests/ui/codegen/output-slot-init-vs-noninit.rs (renamed from tests/ui/output-slot-variants.rs)54
-rw-r--r--tests/ui/codegen/remark-flag-functionality.rs (renamed from tests/ui/optimization-remark.rs)14
-rw-r--r--tests/ui/codegen/shift-right-operand-mutation.rs19
-rw-r--r--tests/ui/codegen/sret-aliasing-rules.rs28
-rw-r--r--tests/ui/imports/ambiguous-1.rs2
-rw-r--r--tests/ui/imports/ambiguous-1.stderr42
-rw-r--r--tests/ui/imports/ambiguous-10.rs3
-rw-r--r--tests/ui/imports/ambiguous-10.stderr36
-rw-r--r--tests/ui/imports/ambiguous-12.rs3
-rw-r--r--tests/ui/imports/ambiguous-12.stderr36
-rw-r--r--tests/ui/imports/ambiguous-13.rs3
-rw-r--r--tests/ui/imports/ambiguous-13.stderr36
-rw-r--r--tests/ui/imports/ambiguous-14.rs3
-rw-r--r--tests/ui/imports/ambiguous-14.stderr36
-rw-r--r--tests/ui/imports/ambiguous-15.rs3
-rw-r--r--tests/ui/imports/ambiguous-15.stderr36
-rw-r--r--tests/ui/imports/ambiguous-16.rs3
-rw-r--r--tests/ui/imports/ambiguous-16.stderr36
-rw-r--r--tests/ui/imports/ambiguous-17.rs3
-rw-r--r--tests/ui/imports/ambiguous-17.stderr38
-rw-r--r--tests/ui/imports/ambiguous-3.rs3
-rw-r--r--tests/ui/imports/ambiguous-3.stderr36
-rw-r--r--tests/ui/imports/ambiguous-4-extern.rs2
-rw-r--r--tests/ui/imports/ambiguous-4-extern.stderr42
-rw-r--r--tests/ui/imports/ambiguous-4.rs2
-rw-r--r--tests/ui/imports/ambiguous-5.rs3
-rw-r--r--tests/ui/imports/ambiguous-5.stderr36
-rw-r--r--tests/ui/imports/ambiguous-6.rs3
-rw-r--r--tests/ui/imports/ambiguous-6.stderr36
-rw-r--r--tests/ui/imports/ambiguous-9.rs5
-rw-r--r--tests/ui/imports/ambiguous-9.stderr72
-rw-r--r--tests/ui/imports/duplicate.rs2
-rw-r--r--tests/ui/imports/duplicate.stderr30
-rw-r--r--tests/ui/imports/unresolved-seg-after-ambiguous.rs2
-rw-r--r--tests/ui/imports/unresolved-seg-after-ambiguous.stderr30
-rw-r--r--tests/ui/macros/macro-paren-span-diagnostic.rs (renamed from tests/ui/paren-span.rs)6
-rw-r--r--tests/ui/macros/macro-paren-span-diagnostic.stderr (renamed from tests/ui/paren-span.stderr)2
-rw-r--r--tests/ui/macros/metavar-expressions/syntax-errors.rs33
-rw-r--r--tests/ui/macros/metavar-expressions/syntax-errors.stderr192
-rw-r--r--tests/ui/out-pointer-aliasing.rs23
-rw-r--r--tests/ui/over-constrained-vregs.rs12
-rw-r--r--tests/ui/panic_implementation-closures.rs10
-rw-r--r--tests/ui/panics/panic-during-display-formatting.rs (renamed from tests/ui/panic-while-printing.rs)12
-rw-r--r--tests/ui/panics/panic-handler-closures.rs12
-rw-r--r--tests/ui/parser/ufcs-return-unused-parens.fixed20
-rw-r--r--tests/ui/parser/ufcs-return-unused-parens.rs20
-rw-r--r--tests/ui/parser/ufcs-return-unused-parens.stderr (renamed from tests/ui/path-lookahead.stderr)4
-rw-r--r--tests/ui/path-lookahead.fixed17
-rw-r--r--tests/ui/path-lookahead.rs17
-rw-r--r--tests/ui/proc-macro/auxiliary/mixed-site-span.rs110
-rw-r--r--tests/ui/proc-macro/auxiliary/token-site-span.rs30
-rw-r--r--tests/ui/proc-macro/mixed-site-span.rs164
-rw-r--r--tests/ui/proc-macro/mixed-site-span.stderr600
-rw-r--r--tests/ui/traits/partialeq-ref-mismatch-diagnostic.rs (renamed from tests/ui/partialeq_help.rs)4
-rw-r--r--tests/ui/traits/partialeq-ref-mismatch-diagnostic.stderr (renamed from tests/ui/partialeq_help.stderr)8
63 files changed, 1822 insertions, 421 deletions
diff --git a/compiler/rustc_expand/messages.ftl b/compiler/rustc_expand/messages.ftl
index 3fc0fa06191..89d6e62834d 100644
--- a/compiler/rustc_expand/messages.ftl
+++ b/compiler/rustc_expand/messages.ftl
@@ -133,6 +133,32 @@ expand_module_multiple_candidates =
 expand_must_repeat_once =
     this must repeat at least once
 
+expand_mve_extra_tokens =
+    unexpected trailing tokens
+    .label = for this metavariable expression
+    .range = the `{$name}` metavariable expression takes between {$min_or_exact_args} and {$max_args} arguments
+    .exact = the `{$name}` metavariable expression takes {$min_or_exact_args ->
+        [zero] no arguments
+        [one] a single argument
+        *[other] {$min_or_exact_args} arguments
+    }
+    .suggestion = try removing {$extra_count ->
+        [one] this token
+        *[other] these tokens
+    }
+
+expand_mve_missing_paren =
+    expected `(`
+    .label = for this this metavariable expression
+    .unexpected = unexpected token
+    .note = metavariable expressions use function-like parentheses syntax
+    .suggestion = try adding parentheses
+
+expand_mve_unrecognized_expr =
+    unrecognized metavariable expression
+    .label = not a valid metavariable expression
+    .note = valid metavariable expressions are {$valid_expr_list}
+
 expand_mve_unrecognized_var =
     variable `{$key}` is not recognized in meta-variable expression
 
diff --git a/compiler/rustc_expand/src/errors.rs b/compiler/rustc_expand/src/errors.rs
index fdbc65aff68..3ac5d213053 100644
--- a/compiler/rustc_expand/src/errors.rs
+++ b/compiler/rustc_expand/src/errors.rs
@@ -496,6 +496,50 @@ pub(crate) use metavar_exprs::*;
 mod metavar_exprs {
     use super::*;
 
+    #[derive(Diagnostic, Default)]
+    #[diag(expand_mve_extra_tokens)]
+    pub(crate) struct MveExtraTokens {
+        #[primary_span]
+        #[suggestion(code = "", applicability = "machine-applicable")]
+        pub span: Span,
+        #[label]
+        pub ident_span: Span,
+        pub extra_count: usize,
+
+        // The rest is only used for specific diagnostics and can be default if neither
+        // `note` is `Some`.
+        #[note(expand_exact)]
+        pub exact_args_note: Option<()>,
+        #[note(expand_range)]
+        pub range_args_note: Option<()>,
+        pub min_or_exact_args: usize,
+        pub max_args: usize,
+        pub name: String,
+    }
+
+    #[derive(Diagnostic)]
+    #[note]
+    #[diag(expand_mve_missing_paren)]
+    pub(crate) struct MveMissingParen {
+        #[primary_span]
+        #[label]
+        pub ident_span: Span,
+        #[label(expand_unexpected)]
+        pub unexpected_span: Option<Span>,
+        #[suggestion(code = "( /* ... */ )", applicability = "has-placeholders")]
+        pub insert_span: Option<Span>,
+    }
+
+    #[derive(Diagnostic)]
+    #[note]
+    #[diag(expand_mve_unrecognized_expr)]
+    pub(crate) struct MveUnrecognizedExpr {
+        #[primary_span]
+        #[label]
+        pub span: Span,
+        pub valid_expr_list: &'static str,
+    }
+
     #[derive(Diagnostic)]
     #[diag(expand_mve_unrecognized_var)]
     pub(crate) struct MveUnrecognizedVar {
diff --git a/compiler/rustc_expand/src/mbe/metavar_expr.rs b/compiler/rustc_expand/src/mbe/metavar_expr.rs
index ffd3548019a..d2b275ad20a 100644
--- a/compiler/rustc_expand/src/mbe/metavar_expr.rs
+++ b/compiler/rustc_expand/src/mbe/metavar_expr.rs
@@ -7,6 +7,8 @@ use rustc_macros::{Decodable, Encodable};
 use rustc_session::parse::ParseSess;
 use rustc_span::{Ident, Span, Symbol};
 
+use crate::errors;
+
 pub(crate) const RAW_IDENT_ERR: &str = "`${concat(..)}` currently does not support raw identifiers";
 pub(crate) const UNSUPPORTED_CONCAT_ELEM_ERR: &str = "expected identifier or string literal";
 
@@ -40,11 +42,32 @@ impl MetaVarExpr {
     ) -> PResult<'psess, MetaVarExpr> {
         let mut iter = input.iter();
         let ident = parse_ident(&mut iter, psess, outer_span)?;
-        let Some(TokenTree::Delimited(.., Delimiter::Parenthesis, args)) = iter.next() else {
-            let msg = "meta-variable expression parameter must be wrapped in parentheses";
-            return Err(psess.dcx().struct_span_err(ident.span, msg));
+        let next = iter.next();
+        let Some(TokenTree::Delimited(.., Delimiter::Parenthesis, args)) = next else {
+            // No `()`; wrong or no delimiters. Point at a problematic span or a place to
+            // add parens if it makes sense.
+            let (unexpected_span, insert_span) = match next {
+                Some(TokenTree::Delimited(..)) => (None, None),
+                Some(tt) => (Some(tt.span()), None),
+                None => (None, Some(ident.span.shrink_to_hi())),
+            };
+            let err =
+                errors::MveMissingParen { ident_span: ident.span, unexpected_span, insert_span };
+            return Err(psess.dcx().create_err(err));
         };
-        check_trailing_token(&mut iter, psess)?;
+
+        // Ensure there are no trailing tokens in the braces, e.g. `${foo() extra}`
+        if iter.peek().is_some() {
+            let span = iter_span(&iter).expect("checked is_some above");
+            let err = errors::MveExtraTokens {
+                span,
+                ident_span: ident.span,
+                extra_count: iter.count(),
+                ..Default::default()
+            };
+            return Err(psess.dcx().create_err(err));
+        }
+
         let mut iter = args.iter();
         let rslt = match ident.as_str() {
             "concat" => parse_concat(&mut iter, psess, outer_span, ident.span)?,
@@ -56,18 +79,14 @@ impl MetaVarExpr {
             "index" => MetaVarExpr::Index(parse_depth(&mut iter, psess, ident.span)?),
             "len" => MetaVarExpr::Len(parse_depth(&mut iter, psess, ident.span)?),
             _ => {
-                let err_msg = "unrecognized meta-variable expression";
-                let mut err = psess.dcx().struct_span_err(ident.span, err_msg);
-                err.span_suggestion(
-                    ident.span,
-                    "supported expressions are count, ignore, index and len",
-                    "",
-                    Applicability::MachineApplicable,
-                );
-                return Err(err);
+                let err = errors::MveUnrecognizedExpr {
+                    span: ident.span,
+                    valid_expr_list: "`count`, `ignore`, `index`, `len`, and `concat`",
+                };
+                return Err(psess.dcx().create_err(err));
             }
         };
-        check_trailing_token(&mut iter, psess)?;
+        check_trailing_tokens(&mut iter, psess, ident)?;
         Ok(rslt)
     }
 
@@ -87,20 +106,51 @@ impl MetaVarExpr {
     }
 }
 
-// Checks if there are any remaining tokens. For example, `${ignore(ident ... a b c ...)}`
-fn check_trailing_token<'psess>(
+/// Checks if there are any remaining tokens (for example, `${ignore($valid, extra)}`) and create
+/// a diag with the correct arg count if so.
+fn check_trailing_tokens<'psess>(
     iter: &mut TokenStreamIter<'_>,
     psess: &'psess ParseSess,
+    ident: Ident,
 ) -> PResult<'psess, ()> {
-    if let Some(tt) = iter.next() {
-        let mut diag = psess
-            .dcx()
-            .struct_span_err(tt.span(), format!("unexpected token: {}", pprust::tt_to_string(tt)));
-        diag.span_note(tt.span(), "meta-variable expression must not have trailing tokens");
-        Err(diag)
-    } else {
-        Ok(())
+    if iter.peek().is_none() {
+        // All tokens consumed, as expected
+        return Ok(());
     }
+
+    // `None` for max indicates the arg count must be exact, `Some` indicates a range is accepted.
+    let (min_or_exact_args, max_args) = match ident.as_str() {
+        "concat" => panic!("concat takes unlimited tokens but didn't eat them all"),
+        "ignore" => (1, None),
+        // 1 or 2 args
+        "count" => (1, Some(2)),
+        // 0 or 1 arg
+        "index" => (0, Some(1)),
+        "len" => (0, Some(1)),
+        other => unreachable!("unknown MVEs should be rejected earlier (got `{other}`)"),
+    };
+
+    let err = errors::MveExtraTokens {
+        span: iter_span(iter).expect("checked is_none above"),
+        ident_span: ident.span,
+        extra_count: iter.count(),
+
+        exact_args_note: if max_args.is_some() { None } else { Some(()) },
+        range_args_note: if max_args.is_some() { Some(()) } else { None },
+        min_or_exact_args,
+        max_args: max_args.unwrap_or_default(),
+        name: ident.to_string(),
+    };
+    Err(psess.dcx().create_err(err))
+}
+
+/// Returns a span encompassing all tokens in the iterator if there is at least one item.
+fn iter_span(iter: &TokenStreamIter<'_>) -> Option<Span> {
+    let mut iter = iter.clone(); // cloning is cheap
+    let first_sp = iter.next()?.span();
+    let last_sp = iter.last().map(TokenTree::span).unwrap_or(first_sp);
+    let span = first_sp.with_hi(last_sp.hi());
+    Some(span)
 }
 
 /// Indicates what is placed in a `concat` parameter. For example, literals
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs
index b37548b281c..15f0bad226d 100644
--- a/compiler/rustc_lint_defs/src/builtin.rs
+++ b/compiler/rustc_lint_defs/src/builtin.rs
@@ -4343,11 +4343,12 @@ declare_lint! {
     ///
     /// [future-incompatible]: ../index.md#future-incompatible-lints
     pub AMBIGUOUS_GLOB_IMPORTS,
-    Warn,
+    Deny,
     "detects certain glob imports that require reporting an ambiguity error",
     @future_incompatible = FutureIncompatibleInfo {
         reason: FutureIncompatibilityReason::FutureReleaseError,
         reference: "issue #114095 <https://github.com/rust-lang/rust/issues/114095>",
+        report_in_deps: true,
     };
 }
 
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs
index 479fe0f1554..db31bd2bbfb 100644
--- a/library/core/src/slice/mod.rs
+++ b/library/core/src/slice/mod.rs
@@ -1120,6 +1120,9 @@ impl<T> [T] {
     /// `chunk_size` elements, and [`rchunks`] for the same iterator but starting at the end of the
     /// slice.
     ///
+    /// If your `chunk_size` is a constant, consider using [`as_chunks`] instead, which will
+    /// give references to arrays of exactly that length, rather than slices.
+    ///
     /// # Panics
     ///
     /// Panics if `chunk_size` is zero.
@@ -1137,6 +1140,7 @@ impl<T> [T] {
     ///
     /// [`chunks_exact`]: slice::chunks_exact
     /// [`rchunks`]: slice::rchunks
+    /// [`as_chunks`]: slice::as_chunks
     #[stable(feature = "rust1", since = "1.0.0")]
     #[rustc_const_unstable(feature = "const_slice_make_iter", issue = "137737")]
     #[inline]
@@ -1156,6 +1160,9 @@ impl<T> [T] {
     /// exactly `chunk_size` elements, and [`rchunks_mut`] for the same iterator but starting at
     /// the end of the slice.
     ///
+    /// If your `chunk_size` is a constant, consider using [`as_chunks_mut`] instead, which will
+    /// give references to arrays of exactly that length, rather than slices.
+    ///
     /// # Panics
     ///
     /// Panics if `chunk_size` is zero.
@@ -1177,6 +1184,7 @@ impl<T> [T] {
     ///
     /// [`chunks_exact_mut`]: slice::chunks_exact_mut
     /// [`rchunks_mut`]: slice::rchunks_mut
+    /// [`as_chunks_mut`]: slice::as_chunks_mut
     #[stable(feature = "rust1", since = "1.0.0")]
     #[rustc_const_unstable(feature = "const_slice_make_iter", issue = "137737")]
     #[inline]
@@ -1199,6 +1207,9 @@ impl<T> [T] {
     /// See [`chunks`] for a variant of this iterator that also returns the remainder as a smaller
     /// chunk, and [`rchunks_exact`] for the same iterator but starting at the end of the slice.
     ///
+    /// If your `chunk_size` is a constant, consider using [`as_chunks`] instead, which will
+    /// give references to arrays of exactly that length, rather than slices.
+    ///
     /// # Panics
     ///
     /// Panics if `chunk_size` is zero.
@@ -1216,6 +1227,7 @@ impl<T> [T] {
     ///
     /// [`chunks`]: slice::chunks
     /// [`rchunks_exact`]: slice::rchunks_exact
+    /// [`as_chunks`]: slice::chunks
     #[stable(feature = "chunks_exact", since = "1.31.0")]
     #[rustc_const_unstable(feature = "const_slice_make_iter", issue = "137737")]
     #[inline]
@@ -1239,6 +1251,9 @@ impl<T> [T] {
     /// smaller chunk, and [`rchunks_exact_mut`] for the same iterator but starting at the end of
     /// the slice.
     ///
+    /// If your `chunk_size` is a constant, consider using [`as_chunks_mut`] instead, which will
+    /// give references to arrays of exactly that length, rather than slices.
+    ///
     /// # Panics
     ///
     /// Panics if `chunk_size` is zero.
@@ -1260,6 +1275,7 @@ impl<T> [T] {
     ///
     /// [`chunks_mut`]: slice::chunks_mut
     /// [`rchunks_exact_mut`]: slice::rchunks_exact_mut
+    /// [`as_chunks_mut`]: slice::as_chunks_mut
     #[stable(feature = "chunks_exact", since = "1.31.0")]
     #[rustc_const_unstable(feature = "const_slice_make_iter", issue = "137737")]
     #[inline]
@@ -1707,6 +1723,9 @@ impl<T> [T] {
     /// `chunk_size` elements, and [`chunks`] for the same iterator but starting at the beginning
     /// of the slice.
     ///
+    /// If your `chunk_size` is a constant, consider using [`as_rchunks`] instead, which will
+    /// give references to arrays of exactly that length, rather than slices.
+    ///
     /// # Panics
     ///
     /// Panics if `chunk_size` is zero.
@@ -1724,6 +1743,7 @@ impl<T> [T] {
     ///
     /// [`rchunks_exact`]: slice::rchunks_exact
     /// [`chunks`]: slice::chunks
+    /// [`as_rchunks`]: slice::as_rchunks
     #[stable(feature = "rchunks", since = "1.31.0")]
     #[rustc_const_unstable(feature = "const_slice_make_iter", issue = "137737")]
     #[inline]
@@ -1743,6 +1763,9 @@ impl<T> [T] {
     /// exactly `chunk_size` elements, and [`chunks_mut`] for the same iterator but starting at the
     /// beginning of the slice.
     ///
+    /// If your `chunk_size` is a constant, consider using [`as_rchunks_mut`] instead, which will
+    /// give references to arrays of exactly that length, rather than slices.
+    ///
     /// # Panics
     ///
     /// Panics if `chunk_size` is zero.
@@ -1764,6 +1787,7 @@ impl<T> [T] {
     ///
     /// [`rchunks_exact_mut`]: slice::rchunks_exact_mut
     /// [`chunks_mut`]: slice::chunks_mut
+    /// [`as_rchunks_mut`]: slice::as_rchunks_mut
     #[stable(feature = "rchunks", since = "1.31.0")]
     #[rustc_const_unstable(feature = "const_slice_make_iter", issue = "137737")]
     #[inline]
@@ -1787,6 +1811,9 @@ impl<T> [T] {
     /// chunk, and [`chunks_exact`] for the same iterator but starting at the beginning of the
     /// slice.
     ///
+    /// If your `chunk_size` is a constant, consider using [`as_rchunks`] instead, which will
+    /// give references to arrays of exactly that length, rather than slices.
+    ///
     /// # Panics
     ///
     /// Panics if `chunk_size` is zero.
@@ -1805,6 +1832,7 @@ impl<T> [T] {
     /// [`chunks`]: slice::chunks
     /// [`rchunks`]: slice::rchunks
     /// [`chunks_exact`]: slice::chunks_exact
+    /// [`as_rchunks`]: slice::as_rchunks
     #[stable(feature = "rchunks", since = "1.31.0")]
     #[rustc_const_unstable(feature = "const_slice_make_iter", issue = "137737")]
     #[inline]
@@ -1828,6 +1856,9 @@ impl<T> [T] {
     /// smaller chunk, and [`chunks_exact_mut`] for the same iterator but starting at the beginning
     /// of the slice.
     ///
+    /// If your `chunk_size` is a constant, consider using [`as_rchunks_mut`] instead, which will
+    /// give references to arrays of exactly that length, rather than slices.
+    ///
     /// # Panics
     ///
     /// Panics if `chunk_size` is zero.
@@ -1850,6 +1881,7 @@ impl<T> [T] {
     /// [`chunks_mut`]: slice::chunks_mut
     /// [`rchunks_mut`]: slice::rchunks_mut
     /// [`chunks_exact_mut`]: slice::chunks_exact_mut
+    /// [`as_rchunks_mut`]: slice::as_rchunks_mut
     #[stable(feature = "rchunks", since = "1.31.0")]
     #[rustc_const_unstable(feature = "const_slice_make_iter", issue = "137737")]
     #[inline]
diff --git a/library/proc_macro/src/bridge/symbol.rs b/library/proc_macro/src/bridge/symbol.rs
index 6a1cecd69fb..57ca7db9fcd 100644
--- a/library/proc_macro/src/bridge/symbol.rs
+++ b/library/proc_macro/src/bridge/symbol.rs
@@ -33,7 +33,7 @@ impl Symbol {
     /// Validates and normalizes before converting it to a symbol.
     pub(crate) fn new_ident(string: &str, is_raw: bool) -> Self {
         // Fast-path: check if this is a valid ASCII identifier
-        if Self::is_valid_ascii_ident(string.as_bytes()) {
+        if Self::is_valid_ascii_ident(string.as_bytes()) || string == "$crate" {
             if is_raw && !Self::can_be_raw(string) {
                 panic!("`{}` cannot be a raw identifier", string);
             }
@@ -79,7 +79,7 @@ impl Symbol {
     // Mimics the behavior of `Symbol::can_be_raw` from `rustc_span`
     fn can_be_raw(string: &str) -> bool {
         match string {
-            "_" | "super" | "self" | "Self" | "crate" => false,
+            "_" | "super" | "self" | "Self" | "crate" | "$crate" => false,
             _ => true,
         }
     }
diff --git a/src/llvm-project b/src/llvm-project
-Subproject 9b1bf4cf041c1c1fe62cf03891ac90431615e78
+Subproject 99f0e0531688a822a753cc585b7408b069cb682
diff --git a/tests/codegen/enum/enum-match.rs b/tests/codegen/enum/enum-match.rs
index 6da6ad1f078..98635008d06 100644
--- a/tests/codegen/enum/enum-match.rs
+++ b/tests/codegen/enum/enum-match.rs
@@ -98,7 +98,7 @@ pub enum Enum2 {
     E,
 }
 
-// CHECK-LABEL: define{{( dso_local)?}} noundef{{( range\(i8 [0-9]+, [0-9]+\))?}} i8 @match2(i8{{.+}}%0)
+// CHECK-LABEL: define{{( dso_local)?}} noundef{{( range\(i8 [0-9]+, -?[0-9]+\))?}} i8 @match2(i8{{.+}}%0)
 // CHECK-NEXT: start:
 // CHECK-NEXT: %[[REL_VAR:.+]] = add i8 %0, 2
 // CHECK-NEXT: %[[REL_VAR_WIDE:.+]] = zext i8 %[[REL_VAR]] to i64
diff --git a/tests/ui/output-slot-variants.rs b/tests/ui/codegen/output-slot-init-vs-noninit.rs
index 97757e74fc4..55586843740 100644
--- a/tests/ui/output-slot-variants.rs
+++ b/tests/ui/codegen/output-slot-init-vs-noninit.rs
@@ -1,26 +1,48 @@
+//! Check that output slots work correctly for both initializing and non-initializing assignments.
+//!
+//! Regression test for <https://github.com/rust-lang/rust/issues/24>.
+
 //@ run-pass
 
 #![allow(dead_code)]
 #![allow(unused_assignments)]
 #![allow(unknown_lints)]
-
 #![allow(dead_assignment)]
 #![allow(unused_variables)]
 
-struct A { a: isize, b: isize }
-struct Abox { a: Box<isize>, b: Box<isize> }
+struct A {
+    a: isize,
+    b: isize,
+}
 
-fn ret_int_i() -> isize { 10 }
+struct Abox {
+    a: Box<isize>,
+    b: Box<isize>,
+}
 
-fn ret_ext_i() -> Box<isize> { Box::new(10) }
+fn ret_int_i() -> isize {
+    10
+}
 
-fn ret_int_rec() -> A { A {a: 10, b: 10} }
+fn ret_ext_i() -> Box<isize> {
+    Box::new(10)
+}
 
-fn ret_ext_rec() -> Box<A> { Box::new(A {a: 10, b: 10}) }
+fn ret_int_rec() -> A {
+    A { a: 10, b: 10 }
+}
 
-fn ret_ext_mem() -> Abox { Abox {a: Box::new(10), b: Box::new(10) } }
+fn ret_ext_rec() -> Box<A> {
+    Box::new(A { a: 10, b: 10 })
+}
+
+fn ret_ext_mem() -> Abox {
+    Abox { a: Box::new(10), b: Box::new(10) }
+}
 
-fn ret_ext_ext_mem() -> Box<Abox> { Box::new(Abox{a: Box::new(10), b: Box::new(10) }) }
+fn ret_ext_ext_mem() -> Box<Abox> {
+    Box::new(Abox { a: Box::new(10), b: Box::new(10) })
+}
 
 pub fn main() {
     let mut int_i: isize;
@@ -29,40 +51,28 @@ pub fn main() {
     let mut ext_rec: Box<A>;
     let mut ext_mem: Abox;
     let mut ext_ext_mem: Box<Abox>;
-    int_i = ret_int_i(); // initializing
 
+    int_i = ret_int_i(); // initializing
     int_i = ret_int_i(); // non-initializing
-
     int_i = ret_int_i(); // non-initializing
 
     ext_i = ret_ext_i(); // initializing
-
     ext_i = ret_ext_i(); // non-initializing
-
     ext_i = ret_ext_i(); // non-initializing
 
     int_rec = ret_int_rec(); // initializing
-
     int_rec = ret_int_rec(); // non-initializing
-
     int_rec = ret_int_rec(); // non-initializing
 
     ext_rec = ret_ext_rec(); // initializing
-
     ext_rec = ret_ext_rec(); // non-initializing
-
     ext_rec = ret_ext_rec(); // non-initializing
 
     ext_mem = ret_ext_mem(); // initializing
-
     ext_mem = ret_ext_mem(); // non-initializing
-
     ext_mem = ret_ext_mem(); // non-initializing
 
     ext_ext_mem = ret_ext_ext_mem(); // initializing
-
     ext_ext_mem = ret_ext_ext_mem(); // non-initializing
-
     ext_ext_mem = ret_ext_ext_mem(); // non-initializing
-
 }
diff --git a/tests/ui/optimization-remark.rs b/tests/ui/codegen/remark-flag-functionality.rs
index 165fc63c007..797c55ba830 100644
--- a/tests/ui/optimization-remark.rs
+++ b/tests/ui/codegen/remark-flag-functionality.rs
@@ -1,24 +1,26 @@
+//! Check that `-Cremark` flag correctly emits LLVM optimization remarks.
+//!
+//! Regression test for <https://github.com/rust-lang/rust/issues/90924>.
+
 //@ build-pass
 //@ ignore-pass
 //@ revisions: all inline merge1 merge2
 //@ compile-flags: --crate-type=lib -Cdebuginfo=1 -Copt-level=2
-//
+
 // Check that remarks can be enabled individually or with "all":
-//
 //@ [all]    compile-flags: -Cremark=all
 //@ [inline] compile-flags: -Cremark=inline
-//
+
 // Check that values of -Cremark flag are accumulated:
-//
 //@ [merge1] compile-flags: -Cremark=all    -Cremark=giraffe
 //@ [merge2] compile-flags: -Cremark=inline -Cremark=giraffe
+
 //@ dont-check-compiler-stderr
 //@ dont-require-annotations: NOTE
 
 #[no_mangle]
 #[inline(never)]
-pub fn f() {
-}
+pub fn f() {}
 
 #[no_mangle]
 pub fn g() {
diff --git a/tests/ui/codegen/shift-right-operand-mutation.rs b/tests/ui/codegen/shift-right-operand-mutation.rs
new file mode 100644
index 00000000000..b37a0baa6f8
--- /dev/null
+++ b/tests/ui/codegen/shift-right-operand-mutation.rs
@@ -0,0 +1,19 @@
+//! Ensure shift operations don't mutate their right operand.
+//!
+//! This test checks that expressions like `0 << b` don't accidentally
+//! modify the variable `b` due to codegen issues with virtual registers.
+//!
+//! Regression test for <https://github.com/rust-lang/rust/issues/152>.
+
+//@ run-pass
+
+pub fn main() {
+    let mut b: usize = 1;
+    while b < size_of::<usize>() {
+        // This shift operation should not mutate `b`
+        let _ = 0_usize << b;
+        b <<= 1;
+        std::hint::black_box(b);
+    }
+    assert_eq!(size_of::<usize>(), b);
+}
diff --git a/tests/ui/codegen/sret-aliasing-rules.rs b/tests/ui/codegen/sret-aliasing-rules.rs
new file mode 100644
index 00000000000..f35e722f764
--- /dev/null
+++ b/tests/ui/codegen/sret-aliasing-rules.rs
@@ -0,0 +1,28 @@
+//! Check that functions with sret results don't violate aliasing rules.
+//!
+//! When `foo = func(&mut foo)` is called, the compiler must avoid creating
+//! two mutable references to the same variable simultaneously (one for the
+//! parameter and one for the hidden sret out-pointer).
+//!
+//! Regression test for <https://github.com/rust-lang/rust/pull/18250>.
+
+//@ run-pass
+
+#[derive(Copy, Clone)]
+pub struct Foo {
+    f1: isize,
+    _f2: isize,
+}
+
+#[inline(never)]
+pub fn foo(f: &mut Foo) -> Foo {
+    let ret = *f;
+    f.f1 = 0;
+    ret
+}
+
+pub fn main() {
+    let mut f = Foo { f1: 8, _f2: 9 };
+    f = foo(&mut f);
+    assert_eq!(f.f1, 8);
+}
diff --git a/tests/ui/imports/ambiguous-1.rs b/tests/ui/imports/ambiguous-1.rs
index d175444c0f2..31f39eee62b 100644
--- a/tests/ui/imports/ambiguous-1.rs
+++ b/tests/ui/imports/ambiguous-1.rs
@@ -1,6 +1,8 @@
 //@ check-pass
 // https://github.com/rust-lang/rust/pull/112743#issuecomment-1601986883
 
+#![warn(ambiguous_glob_imports)]
+
 macro_rules! m {
     () => {
       pub fn id() {}
diff --git a/tests/ui/imports/ambiguous-1.stderr b/tests/ui/imports/ambiguous-1.stderr
index 61b3077c354..04ff3a36c74 100644
--- a/tests/ui/imports/ambiguous-1.stderr
+++ b/tests/ui/imports/ambiguous-1.stderr
@@ -1,5 +1,5 @@
 warning: ambiguous glob re-exports
-  --> $DIR/ambiguous-1.rs:11:13
+  --> $DIR/ambiguous-1.rs:13:13
    |
 LL |     pub use self::evp::*;
    |             ^^^^^^^^^^^^ the name `id` in the value namespace is first re-exported here
@@ -10,7 +10,7 @@ LL |     pub use self::handwritten::*;
    = note: `#[warn(ambiguous_glob_reexports)]` on by default
 
 warning: `id` is ambiguous
-  --> $DIR/ambiguous-1.rs:27:5
+  --> $DIR/ambiguous-1.rs:29:5
    |
 LL |     id();
    |     ^^ ambiguous name
@@ -19,18 +19,50 @@ LL |     id();
    = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
    = note: ambiguous because of multiple glob imports of a name in the same module
 note: `id` could refer to the function imported here
-  --> $DIR/ambiguous-1.rs:11:13
+  --> $DIR/ambiguous-1.rs:13:13
    |
 LL |     pub use self::evp::*;
    |             ^^^^^^^^^^^^
    = help: consider adding an explicit import of `id` to disambiguate
 note: `id` could also refer to the function imported here
-  --> $DIR/ambiguous-1.rs:13:13
+  --> $DIR/ambiguous-1.rs:15:13
    |
 LL |     pub use self::handwritten::*;
    |             ^^^^^^^^^^^^^^^^^^^^
    = help: consider adding an explicit import of `id` to disambiguate
-   = note: `#[warn(ambiguous_glob_imports)]` on by default
+note: the lint level is defined here
+  --> $DIR/ambiguous-1.rs:4:9
+   |
+LL | #![warn(ambiguous_glob_imports)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: 2 warnings emitted
 
+Future incompatibility report: Future breakage diagnostic:
+warning: `id` is ambiguous
+  --> $DIR/ambiguous-1.rs:29:5
+   |
+LL |     id();
+   |     ^^ ambiguous name
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `id` could refer to the function imported here
+  --> $DIR/ambiguous-1.rs:13:13
+   |
+LL |     pub use self::evp::*;
+   |             ^^^^^^^^^^^^
+   = help: consider adding an explicit import of `id` to disambiguate
+note: `id` could also refer to the function imported here
+  --> $DIR/ambiguous-1.rs:15:13
+   |
+LL |     pub use self::handwritten::*;
+   |             ^^^^^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `id` to disambiguate
+note: the lint level is defined here
+  --> $DIR/ambiguous-1.rs:4:9
+   |
+LL | #![warn(ambiguous_glob_imports)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^
+
diff --git a/tests/ui/imports/ambiguous-10.rs b/tests/ui/imports/ambiguous-10.rs
index 7c14e3343eb..166b01ede12 100644
--- a/tests/ui/imports/ambiguous-10.rs
+++ b/tests/ui/imports/ambiguous-10.rs
@@ -1,4 +1,3 @@
-//@ check-pass
 // https://github.com/rust-lang/rust/pull/113099#issuecomment-1637022296
 
 mod a {
@@ -14,6 +13,6 @@ mod b {
 use crate::a::*;
 use crate::b::*;
 fn c(_: Token) {}
-//~^ WARNING `Token` is ambiguous
+//~^ ERROR `Token` is ambiguous
 //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 fn main() { }
diff --git a/tests/ui/imports/ambiguous-10.stderr b/tests/ui/imports/ambiguous-10.stderr
index 704af616b43..cd36795b3c0 100644
--- a/tests/ui/imports/ambiguous-10.stderr
+++ b/tests/ui/imports/ambiguous-10.stderr
@@ -1,5 +1,5 @@
-warning: `Token` is ambiguous
-  --> $DIR/ambiguous-10.rs:16:9
+error: `Token` is ambiguous
+  --> $DIR/ambiguous-10.rs:15:9
    |
 LL | fn c(_: Token) {}
    |         ^^^^^ ambiguous name
@@ -8,18 +8,42 @@ LL | fn c(_: Token) {}
    = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
    = note: ambiguous because of multiple glob imports of a name in the same module
 note: `Token` could refer to the enum imported here
-  --> $DIR/ambiguous-10.rs:14:5
+  --> $DIR/ambiguous-10.rs:13:5
    |
 LL | use crate::a::*;
    |     ^^^^^^^^^^^
    = help: consider adding an explicit import of `Token` to disambiguate
 note: `Token` could also refer to the enum imported here
-  --> $DIR/ambiguous-10.rs:15:5
+  --> $DIR/ambiguous-10.rs:14:5
    |
 LL | use crate::b::*;
    |     ^^^^^^^^^^^
    = help: consider adding an explicit import of `Token` to disambiguate
-   = note: `#[warn(ambiguous_glob_imports)]` on by default
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
+
+error: aborting due to 1 previous error
 
-warning: 1 warning emitted
+Future incompatibility report: Future breakage diagnostic:
+error: `Token` is ambiguous
+  --> $DIR/ambiguous-10.rs:15:9
+   |
+LL | fn c(_: Token) {}
+   |         ^^^^^ ambiguous name
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `Token` could refer to the enum imported here
+  --> $DIR/ambiguous-10.rs:13:5
+   |
+LL | use crate::a::*;
+   |     ^^^^^^^^^^^
+   = help: consider adding an explicit import of `Token` to disambiguate
+note: `Token` could also refer to the enum imported here
+  --> $DIR/ambiguous-10.rs:14:5
+   |
+LL | use crate::b::*;
+   |     ^^^^^^^^^^^
+   = help: consider adding an explicit import of `Token` to disambiguate
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
 
diff --git a/tests/ui/imports/ambiguous-12.rs b/tests/ui/imports/ambiguous-12.rs
index a033b51f709..543396b8dfe 100644
--- a/tests/ui/imports/ambiguous-12.rs
+++ b/tests/ui/imports/ambiguous-12.rs
@@ -1,4 +1,3 @@
-//@ check-pass
 // https://github.com/rust-lang/rust/pull/113099#issuecomment-1637022296
 
 macro_rules! m {
@@ -20,6 +19,6 @@ use crate::public::*;
 
 fn main() {
     b();
-    //~^ WARNING `b` is ambiguous
+    //~^ ERROR `b` is ambiguous
     //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 }
diff --git a/tests/ui/imports/ambiguous-12.stderr b/tests/ui/imports/ambiguous-12.stderr
index 4725c38849c..273a4ed3c0f 100644
--- a/tests/ui/imports/ambiguous-12.stderr
+++ b/tests/ui/imports/ambiguous-12.stderr
@@ -1,5 +1,5 @@
-warning: `b` is ambiguous
-  --> $DIR/ambiguous-12.rs:22:5
+error: `b` is ambiguous
+  --> $DIR/ambiguous-12.rs:21:5
    |
 LL |     b();
    |     ^ ambiguous name
@@ -8,18 +8,42 @@ LL |     b();
    = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
    = note: ambiguous because of multiple glob imports of a name in the same module
 note: `b` could refer to the function imported here
-  --> $DIR/ambiguous-12.rs:18:5
+  --> $DIR/ambiguous-12.rs:17:5
    |
 LL | use crate::ciphertext::*;
    |     ^^^^^^^^^^^^^^^^^^^^
    = help: consider adding an explicit import of `b` to disambiguate
 note: `b` could also refer to the function imported here
-  --> $DIR/ambiguous-12.rs:19:5
+  --> $DIR/ambiguous-12.rs:18:5
    |
 LL | use crate::public::*;
    |     ^^^^^^^^^^^^^^^^
    = help: consider adding an explicit import of `b` to disambiguate
-   = note: `#[warn(ambiguous_glob_imports)]` on by default
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
+
+error: aborting due to 1 previous error
 
-warning: 1 warning emitted
+Future incompatibility report: Future breakage diagnostic:
+error: `b` is ambiguous
+  --> $DIR/ambiguous-12.rs:21:5
+   |
+LL |     b();
+   |     ^ ambiguous name
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `b` could refer to the function imported here
+  --> $DIR/ambiguous-12.rs:17:5
+   |
+LL | use crate::ciphertext::*;
+   |     ^^^^^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `b` to disambiguate
+note: `b` could also refer to the function imported here
+  --> $DIR/ambiguous-12.rs:18:5
+   |
+LL | use crate::public::*;
+   |     ^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `b` to disambiguate
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
 
diff --git a/tests/ui/imports/ambiguous-13.rs b/tests/ui/imports/ambiguous-13.rs
index 1ea04e05d57..3569dd5d9ad 100644
--- a/tests/ui/imports/ambiguous-13.rs
+++ b/tests/ui/imports/ambiguous-13.rs
@@ -1,4 +1,3 @@
-//@ check-pass
 // https://github.com/rust-lang/rust/pull/113099#issuecomment-1637022296
 
 pub mod object {
@@ -17,6 +16,6 @@ use crate::object::*;
 use crate::content::*;
 
 fn a(_: Rect) {}
-//~^ WARNING `Rect` is ambiguous
+//~^ ERROR `Rect` is ambiguous
 //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 fn main() { }
diff --git a/tests/ui/imports/ambiguous-13.stderr b/tests/ui/imports/ambiguous-13.stderr
index 3e78100b658..c4a42c01c91 100644
--- a/tests/ui/imports/ambiguous-13.stderr
+++ b/tests/ui/imports/ambiguous-13.stderr
@@ -1,5 +1,5 @@
-warning: `Rect` is ambiguous
-  --> $DIR/ambiguous-13.rs:19:9
+error: `Rect` is ambiguous
+  --> $DIR/ambiguous-13.rs:18:9
    |
 LL | fn a(_: Rect) {}
    |         ^^^^ ambiguous name
@@ -8,18 +8,42 @@ LL | fn a(_: Rect) {}
    = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
    = note: ambiguous because of multiple glob imports of a name in the same module
 note: `Rect` could refer to the struct imported here
-  --> $DIR/ambiguous-13.rs:16:5
+  --> $DIR/ambiguous-13.rs:15:5
    |
 LL | use crate::object::*;
    |     ^^^^^^^^^^^^^^^^
    = help: consider adding an explicit import of `Rect` to disambiguate
 note: `Rect` could also refer to the struct imported here
-  --> $DIR/ambiguous-13.rs:17:5
+  --> $DIR/ambiguous-13.rs:16:5
    |
 LL | use crate::content::*;
    |     ^^^^^^^^^^^^^^^^^
    = help: consider adding an explicit import of `Rect` to disambiguate
-   = note: `#[warn(ambiguous_glob_imports)]` on by default
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
+
+error: aborting due to 1 previous error
 
-warning: 1 warning emitted
+Future incompatibility report: Future breakage diagnostic:
+error: `Rect` is ambiguous
+  --> $DIR/ambiguous-13.rs:18:9
+   |
+LL | fn a(_: Rect) {}
+   |         ^^^^ ambiguous name
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `Rect` could refer to the struct imported here
+  --> $DIR/ambiguous-13.rs:15:5
+   |
+LL | use crate::object::*;
+   |     ^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `Rect` to disambiguate
+note: `Rect` could also refer to the struct imported here
+  --> $DIR/ambiguous-13.rs:16:5
+   |
+LL | use crate::content::*;
+   |     ^^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `Rect` to disambiguate
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
 
diff --git a/tests/ui/imports/ambiguous-14.rs b/tests/ui/imports/ambiguous-14.rs
index 30d14be9d0e..f752387aa7e 100644
--- a/tests/ui/imports/ambiguous-14.rs
+++ b/tests/ui/imports/ambiguous-14.rs
@@ -1,4 +1,3 @@
-//@ check-pass
 // https://github.com/rust-lang/rust/issues/98467
 
 mod a {
@@ -21,6 +20,6 @@ mod g {
 
 fn main() {
     g::foo();
-    //~^ WARNING `foo` is ambiguous
+    //~^ ERROR `foo` is ambiguous
     //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 }
diff --git a/tests/ui/imports/ambiguous-14.stderr b/tests/ui/imports/ambiguous-14.stderr
index bece5853668..f3115f8c8b5 100644
--- a/tests/ui/imports/ambiguous-14.stderr
+++ b/tests/ui/imports/ambiguous-14.stderr
@@ -1,5 +1,5 @@
-warning: `foo` is ambiguous
-  --> $DIR/ambiguous-14.rs:23:8
+error: `foo` is ambiguous
+  --> $DIR/ambiguous-14.rs:22:8
    |
 LL |     g::foo();
    |        ^^^ ambiguous name
@@ -8,18 +8,42 @@ LL |     g::foo();
    = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
    = note: ambiguous because of multiple glob imports of a name in the same module
 note: `foo` could refer to the function imported here
-  --> $DIR/ambiguous-14.rs:13:13
+  --> $DIR/ambiguous-14.rs:12:13
    |
 LL |     pub use a::*;
    |             ^^^^
    = help: consider adding an explicit import of `foo` to disambiguate
 note: `foo` could also refer to the function imported here
-  --> $DIR/ambiguous-14.rs:14:13
+  --> $DIR/ambiguous-14.rs:13:13
    |
 LL |     pub use b::*;
    |             ^^^^
    = help: consider adding an explicit import of `foo` to disambiguate
-   = note: `#[warn(ambiguous_glob_imports)]` on by default
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
+
+error: aborting due to 1 previous error
 
-warning: 1 warning emitted
+Future incompatibility report: Future breakage diagnostic:
+error: `foo` is ambiguous
+  --> $DIR/ambiguous-14.rs:22:8
+   |
+LL |     g::foo();
+   |        ^^^ ambiguous name
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `foo` could refer to the function imported here
+  --> $DIR/ambiguous-14.rs:12:13
+   |
+LL |     pub use a::*;
+   |             ^^^^
+   = help: consider adding an explicit import of `foo` to disambiguate
+note: `foo` could also refer to the function imported here
+  --> $DIR/ambiguous-14.rs:13:13
+   |
+LL |     pub use b::*;
+   |             ^^^^
+   = help: consider adding an explicit import of `foo` to disambiguate
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
 
diff --git a/tests/ui/imports/ambiguous-15.rs b/tests/ui/imports/ambiguous-15.rs
index b9e8f020d43..07d8893b2de 100644
--- a/tests/ui/imports/ambiguous-15.rs
+++ b/tests/ui/imports/ambiguous-15.rs
@@ -1,4 +1,3 @@
-//@ check-pass
 // https://github.com/rust-lang/rust/pull/113099#issuecomment-1638206152
 
 mod t2 {
@@ -21,7 +20,7 @@ mod t3 {
 
 use self::t3::*;
 fn a<E: Error>(_: E) {}
-//~^ WARNING `Error` is ambiguous
+//~^ ERROR `Error` is ambiguous
 //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 fn main() {}
diff --git a/tests/ui/imports/ambiguous-15.stderr b/tests/ui/imports/ambiguous-15.stderr
index 838256752d0..1312f2c63c4 100644
--- a/tests/ui/imports/ambiguous-15.stderr
+++ b/tests/ui/imports/ambiguous-15.stderr
@@ -1,5 +1,5 @@
-warning: `Error` is ambiguous
-  --> $DIR/ambiguous-15.rs:23:9
+error: `Error` is ambiguous
+  --> $DIR/ambiguous-15.rs:22:9
    |
 LL | fn a<E: Error>(_: E) {}
    |         ^^^^^ ambiguous name
@@ -8,18 +8,42 @@ LL | fn a<E: Error>(_: E) {}
    = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
    = note: ambiguous because of multiple glob imports of a name in the same module
 note: `Error` could refer to the trait imported here
-  --> $DIR/ambiguous-15.rs:22:5
+  --> $DIR/ambiguous-15.rs:21:5
    |
 LL | use self::t3::*;
    |     ^^^^^^^^^^^
    = help: consider adding an explicit import of `Error` to disambiguate
 note: `Error` could also refer to the enum imported here
-  --> $DIR/ambiguous-15.rs:16:9
+  --> $DIR/ambiguous-15.rs:15:9
    |
 LL | pub use t2::*;
    |         ^^^^^
    = help: consider adding an explicit import of `Error` to disambiguate
-   = note: `#[warn(ambiguous_glob_imports)]` on by default
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
 
-warning: 1 warning emitted
+error: aborting due to 1 previous error
+
+Future incompatibility report: Future breakage diagnostic:
+error: `Error` is ambiguous
+  --> $DIR/ambiguous-15.rs:22:9
+   |
+LL | fn a<E: Error>(_: E) {}
+   |         ^^^^^ ambiguous name
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `Error` could refer to the trait imported here
+  --> $DIR/ambiguous-15.rs:21:5
+   |
+LL | use self::t3::*;
+   |     ^^^^^^^^^^^
+   = help: consider adding an explicit import of `Error` to disambiguate
+note: `Error` could also refer to the enum imported here
+  --> $DIR/ambiguous-15.rs:15:9
+   |
+LL | pub use t2::*;
+   |         ^^^^^
+   = help: consider adding an explicit import of `Error` to disambiguate
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
 
diff --git a/tests/ui/imports/ambiguous-16.rs b/tests/ui/imports/ambiguous-16.rs
index ed30c9d241a..f31c78d18a3 100644
--- a/tests/ui/imports/ambiguous-16.rs
+++ b/tests/ui/imports/ambiguous-16.rs
@@ -1,4 +1,3 @@
-//@ check-pass
 // https://github.com/rust-lang/rust/pull/113099
 
 mod framing {
@@ -21,7 +20,7 @@ mod framing {
 }
 
 use crate::framing::ConfirmedTranscriptHashInput;
-//~^ WARNING `ConfirmedTranscriptHashInput` is ambiguous
+//~^ ERROR `ConfirmedTranscriptHashInput` is ambiguous
 //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 fn main() { }
diff --git a/tests/ui/imports/ambiguous-16.stderr b/tests/ui/imports/ambiguous-16.stderr
index 7366cabc47a..ae65f9a84fc 100644
--- a/tests/ui/imports/ambiguous-16.stderr
+++ b/tests/ui/imports/ambiguous-16.stderr
@@ -1,5 +1,5 @@
-warning: `ConfirmedTranscriptHashInput` is ambiguous
-  --> $DIR/ambiguous-16.rs:23:21
+error: `ConfirmedTranscriptHashInput` is ambiguous
+  --> $DIR/ambiguous-16.rs:22:21
    |
 LL | use crate::framing::ConfirmedTranscriptHashInput;
    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous name
@@ -8,18 +8,42 @@ LL | use crate::framing::ConfirmedTranscriptHashInput;
    = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
    = note: ambiguous because of multiple glob imports of a name in the same module
 note: `ConfirmedTranscriptHashInput` could refer to the struct imported here
-  --> $DIR/ambiguous-16.rs:19:13
+  --> $DIR/ambiguous-16.rs:18:13
    |
 LL |     pub use self::public_message::*;
    |             ^^^^^^^^^^^^^^^^^^^^^^^
    = help: consider adding an explicit import of `ConfirmedTranscriptHashInput` to disambiguate
 note: `ConfirmedTranscriptHashInput` could also refer to the struct imported here
-  --> $DIR/ambiguous-16.rs:20:13
+  --> $DIR/ambiguous-16.rs:19:13
    |
 LL |     pub use self::public_message_in::*;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    = help: consider adding an explicit import of `ConfirmedTranscriptHashInput` to disambiguate
-   = note: `#[warn(ambiguous_glob_imports)]` on by default
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
+
+error: aborting due to 1 previous error
 
-warning: 1 warning emitted
+Future incompatibility report: Future breakage diagnostic:
+error: `ConfirmedTranscriptHashInput` is ambiguous
+  --> $DIR/ambiguous-16.rs:22:21
+   |
+LL | use crate::framing::ConfirmedTranscriptHashInput;
+   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous name
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `ConfirmedTranscriptHashInput` could refer to the struct imported here
+  --> $DIR/ambiguous-16.rs:18:13
+   |
+LL |     pub use self::public_message::*;
+   |             ^^^^^^^^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `ConfirmedTranscriptHashInput` to disambiguate
+note: `ConfirmedTranscriptHashInput` could also refer to the struct imported here
+  --> $DIR/ambiguous-16.rs:19:13
+   |
+LL |     pub use self::public_message_in::*;
+   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `ConfirmedTranscriptHashInput` to disambiguate
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
 
diff --git a/tests/ui/imports/ambiguous-17.rs b/tests/ui/imports/ambiguous-17.rs
index 28c9c1cc864..520ac70c6f1 100644
--- a/tests/ui/imports/ambiguous-17.rs
+++ b/tests/ui/imports/ambiguous-17.rs
@@ -1,4 +1,3 @@
-//@ check-pass
 // https://github.com/rust-lang/rust/pull/113099#issuecomment-1638206152
 
 pub use evp::*; //~ WARNING ambiguous glob re-exports
@@ -24,6 +23,6 @@ mod handwritten {
 
 fn main() {
     id();
-    //~^ WARNING `id` is ambiguous
+    //~^ ERROR `id` is ambiguous
     //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 }
diff --git a/tests/ui/imports/ambiguous-17.stderr b/tests/ui/imports/ambiguous-17.stderr
index 55bc01095c7..a87e2572d63 100644
--- a/tests/ui/imports/ambiguous-17.stderr
+++ b/tests/ui/imports/ambiguous-17.stderr
@@ -1,5 +1,5 @@
 warning: ambiguous glob re-exports
-  --> $DIR/ambiguous-17.rs:4:9
+  --> $DIR/ambiguous-17.rs:3:9
    |
 LL | pub use evp::*;
    |         ^^^^^^ the name `id` in the value namespace is first re-exported here
@@ -8,8 +8,8 @@ LL | pub use handwritten::*;
    |
    = note: `#[warn(ambiguous_glob_reexports)]` on by default
 
-warning: `id` is ambiguous
-  --> $DIR/ambiguous-17.rs:26:5
+error: `id` is ambiguous
+  --> $DIR/ambiguous-17.rs:25:5
    |
 LL |     id();
    |     ^^ ambiguous name
@@ -18,18 +18,42 @@ LL |     id();
    = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
    = note: ambiguous because of multiple glob imports of a name in the same module
 note: `id` could refer to the function imported here
-  --> $DIR/ambiguous-17.rs:4:9
+  --> $DIR/ambiguous-17.rs:3:9
    |
 LL | pub use evp::*;
    |         ^^^^^^
    = help: consider adding an explicit import of `id` to disambiguate
 note: `id` could also refer to the function imported here
-  --> $DIR/ambiguous-17.rs:5:9
+  --> $DIR/ambiguous-17.rs:4:9
    |
 LL | pub use handwritten::*;
    |         ^^^^^^^^^^^^^^
    = help: consider adding an explicit import of `id` to disambiguate
-   = note: `#[warn(ambiguous_glob_imports)]` on by default
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
 
-warning: 2 warnings emitted
+error: aborting due to 1 previous error; 1 warning emitted
+
+Future incompatibility report: Future breakage diagnostic:
+error: `id` is ambiguous
+  --> $DIR/ambiguous-17.rs:25:5
+   |
+LL |     id();
+   |     ^^ ambiguous name
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `id` could refer to the function imported here
+  --> $DIR/ambiguous-17.rs:3:9
+   |
+LL | pub use evp::*;
+   |         ^^^^^^
+   = help: consider adding an explicit import of `id` to disambiguate
+note: `id` could also refer to the function imported here
+  --> $DIR/ambiguous-17.rs:4:9
+   |
+LL | pub use handwritten::*;
+   |         ^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `id` to disambiguate
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
 
diff --git a/tests/ui/imports/ambiguous-3.rs b/tests/ui/imports/ambiguous-3.rs
index aa98ffe395e..ff0dcc221ec 100644
--- a/tests/ui/imports/ambiguous-3.rs
+++ b/tests/ui/imports/ambiguous-3.rs
@@ -1,10 +1,9 @@
-//@ check-pass
 // https://github.com/rust-lang/rust/issues/47525
 
 fn main() {
     use a::*;
     x();
-    //~^ WARNING `x` is ambiguous
+    //~^ ERROR `x` is ambiguous
     //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 }
 
diff --git a/tests/ui/imports/ambiguous-3.stderr b/tests/ui/imports/ambiguous-3.stderr
index f019f6d8957..8766db5654a 100644
--- a/tests/ui/imports/ambiguous-3.stderr
+++ b/tests/ui/imports/ambiguous-3.stderr
@@ -1,5 +1,5 @@
-warning: `x` is ambiguous
-  --> $DIR/ambiguous-3.rs:6:5
+error: `x` is ambiguous
+  --> $DIR/ambiguous-3.rs:5:5
    |
 LL |     x();
    |     ^ ambiguous name
@@ -8,18 +8,42 @@ LL |     x();
    = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
    = note: ambiguous because of multiple glob imports of a name in the same module
 note: `x` could refer to the function imported here
-  --> $DIR/ambiguous-3.rs:19:13
+  --> $DIR/ambiguous-3.rs:18:13
    |
 LL |     pub use self::b::*;
    |             ^^^^^^^^^^
    = help: consider adding an explicit import of `x` to disambiguate
 note: `x` could also refer to the function imported here
-  --> $DIR/ambiguous-3.rs:20:13
+  --> $DIR/ambiguous-3.rs:19:13
    |
 LL |     pub use self::c::*;
    |             ^^^^^^^^^^
    = help: consider adding an explicit import of `x` to disambiguate
-   = note: `#[warn(ambiguous_glob_imports)]` on by default
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
+
+error: aborting due to 1 previous error
 
-warning: 1 warning emitted
+Future incompatibility report: Future breakage diagnostic:
+error: `x` is ambiguous
+  --> $DIR/ambiguous-3.rs:5:5
+   |
+LL |     x();
+   |     ^ ambiguous name
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `x` could refer to the function imported here
+  --> $DIR/ambiguous-3.rs:18:13
+   |
+LL |     pub use self::b::*;
+   |             ^^^^^^^^^^
+   = help: consider adding an explicit import of `x` to disambiguate
+note: `x` could also refer to the function imported here
+  --> $DIR/ambiguous-3.rs:19:13
+   |
+LL |     pub use self::c::*;
+   |             ^^^^^^^^^^
+   = help: consider adding an explicit import of `x` to disambiguate
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
 
diff --git a/tests/ui/imports/ambiguous-4-extern.rs b/tests/ui/imports/ambiguous-4-extern.rs
index a045ab3d8a5..bc856af852d 100644
--- a/tests/ui/imports/ambiguous-4-extern.rs
+++ b/tests/ui/imports/ambiguous-4-extern.rs
@@ -1,6 +1,8 @@
 //@ check-pass
 // https://github.com/rust-lang/rust/pull/112743#issuecomment-1601986883
 
+#![warn(ambiguous_glob_imports)]
+
 macro_rules! m {
     () => {
       pub fn id() {}
diff --git a/tests/ui/imports/ambiguous-4-extern.stderr b/tests/ui/imports/ambiguous-4-extern.stderr
index 0011973212b..a9427ac0350 100644
--- a/tests/ui/imports/ambiguous-4-extern.stderr
+++ b/tests/ui/imports/ambiguous-4-extern.stderr
@@ -1,5 +1,5 @@
 warning: ambiguous glob re-exports
-  --> $DIR/ambiguous-4-extern.rs:10:9
+  --> $DIR/ambiguous-4-extern.rs:12:9
    |
 LL | pub use evp::*;
    |         ^^^^^^ the name `id` in the value namespace is first re-exported here
@@ -9,7 +9,7 @@ LL | pub use handwritten::*;
    = note: `#[warn(ambiguous_glob_reexports)]` on by default
 
 warning: `id` is ambiguous
-  --> $DIR/ambiguous-4-extern.rs:23:5
+  --> $DIR/ambiguous-4-extern.rs:25:5
    |
 LL |     id();
    |     ^^ ambiguous name
@@ -18,18 +18,50 @@ LL |     id();
    = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
    = note: ambiguous because of multiple glob imports of a name in the same module
 note: `id` could refer to the function imported here
-  --> $DIR/ambiguous-4-extern.rs:10:9
+  --> $DIR/ambiguous-4-extern.rs:12:9
    |
 LL | pub use evp::*;
    |         ^^^^^^
    = help: consider adding an explicit import of `id` to disambiguate
 note: `id` could also refer to the function imported here
-  --> $DIR/ambiguous-4-extern.rs:11:9
+  --> $DIR/ambiguous-4-extern.rs:13:9
    |
 LL | pub use handwritten::*;
    |         ^^^^^^^^^^^^^^
    = help: consider adding an explicit import of `id` to disambiguate
-   = note: `#[warn(ambiguous_glob_imports)]` on by default
+note: the lint level is defined here
+  --> $DIR/ambiguous-4-extern.rs:4:9
+   |
+LL | #![warn(ambiguous_glob_imports)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^
 
 warning: 2 warnings emitted
 
+Future incompatibility report: Future breakage diagnostic:
+warning: `id` is ambiguous
+  --> $DIR/ambiguous-4-extern.rs:25:5
+   |
+LL |     id();
+   |     ^^ ambiguous name
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `id` could refer to the function imported here
+  --> $DIR/ambiguous-4-extern.rs:12:9
+   |
+LL | pub use evp::*;
+   |         ^^^^^^
+   = help: consider adding an explicit import of `id` to disambiguate
+note: `id` could also refer to the function imported here
+  --> $DIR/ambiguous-4-extern.rs:13:9
+   |
+LL | pub use handwritten::*;
+   |         ^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `id` to disambiguate
+note: the lint level is defined here
+  --> $DIR/ambiguous-4-extern.rs:4:9
+   |
+LL | #![warn(ambiguous_glob_imports)]
+   |         ^^^^^^^^^^^^^^^^^^^^^^
+
diff --git a/tests/ui/imports/ambiguous-4.rs b/tests/ui/imports/ambiguous-4.rs
index fcb7b5c6671..3a9a14bfb52 100644
--- a/tests/ui/imports/ambiguous-4.rs
+++ b/tests/ui/imports/ambiguous-4.rs
@@ -1,4 +1,4 @@
-//@ build-pass
+//@ check-pass
 //@ aux-build: ../ambiguous-4-extern.rs
 
 extern crate ambiguous_4_extern;
diff --git a/tests/ui/imports/ambiguous-5.rs b/tests/ui/imports/ambiguous-5.rs
index 28447e10d1b..8f89c966d4a 100644
--- a/tests/ui/imports/ambiguous-5.rs
+++ b/tests/ui/imports/ambiguous-5.rs
@@ -1,4 +1,3 @@
-//@ check-pass
 // https://github.com/rust-lang/rust/pull/113099#issuecomment-1637022296
 
 mod a {
@@ -11,7 +10,7 @@ mod gpos {
     use super::gsubgpos::*;
     use super::*;
     struct MarkRecord(Class);
-    //~^ WARNING `Class` is ambiguous
+    //~^ ERROR`Class` is ambiguous
     //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 }
 
diff --git a/tests/ui/imports/ambiguous-5.stderr b/tests/ui/imports/ambiguous-5.stderr
index 4bc35f86d3a..41c15809351 100644
--- a/tests/ui/imports/ambiguous-5.stderr
+++ b/tests/ui/imports/ambiguous-5.stderr
@@ -1,5 +1,5 @@
-warning: `Class` is ambiguous
-  --> $DIR/ambiguous-5.rs:13:23
+error: `Class` is ambiguous
+  --> $DIR/ambiguous-5.rs:12:23
    |
 LL |     struct MarkRecord(Class);
    |                       ^^^^^ ambiguous name
@@ -8,18 +8,42 @@ LL |     struct MarkRecord(Class);
    = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
    = note: ambiguous because of multiple glob imports of a name in the same module
 note: `Class` could refer to the struct imported here
-  --> $DIR/ambiguous-5.rs:12:9
+  --> $DIR/ambiguous-5.rs:11:9
    |
 LL |     use super::*;
    |         ^^^^^^^^
    = help: consider adding an explicit import of `Class` to disambiguate
 note: `Class` could also refer to the struct imported here
-  --> $DIR/ambiguous-5.rs:11:9
+  --> $DIR/ambiguous-5.rs:10:9
    |
 LL |     use super::gsubgpos::*;
    |         ^^^^^^^^^^^^^^^^^^
    = help: consider adding an explicit import of `Class` to disambiguate
-   = note: `#[warn(ambiguous_glob_imports)]` on by default
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
+
+error: aborting due to 1 previous error
 
-warning: 1 warning emitted
+Future incompatibility report: Future breakage diagnostic:
+error: `Class` is ambiguous
+  --> $DIR/ambiguous-5.rs:12:23
+   |
+LL |     struct MarkRecord(Class);
+   |                       ^^^^^ ambiguous name
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `Class` could refer to the struct imported here
+  --> $DIR/ambiguous-5.rs:11:9
+   |
+LL |     use super::*;
+   |         ^^^^^^^^
+   = help: consider adding an explicit import of `Class` to disambiguate
+note: `Class` could also refer to the struct imported here
+  --> $DIR/ambiguous-5.rs:10:9
+   |
+LL |     use super::gsubgpos::*;
+   |         ^^^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `Class` to disambiguate
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
 
diff --git a/tests/ui/imports/ambiguous-6.rs b/tests/ui/imports/ambiguous-6.rs
index 955cdc3854f..1c6e3437716 100644
--- a/tests/ui/imports/ambiguous-6.rs
+++ b/tests/ui/imports/ambiguous-6.rs
@@ -1,11 +1,10 @@
-//@ check-pass
 //@ edition: 2021
 // https://github.com/rust-lang/rust/issues/112713
 
 pub fn foo() -> u32 {
     use sub::*;
     C
-    //~^ WARNING `C` is ambiguous
+    //~^ ERROR `C` is ambiguous
     //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 }
 
diff --git a/tests/ui/imports/ambiguous-6.stderr b/tests/ui/imports/ambiguous-6.stderr
index d7871a0b8cb..d988126dbfb 100644
--- a/tests/ui/imports/ambiguous-6.stderr
+++ b/tests/ui/imports/ambiguous-6.stderr
@@ -1,5 +1,5 @@
-warning: `C` is ambiguous
-  --> $DIR/ambiguous-6.rs:7:5
+error: `C` is ambiguous
+  --> $DIR/ambiguous-6.rs:6:5
    |
 LL |     C
    |     ^ ambiguous name
@@ -8,18 +8,42 @@ LL |     C
    = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
    = note: ambiguous because of multiple glob imports of a name in the same module
 note: `C` could refer to the constant imported here
-  --> $DIR/ambiguous-6.rs:16:13
+  --> $DIR/ambiguous-6.rs:15:13
    |
 LL |     pub use mod1::*;
    |             ^^^^^^^
    = help: consider adding an explicit import of `C` to disambiguate
 note: `C` could also refer to the constant imported here
-  --> $DIR/ambiguous-6.rs:17:13
+  --> $DIR/ambiguous-6.rs:16:13
    |
 LL |     pub use mod2::*;
    |             ^^^^^^^
    = help: consider adding an explicit import of `C` to disambiguate
-   = note: `#[warn(ambiguous_glob_imports)]` on by default
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
+
+error: aborting due to 1 previous error
 
-warning: 1 warning emitted
+Future incompatibility report: Future breakage diagnostic:
+error: `C` is ambiguous
+  --> $DIR/ambiguous-6.rs:6:5
+   |
+LL |     C
+   |     ^ ambiguous name
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `C` could refer to the constant imported here
+  --> $DIR/ambiguous-6.rs:15:13
+   |
+LL |     pub use mod1::*;
+   |             ^^^^^^^
+   = help: consider adding an explicit import of `C` to disambiguate
+note: `C` could also refer to the constant imported here
+  --> $DIR/ambiguous-6.rs:16:13
+   |
+LL |     pub use mod2::*;
+   |             ^^^^^^^
+   = help: consider adding an explicit import of `C` to disambiguate
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
 
diff --git a/tests/ui/imports/ambiguous-9.rs b/tests/ui/imports/ambiguous-9.rs
index 97321512df0..c10b1268060 100644
--- a/tests/ui/imports/ambiguous-9.rs
+++ b/tests/ui/imports/ambiguous-9.rs
@@ -1,4 +1,3 @@
-//@ check-pass
 // https://github.com/rust-lang/rust/pull/113099#issuecomment-1638206152
 
 pub mod dsl {
@@ -22,8 +21,8 @@ use prelude::*;
 
 fn main() {
     date_range();
-    //~^ WARNING `date_range` is ambiguous
+    //~^ ERROR `date_range` is ambiguous
     //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
-    //~| WARNING `date_range` is ambiguous
+    //~| ERROR `date_range` is ambiguous
     //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 }
diff --git a/tests/ui/imports/ambiguous-9.stderr b/tests/ui/imports/ambiguous-9.stderr
index 6c7d79174da..1c4768da827 100644
--- a/tests/ui/imports/ambiguous-9.stderr
+++ b/tests/ui/imports/ambiguous-9.stderr
@@ -1,5 +1,5 @@
 warning: ambiguous glob re-exports
-  --> $DIR/ambiguous-9.rs:8:13
+  --> $DIR/ambiguous-9.rs:7:13
    |
 LL |     pub use self::range::*;
    |             ^^^^^^^^^^^^^^ the name `date_range` in the value namespace is first re-exported here
@@ -8,8 +8,8 @@ LL |     use super::prelude::*;
    |
    = note: `#[warn(ambiguous_glob_reexports)]` on by default
 
-warning: `date_range` is ambiguous
-  --> $DIR/ambiguous-9.rs:24:5
+error: `date_range` is ambiguous
+  --> $DIR/ambiguous-9.rs:23:5
    |
 LL |     date_range();
    |     ^^^^^^^^^^ ambiguous name
@@ -18,29 +18,29 @@ LL |     date_range();
    = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
    = note: ambiguous because of multiple glob imports of a name in the same module
 note: `date_range` could refer to the function imported here
-  --> $DIR/ambiguous-9.rs:8:13
+  --> $DIR/ambiguous-9.rs:7:13
    |
 LL |     pub use self::range::*;
    |             ^^^^^^^^^^^^^^
    = help: consider adding an explicit import of `date_range` to disambiguate
 note: `date_range` could also refer to the function imported here
-  --> $DIR/ambiguous-9.rs:9:9
+  --> $DIR/ambiguous-9.rs:8:9
    |
 LL |     use super::prelude::*;
    |         ^^^^^^^^^^^^^^^^^
    = help: consider adding an explicit import of `date_range` to disambiguate
-   = note: `#[warn(ambiguous_glob_imports)]` on by default
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
 
 warning: ambiguous glob re-exports
-  --> $DIR/ambiguous-9.rs:16:13
+  --> $DIR/ambiguous-9.rs:15:13
    |
 LL |     pub use self::t::*;
    |             ^^^^^^^^^^ the name `date_range` in the value namespace is first re-exported here
 LL |     pub use super::dsl::*;
    |             ------------- but the name `date_range` in the value namespace is also re-exported here
 
-warning: `date_range` is ambiguous
-  --> $DIR/ambiguous-9.rs:24:5
+error: `date_range` is ambiguous
+  --> $DIR/ambiguous-9.rs:23:5
    |
 LL |     date_range();
    |     ^^^^^^^^^^ ambiguous name
@@ -49,17 +49,65 @@ LL |     date_range();
    = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
    = note: ambiguous because of multiple glob imports of a name in the same module
 note: `date_range` could refer to the function imported here
-  --> $DIR/ambiguous-9.rs:20:5
+  --> $DIR/ambiguous-9.rs:19:5
    |
 LL | use dsl::*;
    |     ^^^^^^
    = help: consider adding an explicit import of `date_range` to disambiguate
 note: `date_range` could also refer to the function imported here
-  --> $DIR/ambiguous-9.rs:21:5
+  --> $DIR/ambiguous-9.rs:20:5
    |
 LL | use prelude::*;
    |     ^^^^^^^^^^
    = help: consider adding an explicit import of `date_range` to disambiguate
 
-warning: 4 warnings emitted
+error: aborting due to 2 previous errors; 2 warnings emitted
+
+Future incompatibility report: Future breakage diagnostic:
+error: `date_range` is ambiguous
+  --> $DIR/ambiguous-9.rs:23:5
+   |
+LL |     date_range();
+   |     ^^^^^^^^^^ ambiguous name
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `date_range` could refer to the function imported here
+  --> $DIR/ambiguous-9.rs:7:13
+   |
+LL |     pub use self::range::*;
+   |             ^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `date_range` to disambiguate
+note: `date_range` could also refer to the function imported here
+  --> $DIR/ambiguous-9.rs:8:9
+   |
+LL |     use super::prelude::*;
+   |         ^^^^^^^^^^^^^^^^^
+   = help: consider adding an explicit import of `date_range` to disambiguate
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
+
+Future breakage diagnostic:
+error: `date_range` is ambiguous
+  --> $DIR/ambiguous-9.rs:23:5
+   |
+LL |     date_range();
+   |     ^^^^^^^^^^ ambiguous name
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `date_range` could refer to the function imported here
+  --> $DIR/ambiguous-9.rs:19:5
+   |
+LL | use dsl::*;
+   |     ^^^^^^
+   = help: consider adding an explicit import of `date_range` to disambiguate
+note: `date_range` could also refer to the function imported here
+  --> $DIR/ambiguous-9.rs:20:5
+   |
+LL | use prelude::*;
+   |     ^^^^^^^^^^
+   = help: consider adding an explicit import of `date_range` to disambiguate
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
 
diff --git a/tests/ui/imports/duplicate.rs b/tests/ui/imports/duplicate.rs
index 69ec82aafbd..0a652889ca8 100644
--- a/tests/ui/imports/duplicate.rs
+++ b/tests/ui/imports/duplicate.rs
@@ -34,7 +34,7 @@ fn main() {
     e::foo();
     f::foo(); //~ ERROR `foo` is ambiguous
     g::foo();
-    //~^ WARNING `foo` is ambiguous
+    //~^ ERROR `foo` is ambiguous
     //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 }
 
diff --git a/tests/ui/imports/duplicate.stderr b/tests/ui/imports/duplicate.stderr
index f7dc7312b9d..ef987d07c04 100644
--- a/tests/ui/imports/duplicate.stderr
+++ b/tests/ui/imports/duplicate.stderr
@@ -68,7 +68,7 @@ LL |     use self::m2::*;
    |         ^^^^^^^^^^^
    = help: consider adding an explicit import of `foo` to disambiguate
 
-warning: `foo` is ambiguous
+error: `foo` is ambiguous
   --> $DIR/duplicate.rs:36:8
    |
 LL |     g::foo();
@@ -89,9 +89,33 @@ note: `foo` could also refer to the function imported here
 LL |     pub use crate::b::*;
    |             ^^^^^^^^^^^
    = help: consider adding an explicit import of `foo` to disambiguate
-   = note: `#[warn(ambiguous_glob_imports)]` on by default
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
 
-error: aborting due to 4 previous errors; 1 warning emitted
+error: aborting due to 5 previous errors
 
 Some errors have detailed explanations: E0252, E0659.
 For more information about an error, try `rustc --explain E0252`.
+Future incompatibility report: Future breakage diagnostic:
+error: `foo` is ambiguous
+  --> $DIR/duplicate.rs:36:8
+   |
+LL |     g::foo();
+   |        ^^^ ambiguous name
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `foo` could refer to the function imported here
+  --> $DIR/duplicate.rs:24:13
+   |
+LL |     pub use crate::a::*;
+   |             ^^^^^^^^^^^
+   = help: consider adding an explicit import of `foo` to disambiguate
+note: `foo` could also refer to the function imported here
+  --> $DIR/duplicate.rs:25:13
+   |
+LL |     pub use crate::b::*;
+   |             ^^^^^^^^^^^
+   = help: consider adding an explicit import of `foo` to disambiguate
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
+
diff --git a/tests/ui/imports/unresolved-seg-after-ambiguous.rs b/tests/ui/imports/unresolved-seg-after-ambiguous.rs
index dcabc528a85..67366deabaa 100644
--- a/tests/ui/imports/unresolved-seg-after-ambiguous.rs
+++ b/tests/ui/imports/unresolved-seg-after-ambiguous.rs
@@ -18,7 +18,7 @@ mod a {
 
 use self::a::E::in_exist;
 //~^ ERROR: unresolved import `self::a::E`
-//~| WARNING: `E` is ambiguous
+//~| ERROR: `E` is ambiguous
 //~| WARNING: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
 
 fn main() {}
diff --git a/tests/ui/imports/unresolved-seg-after-ambiguous.stderr b/tests/ui/imports/unresolved-seg-after-ambiguous.stderr
index 9e0efd4a75f..3b50ae32683 100644
--- a/tests/ui/imports/unresolved-seg-after-ambiguous.stderr
+++ b/tests/ui/imports/unresolved-seg-after-ambiguous.stderr
@@ -4,7 +4,7 @@ error[E0432]: unresolved import `self::a::E`
 LL | use self::a::E::in_exist;
    |              ^ `E` is a struct, not a module
 
-warning: `E` is ambiguous
+error: `E` is ambiguous
   --> $DIR/unresolved-seg-after-ambiguous.rs:19:14
    |
 LL | use self::a::E::in_exist;
@@ -25,8 +25,32 @@ note: `E` could also refer to the struct imported here
 LL |         pub use self::d::*;
    |                 ^^^^^^^^^^
    = help: consider adding an explicit import of `E` to disambiguate
-   = note: `#[warn(ambiguous_glob_imports)]` on by default
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
 
-error: aborting due to 1 previous error; 1 warning emitted
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0432`.
+Future incompatibility report: Future breakage diagnostic:
+error: `E` is ambiguous
+  --> $DIR/unresolved-seg-after-ambiguous.rs:19:14
+   |
+LL | use self::a::E::in_exist;
+   |              ^ ambiguous name
+   |
+   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #114095 <https://github.com/rust-lang/rust/issues/114095>
+   = note: ambiguous because of multiple glob imports of a name in the same module
+note: `E` could refer to the struct imported here
+  --> $DIR/unresolved-seg-after-ambiguous.rs:13:17
+   |
+LL |         pub use self::c::*;
+   |                 ^^^^^^^^^^
+   = help: consider adding an explicit import of `E` to disambiguate
+note: `E` could also refer to the struct imported here
+  --> $DIR/unresolved-seg-after-ambiguous.rs:12:17
+   |
+LL |         pub use self::d::*;
+   |                 ^^^^^^^^^^
+   = help: consider adding an explicit import of `E` to disambiguate
+   = note: `#[deny(ambiguous_glob_imports)]` on by default
+
diff --git a/tests/ui/paren-span.rs b/tests/ui/macros/macro-paren-span-diagnostic.rs
index c8cb63d5190..cbcb0231e4e 100644
--- a/tests/ui/paren-span.rs
+++ b/tests/ui/macros/macro-paren-span-diagnostic.rs
@@ -1,5 +1,6 @@
-// Be smart about span of parenthesized expression in macro.
+//! Check that error spans in parenthesized macro expressions point to the call site.
 
+#[rustfmt::skip]
 macro_rules! paren {
     ($e:expr) => (($e))
     //            ^^^^ do not highlight here
@@ -7,8 +8,9 @@ macro_rules! paren {
 
 mod m {
     pub struct S {
-        x: i32
+        x: i32,
     }
+
     pub fn make() -> S {
         S { x: 0 }
     }
diff --git a/tests/ui/paren-span.stderr b/tests/ui/macros/macro-paren-span-diagnostic.stderr
index da2f57033a4..ede6ff51c71 100644
--- a/tests/ui/paren-span.stderr
+++ b/tests/ui/macros/macro-paren-span-diagnostic.stderr
@@ -1,5 +1,5 @@
 error[E0616]: field `x` of struct `S` is private
-  --> $DIR/paren-span.rs:19:14
+  --> $DIR/macro-paren-span-diagnostic.rs:21:14
    |
 LL |     paren!(s.x);
    |              ^ private field
diff --git a/tests/ui/macros/metavar-expressions/syntax-errors.rs b/tests/ui/macros/metavar-expressions/syntax-errors.rs
index 8fc76a74baa..585ea4d5979 100644
--- a/tests/ui/macros/metavar-expressions/syntax-errors.rs
+++ b/tests/ui/macros/metavar-expressions/syntax-errors.rs
@@ -30,7 +30,7 @@ macro_rules! metavar_with_literal_suffix {
 
 macro_rules! mve_without_parens {
     ( $( $i:ident ),* ) => { ${ count } };
-    //~^ ERROR meta-variable expression parameter must be wrapped in parentheses
+    //~^ ERROR expected `(`
 }
 
 #[rustfmt::skip]
@@ -45,9 +45,14 @@ macro_rules! open_brackets_with_lit {
      //~^ ERROR expected identifier
  }
 
+macro_rules! mvs_missing_paren {
+    ( $( $i:ident ),* ) => { ${ count $i ($i) } };
+    //~^ ERROR expected `(`
+}
+
 macro_rules! mve_wrong_delim {
     ( $( $i:ident ),* ) => { ${ count{i} } };
-    //~^ ERROR meta-variable expression parameter must be wrapped in parentheses
+    //~^ ERROR expected `(`
 }
 
 macro_rules! invalid_metavar {
@@ -64,28 +69,30 @@ macro_rules! open_brackets_with_group {
 macro_rules! extra_garbage_after_metavar {
     ( $( $i:ident ),* ) => {
         ${count() a b c}
-        //~^ ERROR unexpected token: a
+        //~^ ERROR unexpected trailing tokens
         ${count($i a b c)}
-        //~^ ERROR unexpected token: a
+        //~^ ERROR unexpected trailing tokens
         ${count($i, 1 a b c)}
-        //~^ ERROR unexpected token: a
+        //~^ ERROR unexpected trailing tokens
         ${count($i) a b c}
-        //~^ ERROR unexpected token: a
+        //~^ ERROR unexpected trailing tokens
 
         ${ignore($i) a b c}
-        //~^ ERROR unexpected token: a
+        //~^ ERROR unexpected trailing tokens
         ${ignore($i a b c)}
-        //~^ ERROR unexpected token: a
+        //~^ ERROR unexpected trailing tokens
 
         ${index() a b c}
-        //~^ ERROR unexpected token: a
+        //~^ ERROR unexpected trailing tokens
         ${index(1 a b c)}
-        //~^ ERROR unexpected token: a
+        //~^ ERROR unexpected trailing tokens
 
         ${index() a b c}
-        //~^ ERROR unexpected token: a
+        //~^ ERROR unexpected trailing tokens
         ${index(1 a b c)}
-        //~^ ERROR unexpected token: a
+        //~^ ERROR unexpected trailing tokens
+        ${index(1, a b c)}
+        //~^ ERROR unexpected trailing tokens
     };
 }
 
@@ -111,7 +118,7 @@ macro_rules! unknown_ignore_ident {
 
 macro_rules! unknown_metavar {
     ( $( $i:ident ),* ) => { ${ aaaaaaaaaaaaaa(i) } };
-    //~^ ERROR unrecognized meta-variable expression
+    //~^ ERROR unrecognized metavariable expression
 }
 
 fn main() {}
diff --git a/tests/ui/macros/metavar-expressions/syntax-errors.stderr b/tests/ui/macros/metavar-expressions/syntax-errors.stderr
index 20d2358facc..bf1c7673a6c 100644
--- a/tests/ui/macros/metavar-expressions/syntax-errors.stderr
+++ b/tests/ui/macros/metavar-expressions/syntax-errors.stderr
@@ -40,167 +40,165 @@ error: only unsuffixes integer literals are supported in meta-variable expressio
 LL |     ( $( $i:ident ),* ) => { ${ index(1u32) } };
    |                                 ^^^^^
 
-error: meta-variable expression parameter must be wrapped in parentheses
+error: expected `(`
   --> $DIR/syntax-errors.rs:32:33
    |
 LL |     ( $( $i:ident ),* ) => { ${ count } };
-   |                                 ^^^^^
+   |                                 ^^^^^- help: try adding parentheses: `( /* ... */ )`
+   |                                 |
+   |                                 for this this metavariable expression
+   |
+   = note: metavariable expressions use function-like parentheses syntax
 
-error: meta-variable expression parameter must be wrapped in parentheses
+error: expected `(`
   --> $DIR/syntax-errors.rs:49:33
    |
+LL |     ( $( $i:ident ),* ) => { ${ count $i ($i) } };
+   |                                 ^^^^^ - unexpected token
+   |                                 |
+   |                                 for this this metavariable expression
+   |
+   = note: metavariable expressions use function-like parentheses syntax
+
+error: expected `(`
+  --> $DIR/syntax-errors.rs:54:33
+   |
 LL |     ( $( $i:ident ),* ) => { ${ count{i} } };
-   |                                 ^^^^^
+   |                                 ^^^^^ for this this metavariable expression
+   |
+   = note: metavariable expressions use function-like parentheses syntax
 
 error: expected identifier, found `123`
-  --> $DIR/syntax-errors.rs:54:23
+  --> $DIR/syntax-errors.rs:59:23
    |
 LL |     () => { ${ignore($123)} }
    |                       ^^^ help: try removing `123`
 
-error: unexpected token: a
-  --> $DIR/syntax-errors.rs:66:19
-   |
-LL |         ${count() a b c}
-   |                   ^
-   |
-note: meta-variable expression must not have trailing tokens
-  --> $DIR/syntax-errors.rs:66:19
+error: unexpected trailing tokens
+  --> $DIR/syntax-errors.rs:71:19
    |
 LL |         ${count() a b c}
-   |                   ^
+   |           -----   ^^^^^ help: try removing these tokens
+   |           |
+   |           for this metavariable expression
 
-error: unexpected token: a
-  --> $DIR/syntax-errors.rs:68:20
+error: unexpected trailing tokens
+  --> $DIR/syntax-errors.rs:73:20
    |
 LL |         ${count($i a b c)}
-   |                    ^
-   |
-note: meta-variable expression must not have trailing tokens
-  --> $DIR/syntax-errors.rs:68:20
+   |           -----    ^^^^^ help: try removing these tokens
+   |           |
+   |           for this metavariable expression
    |
-LL |         ${count($i a b c)}
-   |                    ^
+   = note: the `count` metavariable expression takes between 1 and 2 arguments
 
-error: unexpected token: a
-  --> $DIR/syntax-errors.rs:70:23
+error: unexpected trailing tokens
+  --> $DIR/syntax-errors.rs:75:23
    |
 LL |         ${count($i, 1 a b c)}
-   |                       ^
+   |           -----       ^^^^^ help: try removing these tokens
+   |           |
+   |           for this metavariable expression
    |
-note: meta-variable expression must not have trailing tokens
-  --> $DIR/syntax-errors.rs:70:23
-   |
-LL |         ${count($i, 1 a b c)}
-   |                       ^
+   = note: the `count` metavariable expression takes between 1 and 2 arguments
 
-error: unexpected token: a
-  --> $DIR/syntax-errors.rs:72:21
-   |
-LL |         ${count($i) a b c}
-   |                     ^
-   |
-note: meta-variable expression must not have trailing tokens
-  --> $DIR/syntax-errors.rs:72:21
+error: unexpected trailing tokens
+  --> $DIR/syntax-errors.rs:77:21
    |
 LL |         ${count($i) a b c}
-   |                     ^
+   |           -----     ^^^^^ help: try removing these tokens
+   |           |
+   |           for this metavariable expression
 
-error: unexpected token: a
-  --> $DIR/syntax-errors.rs:75:22
+error: unexpected trailing tokens
+  --> $DIR/syntax-errors.rs:80:22
    |
 LL |         ${ignore($i) a b c}
-   |                      ^
-   |
-note: meta-variable expression must not have trailing tokens
-  --> $DIR/syntax-errors.rs:75:22
-   |
-LL |         ${ignore($i) a b c}
-   |                      ^
+   |           ------     ^^^^^ help: try removing these tokens
+   |           |
+   |           for this metavariable expression
 
-error: unexpected token: a
-  --> $DIR/syntax-errors.rs:77:21
+error: unexpected trailing tokens
+  --> $DIR/syntax-errors.rs:82:21
    |
 LL |         ${ignore($i a b c)}
-   |                     ^
+   |           ------    ^^^^^ help: try removing these tokens
+   |           |
+   |           for this metavariable expression
    |
-note: meta-variable expression must not have trailing tokens
-  --> $DIR/syntax-errors.rs:77:21
-   |
-LL |         ${ignore($i a b c)}
-   |                     ^
+   = note: the `ignore` metavariable expression takes a single argument
 
-error: unexpected token: a
-  --> $DIR/syntax-errors.rs:80:19
-   |
-LL |         ${index() a b c}
-   |                   ^
-   |
-note: meta-variable expression must not have trailing tokens
-  --> $DIR/syntax-errors.rs:80:19
+error: unexpected trailing tokens
+  --> $DIR/syntax-errors.rs:85:19
    |
 LL |         ${index() a b c}
-   |                   ^
+   |           -----   ^^^^^ help: try removing these tokens
+   |           |
+   |           for this metavariable expression
 
-error: unexpected token: a
-  --> $DIR/syntax-errors.rs:82:19
+error: unexpected trailing tokens
+  --> $DIR/syntax-errors.rs:87:19
    |
 LL |         ${index(1 a b c)}
-   |                   ^
-   |
-note: meta-variable expression must not have trailing tokens
-  --> $DIR/syntax-errors.rs:82:19
+   |           -----   ^^^^^ help: try removing these tokens
+   |           |
+   |           for this metavariable expression
    |
-LL |         ${index(1 a b c)}
-   |                   ^
+   = note: the `index` metavariable expression takes between 0 and 1 arguments
 
-error: unexpected token: a
-  --> $DIR/syntax-errors.rs:85:19
-   |
-LL |         ${index() a b c}
-   |                   ^
-   |
-note: meta-variable expression must not have trailing tokens
-  --> $DIR/syntax-errors.rs:85:19
+error: unexpected trailing tokens
+  --> $DIR/syntax-errors.rs:90:19
    |
 LL |         ${index() a b c}
-   |                   ^
+   |           -----   ^^^^^ help: try removing these tokens
+   |           |
+   |           for this metavariable expression
 
-error: unexpected token: a
-  --> $DIR/syntax-errors.rs:87:19
+error: unexpected trailing tokens
+  --> $DIR/syntax-errors.rs:92:19
    |
 LL |         ${index(1 a b c)}
-   |                   ^
+   |           -----   ^^^^^ help: try removing these tokens
+   |           |
+   |           for this metavariable expression
    |
-note: meta-variable expression must not have trailing tokens
-  --> $DIR/syntax-errors.rs:87:19
+   = note: the `index` metavariable expression takes between 0 and 1 arguments
+
+error: unexpected trailing tokens
+  --> $DIR/syntax-errors.rs:94:18
    |
-LL |         ${index(1 a b c)}
-   |                   ^
+LL |         ${index(1, a b c)}
+   |           -----  ^^^^^^^ help: try removing these tokens
+   |           |
+   |           for this metavariable expression
+   |
+   = note: the `index` metavariable expression takes between 0 and 1 arguments
 
 error: meta-variable expression depth must be a literal
-  --> $DIR/syntax-errors.rs:94:33
+  --> $DIR/syntax-errors.rs:101:33
    |
 LL |     ( $( $i:ident ),* ) => { ${ index(IDX) } };
    |                                 ^^^^^
 
 error: meta-variables within meta-variable expressions must be referenced using a dollar sign
-  --> $DIR/syntax-errors.rs:100:11
+  --> $DIR/syntax-errors.rs:107:11
    |
 LL |         ${count(foo)}
    |           ^^^^^
 
 error: meta-variables within meta-variable expressions must be referenced using a dollar sign
-  --> $DIR/syntax-errors.rs:107:11
+  --> $DIR/syntax-errors.rs:114:11
    |
 LL |         ${ignore(bar)}
    |           ^^^^^^
 
-error: unrecognized meta-variable expression
-  --> $DIR/syntax-errors.rs:113:33
+error: unrecognized metavariable expression
+  --> $DIR/syntax-errors.rs:120:33
    |
 LL |     ( $( $i:ident ),* ) => { ${ aaaaaaaaaaaaaa(i) } };
-   |                                 ^^^^^^^^^^^^^^ help: supported expressions are count, ignore, index and len
+   |                                 ^^^^^^^^^^^^^^ not a valid metavariable expression
+   |
+   = note: valid metavariable expressions are `count`, `ignore`, `index`, `len`, and `concat`
 
 error: expected identifier or string literal
   --> $DIR/syntax-errors.rs:38:14
@@ -215,10 +213,10 @@ LL |      () => { ${ "hi" } };
    |                 ^^^^ help: try removing `"hi"`
 
 error: expected identifier or string literal
-  --> $DIR/syntax-errors.rs:60:33
+  --> $DIR/syntax-errors.rs:65:33
    |
 LL |     ( $( $i:ident ),* ) => { ${ {} } };
    |                                 ^^
 
-error: aborting due to 25 previous errors
+error: aborting due to 27 previous errors
 
diff --git a/tests/ui/out-pointer-aliasing.rs b/tests/ui/out-pointer-aliasing.rs
deleted file mode 100644
index 0dfaa19fadb..00000000000
--- a/tests/ui/out-pointer-aliasing.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-//@ run-pass
-
-#[derive(Copy, Clone)]
-pub struct Foo {
-    f1: isize,
-    _f2: isize,
-}
-
-#[inline(never)]
-pub fn foo(f: &mut Foo) -> Foo {
-    let ret = *f;
-    f.f1 = 0;
-    ret
-}
-
-pub fn main() {
-    let mut f = Foo {
-        f1: 8,
-        _f2: 9,
-    };
-    f = foo(&mut f);
-    assert_eq!(f.f1, 8);
-}
diff --git a/tests/ui/over-constrained-vregs.rs b/tests/ui/over-constrained-vregs.rs
deleted file mode 100644
index 016a667e937..00000000000
--- a/tests/ui/over-constrained-vregs.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-//@ run-pass
-
-#![allow(unused_must_use)]
-// Regression test for issue #152.
-pub fn main() {
-    let mut b: usize = 1_usize;
-    while b < std::mem::size_of::<usize>() {
-        0_usize << b;
-        b <<= 1_usize;
-        println!("{}", b);
-    }
-}
diff --git a/tests/ui/panic_implementation-closures.rs b/tests/ui/panic_implementation-closures.rs
deleted file mode 100644
index b161859bf9c..00000000000
--- a/tests/ui/panic_implementation-closures.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-//@ build-pass (FIXME(62277): could be check-pass?)
-
-#![crate_type = "rlib"]
-#![no_std]
-
-#[panic_handler]
-pub fn panic_fmt(_: &::core::panic::PanicInfo) -> ! {
-    |x: u8| x;
-    loop {}
-}
diff --git a/tests/ui/panic-while-printing.rs b/tests/ui/panics/panic-during-display-formatting.rs
index 6505a69fef7..a307ee49385 100644
--- a/tests/ui/panic-while-printing.rs
+++ b/tests/ui/panics/panic-during-display-formatting.rs
@@ -1,3 +1,5 @@
+//! Check that panics in `Display::fmt` during printing are properly handled.
+
 //@ run-pass
 //@ needs-unwind
 
@@ -18,8 +20,10 @@ impl Display for A {
 
 fn main() {
     set_output_capture(Some(Arc::new(Mutex::new(Vec::new()))));
-    assert!(std::panic::catch_unwind(|| {
-        eprintln!("{}", A);
-    })
-    .is_err());
+    assert!(
+        std::panic::catch_unwind(|| {
+            eprintln!("{}", A);
+        })
+        .is_err()
+    );
 }
diff --git a/tests/ui/panics/panic-handler-closures.rs b/tests/ui/panics/panic-handler-closures.rs
new file mode 100644
index 00000000000..27fea925720
--- /dev/null
+++ b/tests/ui/panics/panic-handler-closures.rs
@@ -0,0 +1,12 @@
+//! Check that closures can be used inside `#[panic_handler]` functions.
+
+//@ check-pass
+
+#![crate_type = "rlib"]
+#![no_std]
+
+#[panic_handler]
+pub fn panicfmt(_: &::core::panic::PanicInfo) -> ! {
+    |x: u8| x;
+    loop {}
+}
diff --git a/tests/ui/parser/ufcs-return-unused-parens.fixed b/tests/ui/parser/ufcs-return-unused-parens.fixed
new file mode 100644
index 00000000000..811a853b769
--- /dev/null
+++ b/tests/ui/parser/ufcs-return-unused-parens.fixed
@@ -0,0 +1,20 @@
+//! Check that UFCS syntax works correctly in return statements
+//! without requiring workaround parentheses.
+//!
+//! Regression test for <https://github.com/rust-lang/rust/issues/37765>.
+
+//@ run-pass
+//@ run-rustfix
+
+#![allow(dead_code)]
+#![warn(unused_parens)]
+
+fn with_parens<T: ToString>(arg: T) -> String {
+    return <T as ToString>::to_string(&arg); //~ WARN unnecessary parentheses around `return` value
+}
+
+fn no_parens<T: ToString>(arg: T) -> String {
+    return <T as ToString>::to_string(&arg);
+}
+
+fn main() {}
diff --git a/tests/ui/parser/ufcs-return-unused-parens.rs b/tests/ui/parser/ufcs-return-unused-parens.rs
new file mode 100644
index 00000000000..6ea69ef9a26
--- /dev/null
+++ b/tests/ui/parser/ufcs-return-unused-parens.rs
@@ -0,0 +1,20 @@
+//! Check that UFCS syntax works correctly in return statements
+//! without requiring workaround parentheses.
+//!
+//! Regression test for <https://github.com/rust-lang/rust/issues/37765>.
+
+//@ run-pass
+//@ run-rustfix
+
+#![allow(dead_code)]
+#![warn(unused_parens)]
+
+fn with_parens<T: ToString>(arg: T) -> String {
+    return (<T as ToString>::to_string(&arg)); //~ WARN unnecessary parentheses around `return` value
+}
+
+fn no_parens<T: ToString>(arg: T) -> String {
+    return <T as ToString>::to_string(&arg);
+}
+
+fn main() {}
diff --git a/tests/ui/path-lookahead.stderr b/tests/ui/parser/ufcs-return-unused-parens.stderr
index 2cc786fd947..6c09e98e7b1 100644
--- a/tests/ui/path-lookahead.stderr
+++ b/tests/ui/parser/ufcs-return-unused-parens.stderr
@@ -1,11 +1,11 @@
 warning: unnecessary parentheses around `return` value
-  --> $DIR/path-lookahead.rs:10:12
+  --> $DIR/ufcs-return-unused-parens.rs:13:12
    |
 LL |     return (<T as ToString>::to_string(&arg));
    |            ^                                ^
    |
 note: the lint level is defined here
-  --> $DIR/path-lookahead.rs:5:9
+  --> $DIR/ufcs-return-unused-parens.rs:10:9
    |
 LL | #![warn(unused_parens)]
    |         ^^^^^^^^^^^^^
diff --git a/tests/ui/path-lookahead.fixed b/tests/ui/path-lookahead.fixed
deleted file mode 100644
index 440b22edd7d..00000000000
--- a/tests/ui/path-lookahead.fixed
+++ /dev/null
@@ -1,17 +0,0 @@
-//@ run-pass
-//@ run-rustfix
-
-#![allow(dead_code)]
-#![warn(unused_parens)]
-
-// Parser test for #37765
-
-fn with_parens<T: ToString>(arg: T) -> String {
-    return <T as ToString>::to_string(&arg); //~WARN unnecessary parentheses around `return` value
-}
-
-fn no_parens<T: ToString>(arg: T) -> String {
-    return <T as ToString>::to_string(&arg);
-}
-
-fn main() {}
diff --git a/tests/ui/path-lookahead.rs b/tests/ui/path-lookahead.rs
deleted file mode 100644
index 7eaacd6bba7..00000000000
--- a/tests/ui/path-lookahead.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-//@ run-pass
-//@ run-rustfix
-
-#![allow(dead_code)]
-#![warn(unused_parens)]
-
-// Parser test for #37765
-
-fn with_parens<T: ToString>(arg: T) -> String {
-    return (<T as ToString>::to_string(&arg)); //~WARN unnecessary parentheses around `return` value
-}
-
-fn no_parens<T: ToString>(arg: T) -> String {
-    return <T as ToString>::to_string(&arg);
-}
-
-fn main() {}
diff --git a/tests/ui/proc-macro/auxiliary/mixed-site-span.rs b/tests/ui/proc-macro/auxiliary/mixed-site-span.rs
index d837c88c955..18df712debc 100644
--- a/tests/ui/proc-macro/auxiliary/mixed-site-span.rs
+++ b/tests/ui/proc-macro/auxiliary/mixed-site-span.rs
@@ -3,33 +3,89 @@
 extern crate proc_macro;
 use proc_macro::*;
 
+
+#[proc_macro]
+pub fn proc_macro_item(input: TokenStream) -> TokenStream {
+    input
+}
+
+#[proc_macro]
+pub fn proc_macro_rules(_input: TokenStream) -> TokenStream {
+    let id = |s| TokenTree::from(Ident::new(s, Span::mixed_site()));
+    let item_def = id("ItemDef");
+    let local_def = id("local_def");
+    let item_use = id("ItemUse");
+    let local_use = id("local_use");
+    let mut single_quote = Punct::new('\'', Spacing::Joint);
+    single_quote.set_span(Span::mixed_site());
+    let label_use: TokenStream = [
+        TokenTree::from(single_quote),
+        id("label_use"),
+    ].iter().cloned().collect();
+    let dollar_crate = id("$crate");
+    quote!(
+        use $dollar_crate::proc_macro_item as _; // OK
+        type A = $dollar_crate::ItemUse; // ERROR
+
+        struct $item_def;
+        let $local_def = 0;
+
+        $item_use; // OK
+        $local_use; // ERROR
+        break $label_use; // ERROR
+    )
+}
+
+#[proc_macro]
+pub fn with_crate(input: TokenStream) -> TokenStream {
+    let mut input = input.into_iter();
+    let TokenTree::Ident(mut krate) = input.next().unwrap() else { panic!("missing $crate") };
+    let TokenTree::Ident(span) = input.next().unwrap() else { panic!("missing span") };
+    let TokenTree::Ident(ident) = input.next().unwrap() else { panic!("missing ident") };
+
+    match (krate.to_string().as_str(), span.to_string().as_str()) {
+        ("$crate", "input") => {},
+        (_, "input") => krate = Ident::new("$crate", krate.span()),
+
+        ("$crate", "mixed") => krate.set_span(Span::mixed_site()),
+        (_, "mixed") => krate = Ident::new("$crate", Span::mixed_site()),
+
+        ("$crate", "call") => krate.set_span(Span::call_site()),
+        (_, "call") => krate = Ident::new("$crate", Span::call_site()),
+
+        (_, x) => panic!("bad span {}", x),
+    }
+
+    quote!(use $krate::$ident as _;)
+}
+
 #[proc_macro]
-pub fn proc_macro_rules(input: TokenStream) -> TokenStream {
-    if input.is_empty() {
-        let id = |s| TokenTree::from(Ident::new(s, Span::mixed_site()));
-        let item_def = id("ItemDef");
-        let local_def = id("local_def");
-        let item_use = id("ItemUse");
-        let local_use = id("local_use");
-        let mut single_quote = Punct::new('\'', Spacing::Joint);
-        single_quote.set_span(Span::mixed_site());
-        let label_use: TokenStream = [
-            TokenTree::from(single_quote),
-            id("label_use"),
-        ].iter().cloned().collect();
-        quote!(
-            struct $item_def;
-            let $local_def = 0;
-
-            $item_use; // OK
-            $local_use; // ERROR
-            break $label_use; // ERROR
-        )
-    } else {
-        let mut dollar_crate = input.into_iter().next().unwrap();
-        dollar_crate.set_span(Span::mixed_site());
-        quote!(
-            type A = $dollar_crate::ItemUse;
-        )
+pub fn declare_macro(input: TokenStream) -> TokenStream {
+    let mut input = input.into_iter();
+    let TokenTree::Ident(mut krate) = input.next().unwrap() else { panic!("missing $crate") };
+    let TokenTree::Ident(span) = input.next().unwrap() else { panic!("missing span") };
+    let TokenTree::Ident(ident) = input.next().unwrap() else { panic!("missing ident") };
+
+
+    match (krate.to_string().as_str(), span.to_string().as_str()) {
+        ("$crate", "input") => {},
+        (_, "input") => krate = Ident::new("$crate", krate.span()),
+
+        ("$crate", "mixed") => krate.set_span(Span::mixed_site()),
+        (_, "mixed") => krate = Ident::new("$crate", Span::mixed_site()),
+
+        ("$crate", "call") => krate.set_span(Span::call_site()),
+        (_, "call") => krate = Ident::new("$crate", Span::call_site()),
+
+        (_, x) => panic!("bad span {}", x),
     }
+
+    quote!(
+        #[macro_export]
+        macro_rules! $ident {
+            ($$i:ident) => {
+                use $krate::$$i as _;
+            };
+        }
+    )
 }
diff --git a/tests/ui/proc-macro/auxiliary/token-site-span.rs b/tests/ui/proc-macro/auxiliary/token-site-span.rs
new file mode 100644
index 00000000000..39ad8368a50
--- /dev/null
+++ b/tests/ui/proc-macro/auxiliary/token-site-span.rs
@@ -0,0 +1,30 @@
+// Testing token span hygiene.
+
+//@ proc-macro: mixed-site-span.rs
+
+extern crate mixed_site_span;
+
+use mixed_site_span::declare_macro;
+
+pub struct TokenItem;
+
+#[macro_export]
+macro_rules! invoke_with_crate {
+    ($s:ident $i:ident) => { with_crate!{$crate $s $i} };
+}
+
+#[macro_export]
+macro_rules! invoke_with_ident {
+    ($s:ident $i:ident) => { with_crate!{krate $s $i} };
+    ($m:ident $s:ident $i:ident) => { with_crate!{$m $s $i} };
+}
+
+macro_rules! local {() => {
+    declare_macro!{$crate input use_input_crate}
+    declare_macro!{$crate mixed use_mixed_crate}
+    declare_macro!{$crate call use_call_crate}
+}}
+local!{}
+declare_macro!{krate input use_input_krate}
+declare_macro!{krate mixed use_mixed_krate}
+declare_macro!{krate call use_call_krate}
diff --git a/tests/ui/proc-macro/mixed-site-span.rs b/tests/ui/proc-macro/mixed-site-span.rs
index 2b5d9757043..442b440c121 100644
--- a/tests/ui/proc-macro/mixed-site-span.rs
+++ b/tests/ui/proc-macro/mixed-site-span.rs
@@ -1,24 +1,174 @@
 // Proc macros using `mixed_site` spans exhibit usual properties of `macro_rules` hygiene.
 
+//@ aux-build: token-site-span.rs
 //@ proc-macro: mixed-site-span.rs
 
-#[macro_use]
 extern crate mixed_site_span;
+extern crate token_site_span;
 
-struct ItemUse;
+use mixed_site_span::{proc_macro_rules, with_crate};
+use token_site_span::{
+    invoke_with_crate, invoke_with_ident,
+    use_input_crate, use_mixed_crate, use_call_crate,
+    use_input_krate, use_mixed_krate, use_call_krate,
+};
+
+pub struct ItemUse;
 
 fn main() {
     'label_use: loop {
         let local_use = 1;
         proc_macro_rules!();
-        //~^ ERROR use of undeclared label `'label_use`
+        //~^ ERROR cannot find type `ItemUse` in crate `$crate`
+        //~| ERROR use of undeclared label `'label_use`
         //~| ERROR cannot find value `local_use` in this scope
         ItemDef; // OK
         local_def; //~ ERROR cannot find value `local_def` in this scope
     }
 }
 
-macro_rules! pass_dollar_crate {
-    () => (proc_macro_rules!($crate);) //~ ERROR cannot find type `ItemUse` in crate `$crate`
-}
-pass_dollar_crate!();
+// Successful resolutions of `mixed_site_span::proc_macro_item`
+const _: () = {
+    invoke_with_crate!{mixed proc_macro_item}
+    invoke_with_ident!{mixed proc_macro_item}
+    invoke_with_ident!{krate mixed proc_macro_item}
+    with_crate!{krate mixed proc_macro_item}
+
+    macro_rules! test {() => {
+        invoke_with_ident!{$crate mixed proc_macro_item}
+        with_crate!{$crate mixed proc_macro_item}
+    }}
+    test!();
+};
+
+// Failed resolutions of `proc_macro_item`
+const _: () = {
+    // token_site_span::proc_macro_item
+    invoke_with_crate!{input proc_macro_item}            //~ ERROR unresolved import `$crate`
+    invoke_with_ident!{input proc_macro_item}            //~ ERROR unresolved import `$crate`
+    invoke_with_crate!{call proc_macro_item}             //~ ERROR unresolved import `$crate`
+    invoke_with_ident!{call proc_macro_item}             //~ ERROR unresolved import `$crate`
+    invoke_with_ident!{hello call proc_macro_item}       //~ ERROR unresolved import `$crate`
+
+    // crate::proc_macro_item
+    invoke_with_ident!{krate input proc_macro_item}      //~ ERROR unresolved import `$crate::proc_macro_item`
+    with_crate!{krate input proc_macro_item}             //~ ERROR unresolved import `$crate::proc_macro_item`
+    with_crate!{krate call proc_macro_item}              //~ ERROR unresolved import `$crate`
+
+    macro_rules! test {() => {
+        // crate::proc_macro_item
+        invoke_with_ident!{$crate input proc_macro_item} //~ ERROR unresolved import `$crate`
+        with_crate!{$crate input proc_macro_item}        //~ ERROR unresolved import `$crate`
+        with_crate!{$crate call proc_macro_item}         //~ ERROR unresolved import `$crate`
+
+        // token_site_span::proc_macro_item
+        invoke_with_ident!{$crate call proc_macro_item}  //~ ERROR unresolved import `$crate`
+    }}
+    test!();
+};
+
+// Successful resolutions of `token_site_span::TokenItem`
+const _: () = {
+    invoke_with_crate!{input TokenItem}
+    invoke_with_ident!{input TokenItem}
+    invoke_with_crate!{call TokenItem}
+    invoke_with_ident!{call TokenItem}
+    invoke_with_ident!{hello call TokenItem}
+
+    macro_rules! test {() => {
+        invoke_with_ident!{$crate call TokenItem}
+    }}
+    test!();
+};
+
+// Failed resolutions of `TokenItem`
+const _: () = {
+    // crate::TokenItem
+    invoke_with_ident!{krate input TokenItem}       //~ ERROR unresolved import `$crate::TokenItem`
+    with_crate!{krate input TokenItem}              //~ ERROR unresolved import `$crate::TokenItem`
+    with_crate!{krate call TokenItem}               //~ ERROR unresolved import `$crate`
+
+    // mixed_site_span::TokenItem
+    invoke_with_crate!{mixed TokenItem}             //~ ERROR unresolved import `$crate`
+    invoke_with_ident!{mixed TokenItem}             //~ ERROR unresolved import `$crate`
+    invoke_with_ident!{krate mixed TokenItem}       //~ ERROR unresolved import `$crate`
+    with_crate!{krate mixed TokenItem}              //~ ERROR unresolved import `$crate`
+
+    macro_rules! test {() => {
+        // crate::TokenItem
+        invoke_with_ident!{$crate input TokenItem}  //~ ERROR unresolved import `$crate`
+        with_crate!{$crate input TokenItem}         //~ ERROR unresolved import `$crate`
+        with_crate!{$crate call TokenItem}          //~ ERROR unresolved import `$crate`
+
+        // mixed_site_span::TokenItem
+        invoke_with_ident!{$crate mixed TokenItem}  //~ ERROR unresolved import `$crate`
+        with_crate!{$crate mixed TokenItem}         //~ ERROR unresolved import `$crate`
+
+    }}
+    test!();
+};
+
+
+// Successful resolutions of `crate::ItemUse`
+const _: () = {
+    invoke_with_ident!{krate input ItemUse}
+    with_crate!{krate input ItemUse}
+    with_crate!{krate call ItemUse}
+
+    macro_rules! test {() => {
+        invoke_with_ident!{$crate input ItemUse}
+        with_crate!{$crate input ItemUse}
+        with_crate!{$crate call ItemUse}
+    }}
+    test!();
+};
+
+// Failed resolutions of `ItemUse`
+const _: () = {
+    // token_site_span::ItemUse
+    invoke_with_crate!{input ItemUse}            //~ ERROR unresolved import `$crate`
+    invoke_with_ident!{input ItemUse}            //~ ERROR unresolved import `$crate`
+
+    // mixed_site_span::ItemUse
+    invoke_with_crate!{mixed ItemUse}            //~ ERROR unresolved import `$crate`
+    invoke_with_ident!{mixed ItemUse}            //~ ERROR unresolved import `$crate`
+    invoke_with_ident!{krate mixed ItemUse}      //~ ERROR unresolved import `$crate`
+    with_crate!{krate mixed ItemUse}             //~ ERROR unresolved import `$crate`
+
+    invoke_with_crate!{call ItemUse}             //~ ERROR unresolved import `$crate`
+    invoke_with_ident!{call ItemUse}             //~ ERROR unresolved import `$crate`
+    invoke_with_ident!{hello call ItemUse}       //~ ERROR unresolved import `$crate`
+
+    macro_rules! test {() => {
+        invoke_with_ident!{$crate mixed ItemUse} //~ ERROR unresolved import `$crate`
+        with_crate!{$crate mixed ItemUse}        //~ ERROR unresolved import `$crate`
+
+        invoke_with_ident!{$crate call ItemUse}  //~ ERROR unresolved import `$crate`
+    }}
+    test!();
+};
+
+
+// Only mixed should see mixed_site_span::proc_macro_item
+use_input_crate!{proc_macro_item}   //~ ERROR unresolved import `$crate`
+use_input_krate!{proc_macro_item}   //~ ERROR unresolved import `$crate`
+use_mixed_crate!{proc_macro_item}
+use_mixed_krate!{proc_macro_item}
+use_call_crate!{proc_macro_item}    //~ ERROR unresolved import `$crate`
+use_call_krate!{proc_macro_item}    //~ ERROR unresolved import `$crate`
+
+// Only mixed should fail to see token_site_span::TokenItem
+use_input_crate!{TokenItem}
+use_input_krate!{TokenItem}
+use_mixed_crate!{TokenItem}         //~ ERROR unresolved import `$crate`
+use_mixed_krate!{TokenItem}         //~ ERROR unresolved import `$crate`
+use_call_crate!{TokenItem}
+use_call_krate!{TokenItem}
+
+// Everything should fail to see crate::ItemUse
+use_input_crate!{ItemUse}           //~ ERROR unresolved import `$crate`
+use_input_krate!{ItemUse}           //~ ERROR unresolved import `$crate`
+use_mixed_crate!{ItemUse}           //~ ERROR unresolved import `$crate`
+use_mixed_krate!{ItemUse}           //~ ERROR unresolved import `$crate`
+use_call_crate!{ItemUse}            //~ ERROR unresolved import `$crate`
+use_call_krate!{ItemUse}            //~ ERROR unresolved import `$crate`
diff --git a/tests/ui/proc-macro/mixed-site-span.stderr b/tests/ui/proc-macro/mixed-site-span.stderr
index 13786080124..d62031a853c 100644
--- a/tests/ui/proc-macro/mixed-site-span.stderr
+++ b/tests/ui/proc-macro/mixed-site-span.stderr
@@ -1,13 +1,595 @@
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:47:5
+   |
+LL |     invoke_with_crate!{input proc_macro_item}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
+   |
+   = note: this error originates in the macro `invoke_with_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:48:5
+   |
+LL |     invoke_with_ident!{input proc_macro_item}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
+   |
+   = note: this error originates in the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:49:5
+   |
+LL |     invoke_with_crate!{call proc_macro_item}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:50:5
+   |
+LL |     invoke_with_ident!{call proc_macro_item}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:51:5
+   |
+LL |     invoke_with_ident!{hello call proc_macro_item}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate::proc_macro_item`
+  --> $DIR/mixed-site-span.rs:54:5
+   |
+LL |     invoke_with_ident!{krate input proc_macro_item}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------^
+   |     |                              |
+   |     |                              help: a similar name exists in the module: `proc_macro_rules`
+   |     no `proc_macro_item` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate::proc_macro_item`
+  --> $DIR/mixed-site-span.rs:55:5
+   |
+LL |     with_crate!{krate input proc_macro_item}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^---------------^
+   |     |                       |
+   |     |                       help: a similar name exists in the module: `proc_macro_rules`
+   |     no `proc_macro_item` in the root
+   |
+   = note: this error originates in the macro `with_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:56:5
+   |
+LL |     with_crate!{krate call proc_macro_item}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^---------------^
+   |     |                      |
+   |     |                      help: a similar name exists in the module: `proc_macro_rules`
+   |     no `proc_macro_item` in the root
+   |
+   = note: this error originates in the macro `with_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:60:28
+   |
+LL |         invoke_with_ident!{$crate input proc_macro_item}
+   |                            ^^^^^^       --------------- help: a similar name exists in the module: `proc_macro_rules`
+   |                            |
+   |                            no `proc_macro_item` in the root
+...
+LL |     test!();
+   |     ------- in this macro invocation
+   |
+   = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:61:21
+   |
+LL |         with_crate!{$crate input proc_macro_item}
+   |                     ^^^^^^       --------------- help: a similar name exists in the module: `proc_macro_rules`
+   |                     |
+   |                     no `proc_macro_item` in the root
+...
+LL |     test!();
+   |     ------- in this macro invocation
+   |
+   = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:62:9
+   |
+LL |         with_crate!{$crate call proc_macro_item}
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^---------------^
+   |         |                       |
+   |         |                       help: a similar name exists in the module: `proc_macro_rules`
+   |         no `proc_macro_item` in the root
+...
+LL |     test!();
+   |     ------- in this macro invocation
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:67:5
+   |
+LL |     test!();
+   |     ^^^^^^^ no `proc_macro_item` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate::TokenItem`
+  --> $DIR/mixed-site-span.rs:87:5
+   |
+LL |     invoke_with_ident!{krate input TokenItem}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/mixed-site-span.rs:59:34
+   |
+LL |     quote!(use $krate::$ident as token_site_span::TokenItem as _;)
+   |                                  +++++++++++++++++++++++++++++
+
+error[E0432]: unresolved import `$crate::TokenItem`
+  --> $DIR/mixed-site-span.rs:88:5
+   |
+LL |     with_crate!{krate input TokenItem}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
+   |
+   = note: this error originates in the macro `with_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/mixed-site-span.rs:59:34
+   |
+LL |     quote!(use $krate::$ident as token_site_span::TokenItem as _;)
+   |                                  +++++++++++++++++++++++++++++
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:89:5
+   |
+LL |     with_crate!{krate call TokenItem}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
+   |
+   = note: this error originates in the macro `with_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+   |
+LL -     with_crate!{krate call TokenItem}
+LL +     token_site_span::TokenItem as _
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:92:5
+   |
+LL |     invoke_with_crate!{mixed TokenItem}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/token-site-span.rs:13:30
+   |
+LL -     ($s:ident $i:ident) => { with_crate!{$crate $s $i} };
+LL +     ($s:ident $i:ident) => { token_site_span::TokenItem as _ };
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:93:5
+   |
+LL |     invoke_with_ident!{mixed TokenItem}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/token-site-span.rs:18:30
+   |
+LL -     ($s:ident $i:ident) => { with_crate!{krate $s $i} };
+LL +     ($s:ident $i:ident) => { token_site_span::TokenItem as _ };
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:94:5
+   |
+LL |     invoke_with_ident!{krate mixed TokenItem}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/token-site-span.rs:19:39
+   |
+LL -     ($m:ident $s:ident $i:ident) => { with_crate!{$m $s $i} };
+LL +     ($m:ident $s:ident $i:ident) => { token_site_span::TokenItem as _ };
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:95:5
+   |
+LL |     with_crate!{krate mixed TokenItem}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
+   |
+   = note: this error originates in the macro `with_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+   |
+LL -     with_crate!{krate mixed TokenItem}
+LL +     token_site_span::TokenItem as _
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:99:28
+   |
+LL |         invoke_with_ident!{$crate input TokenItem}
+   |                            ^^^^^^ no `TokenItem` in the root
+...
+LL |     test!();
+   |     ------- in this macro invocation
+   |
+   = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+   |
+LL -         invoke_with_ident!{$crate input TokenItem}
+LL +         invoke_with_ident!{token_site_span::TokenItem as _ input TokenItem}
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:100:21
+   |
+LL |         with_crate!{$crate input TokenItem}
+   |                     ^^^^^^ no `TokenItem` in the root
+...
+LL |     test!();
+   |     ------- in this macro invocation
+   |
+   = note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+   |
+LL -         with_crate!{$crate input TokenItem}
+LL +         with_crate!{token_site_span::TokenItem as _ input TokenItem}
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:101:9
+   |
+LL |         with_crate!{$crate call TokenItem}
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
+...
+LL |     test!();
+   |     ------- in this macro invocation
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+   |
+LL -         with_crate!{$crate call TokenItem}
+LL +         token_site_span::TokenItem as _
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:108:5
+   |
+LL |     test!();
+   |     ^^^^^^^ no `TokenItem` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/token-site-span.rs:19:39
+   |
+LL -     ($m:ident $s:ident $i:ident) => { with_crate!{$m $s $i} };
+LL +     ($m:ident $s:ident $i:ident) => { token_site_span::TokenItem as _ };
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:105:9
+   |
+LL |         with_crate!{$crate mixed TokenItem}
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
+...
+LL |     test!();
+   |     ------- in this macro invocation
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+   |
+LL -         with_crate!{$crate mixed TokenItem}
+LL +         token_site_span::TokenItem as _
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:129:5
+   |
+LL |     invoke_with_crate!{input ItemUse}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
+   |
+   = note: this error originates in the macro `invoke_with_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/token-site-span.rs:13:42
+   |
+LL -     ($s:ident $i:ident) => { with_crate!{$crate $s $i} };
+LL +     ($s:ident $i:ident) => { with_crate!{ItemUse as _ $s $i} };
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:130:5
+   |
+LL |     invoke_with_ident!{input ItemUse}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
+   |
+   = note: this error originates in the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/token-site-span.rs:18:42
+   |
+LL -     ($s:ident $i:ident) => { with_crate!{krate $s $i} };
+LL +     ($s:ident $i:ident) => { with_crate!{ItemUse as _ $s $i} };
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:133:5
+   |
+LL |     invoke_with_crate!{mixed ItemUse}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/token-site-span.rs:13:30
+   |
+LL -     ($s:ident $i:ident) => { with_crate!{$crate $s $i} };
+LL +     ($s:ident $i:ident) => { ItemUse as _ };
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:134:5
+   |
+LL |     invoke_with_ident!{mixed ItemUse}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/token-site-span.rs:18:30
+   |
+LL -     ($s:ident $i:ident) => { with_crate!{krate $s $i} };
+LL +     ($s:ident $i:ident) => { ItemUse as _ };
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:135:5
+   |
+LL |     invoke_with_ident!{krate mixed ItemUse}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/token-site-span.rs:19:39
+   |
+LL -     ($m:ident $s:ident $i:ident) => { with_crate!{$m $s $i} };
+LL +     ($m:ident $s:ident $i:ident) => { ItemUse as _ };
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:136:5
+   |
+LL |     with_crate!{krate mixed ItemUse}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
+   |
+   = note: this error originates in the macro `with_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+   |
+LL -     with_crate!{krate mixed ItemUse}
+LL +     ItemUse as _
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:138:5
+   |
+LL |     invoke_with_crate!{call ItemUse}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/token-site-span.rs:13:30
+   |
+LL -     ($s:ident $i:ident) => { with_crate!{$crate $s $i} };
+LL +     ($s:ident $i:ident) => { ItemUse as _ };
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:139:5
+   |
+LL |     invoke_with_ident!{call ItemUse}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/token-site-span.rs:18:30
+   |
+LL -     ($s:ident $i:ident) => { with_crate!{krate $s $i} };
+LL +     ($s:ident $i:ident) => { ItemUse as _ };
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:140:5
+   |
+LL |     invoke_with_ident!{hello call ItemUse}
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `invoke_with_ident` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/token-site-span.rs:19:39
+   |
+LL -     ($m:ident $s:ident $i:ident) => { with_crate!{$m $s $i} };
+LL +     ($m:ident $s:ident $i:ident) => { ItemUse as _ };
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:148:5
+   |
+LL |     test!();
+   |     ^^^^^^^ no `ItemUse` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/token-site-span.rs:19:39
+   |
+LL -     ($m:ident $s:ident $i:ident) => { with_crate!{$m $s $i} };
+LL +     ($m:ident $s:ident $i:ident) => { ItemUse as _ };
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:144:9
+   |
+LL |         with_crate!{$crate mixed ItemUse}
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
+...
+LL |     test!();
+   |     ------- in this macro invocation
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+   |
+LL -         with_crate!{$crate mixed ItemUse}
+LL +         ItemUse as _
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:148:5
+   |
+LL |     test!();
+   |     ^^^^^^^ no `ItemUse` in the root
+   |
+   = note: this error originates in the macro `with_crate` which comes from the expansion of the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/token-site-span.rs:19:39
+   |
+LL -     ($m:ident $s:ident $i:ident) => { with_crate!{$m $s $i} };
+LL +     ($m:ident $s:ident $i:ident) => { ItemUse as _ };
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:153:1
+   |
+LL | use_input_crate!{proc_macro_item}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
+   |
+   = note: this error originates in the macro `use_input_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:154:1
+   |
+LL | use_input_krate!{proc_macro_item}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
+   |
+   = note: this error originates in the macro `use_input_krate` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:157:1
+   |
+LL | use_call_crate!{proc_macro_item}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
+   |
+   = note: this error originates in the macro `use_call_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:158:1
+   |
+LL | use_call_krate!{proc_macro_item}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `proc_macro_item` in the root
+   |
+   = note: this error originates in the macro `use_call_krate` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:163:1
+   |
+LL | use_mixed_crate!{TokenItem}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
+   |
+   = note: this error originates in the macro `use_mixed_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/token-site-span.rs:24:5
+   |
+LL -     declare_macro!{$crate mixed use_mixed_crate}
+LL +     token_site_span::TokenItem as _
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:164:1
+   |
+LL | use_mixed_krate!{TokenItem}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `TokenItem` in the root
+   |
+   = note: this error originates in the macro `use_mixed_krate` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct instead
+  --> $DIR/auxiliary/token-site-span.rs:29:1
+   |
+LL - declare_macro!{krate mixed use_mixed_krate}
+LL + token_site_span::TokenItem as _
+   |
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:169:1
+   |
+LL | use_input_crate!{ItemUse}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
+   |
+   = note: this error originates in the macro `use_input_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:170:1
+   |
+LL | use_input_krate!{ItemUse}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
+   |
+   = note: this error originates in the macro `use_input_krate` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:171:1
+   |
+LL | use_mixed_crate!{ItemUse}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
+   |
+   = note: this error originates in the macro `use_mixed_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:172:1
+   |
+LL | use_mixed_krate!{ItemUse}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
+   |
+   = note: this error originates in the macro `use_mixed_krate` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:173:1
+   |
+LL | use_call_crate!{ItemUse}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
+   |
+   = note: this error originates in the macro `use_call_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error[E0432]: unresolved import `$crate`
+  --> $DIR/mixed-site-span.rs:174:1
+   |
+LL | use_call_krate!{ItemUse}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^ no `ItemUse` in the root
+   |
+   = note: this error originates in the macro `use_call_krate` (in Nightly builds, run with -Z macro-backtrace for more info)
+
 error[E0426]: use of undeclared label `'label_use`
-  --> $DIR/mixed-site-span.rs:13:9
+  --> $DIR/mixed-site-span.rs:21:9
    |
 LL |         proc_macro_rules!();
    |         ^^^^^^^^^^^^^^^^^^^ undeclared label `'label_use`
    |
    = note: this error originates in the macro `proc_macro_rules` (in Nightly builds, run with -Z macro-backtrace for more info)
 
+error[E0412]: cannot find type `ItemUse` in crate `$crate`
+  --> $DIR/mixed-site-span.rs:21:9
+   |
+LL |         proc_macro_rules!();
+   |         ^^^^^^^^^^^^^^^^^^^ not found in `$crate`
+   |
+   = note: this error originates in the macro `proc_macro_rules` (in Nightly builds, run with -Z macro-backtrace for more info)
+help: consider importing this struct
+   |
+LL + use ItemUse;
+   |
+
 error[E0425]: cannot find value `local_use` in this scope
-  --> $DIR/mixed-site-span.rs:13:9
+  --> $DIR/mixed-site-span.rs:21:9
    |
 LL |         proc_macro_rules!();
    |         ^^^^^^^^^^^^^^^^^^^ help: a local variable with a similar name exists: `local_def`
@@ -15,20 +597,12 @@ LL |         proc_macro_rules!();
    = note: this error originates in the macro `proc_macro_rules` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0425]: cannot find value `local_def` in this scope
-  --> $DIR/mixed-site-span.rs:17:9
+  --> $DIR/mixed-site-span.rs:26:9
    |
 LL |         local_def;
    |         ^^^^^^^^^ help: a local variable with a similar name exists: `local_use`
 
-error[E0412]: cannot find type `ItemUse` in crate `$crate`
-  --> $DIR/mixed-site-span.rs:24:1
-   |
-LL | pass_dollar_crate!();
-   | ^^^^^^^^^^^^^^^^^^^^ not found in `$crate`
-   |
-   = note: this error originates in the macro `proc_macro_rules` which comes from the expansion of the macro `pass_dollar_crate` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: aborting due to 4 previous errors
+error: aborting due to 52 previous errors
 
-Some errors have detailed explanations: E0412, E0425, E0426.
+Some errors have detailed explanations: E0412, E0425, E0426, E0432.
 For more information about an error, try `rustc --explain E0412`.
diff --git a/tests/ui/partialeq_help.rs b/tests/ui/traits/partialeq-ref-mismatch-diagnostic.rs
index 34b88b8a866..26ef8050b87 100644
--- a/tests/ui/partialeq_help.rs
+++ b/tests/ui/traits/partialeq-ref-mismatch-diagnostic.rs
@@ -1,8 +1,10 @@
+//! Check diagnostic messages for `PartialEq` trait bound mismatches between `&T` and `T`.
+
 fn foo<T: PartialEq>(a: &T, b: T) {
     a == b; //~ ERROR E0277
 }
 
-fn foo2<T: PartialEq>(a: &T, b: T) where {
+fn foo2<T: PartialEq>(a: &T, b: T) {
     a == b; //~ ERROR E0277
 }
 
diff --git a/tests/ui/partialeq_help.stderr b/tests/ui/traits/partialeq-ref-mismatch-diagnostic.stderr
index f5de1308e87..4cbd31656dc 100644
--- a/tests/ui/partialeq_help.stderr
+++ b/tests/ui/traits/partialeq-ref-mismatch-diagnostic.stderr
@@ -1,5 +1,5 @@
 error[E0277]: can't compare `&T` with `T`
-  --> $DIR/partialeq_help.rs:2:7
+  --> $DIR/partialeq-ref-mismatch-diagnostic.rs:4:7
    |
 LL |     a == b;
    |       ^^ no implementation for `&T == T`
@@ -15,7 +15,7 @@ LL | fn foo<T: PartialEq>(a: &T, b: T) where &T: PartialEq<T> {
    |                                   ++++++++++++++++++++++
 
 error[E0277]: can't compare `&T` with `T`
-  --> $DIR/partialeq_help.rs:6:7
+  --> $DIR/partialeq-ref-mismatch-diagnostic.rs:8:7
    |
 LL |     a == b;
    |       ^^ no implementation for `&T == T`
@@ -25,10 +25,10 @@ help: consider dereferencing here
    |
 LL |     *a == b;
    |     +
-help: consider extending the `where` clause, but there might be an alternative better way to express this requirement
+help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
    |
 LL | fn foo2<T: PartialEq>(a: &T, b: T) where &T: PartialEq<T> {
-   |                                          ++++++++++++++++
+   |                                    ++++++++++++++++++++++
 
 error: aborting due to 2 previous errors