about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-08-29 16:21:11 +0000
committerbors <bors@rust-lang.org>2025-08-29 16:21:11 +0000
commitfe55364329579d361b1ab565728bc033a7dba07e (patch)
treea2dc4bbf41193de24388655ac6751d11b5876e10
parentdb3fd4708c3916bbc59b81ff7d3f6e19d11820c7 (diff)
parent197cb260e40aeae1f7569bc008a0aa3e11a12484 (diff)
downloadrust-fe55364329579d361b1ab565728bc033a7dba07e.tar.gz
rust-fe55364329579d361b1ab565728bc033a7dba07e.zip
Auto merge of #145997 - matthiaskrgr:rollup-tsgylre, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#145675 (Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [rust-lang/rust#1 of Batch rust-lang/rust#2])
 - rust-lang/rust#145676 (Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [rust-lang/rust#2 of Batch rust-lang/rust#2])
 - rust-lang/rust#145982 (compiletest: Reduce the number of `println!` calls that don't have access to `TestCx`)
 - rust-lang/rust#145984 (`TokenStream` cleanups)

r? `@ghost`
`@rustbot` modify labels: rollup
-rw-r--r--compiler/rustc_ast/src/tokenstream.rs141
-rw-r--r--src/tools/compiletest/src/bin/main.rs3
-rw-r--r--src/tools/compiletest/src/lib.rs49
-rw-r--r--src/tools/compiletest/src/runtest.rs35
-rw-r--r--src/tools/compiletest/src/runtest/compute_diff.rs (renamed from src/tools/compiletest/src/compute_diff.rs)0
-rw-r--r--src/tools/compiletest/src/runtest/debuginfo.rs3
-rw-r--r--src/tools/compiletest/src/runtest/mir_opt.rs2
-rw-r--r--src/tools/compiletest/src/runtest/pretty.rs10
-rw-r--r--src/tools/compiletest/src/util.rs11
-rw-r--r--tests/ui/array-slice-vec/fixed-length-vector-pattern-matching-7784.rs (renamed from tests/ui/array-slice-vec/pattern-matching-fixed-length-vectors-7784.rs)0
-rw-r--r--tests/ui/array-slice-vec/vector-slice-matching-8498.rs (renamed from tests/ui/array-slice-vec/matching-on-vector-slice-option-8498.rs)0
-rw-r--r--tests/ui/binding/match-with-at-binding-8391.rs (renamed from tests/ui/pattern/match-with-at-binding-8391.rs)0
-rw-r--r--tests/ui/binding/method-call-nonsensical-pattern-binding-7092.rs (renamed from tests/ui/issues/issue-7092.rs)1
-rw-r--r--tests/ui/binding/method-call-nonsensical-pattern-binding-7092.stderr (renamed from tests/ui/issues/issue-7092.stderr)2
-rw-r--r--tests/ui/binding/ref-pattern-drop-behavior-8860.rs (renamed from tests/ui/pattern/ref-in-function-parameter-patterns-8860.rs)0
-rw-r--r--tests/ui/binop/struct-field-generic-type-binary-assignment-error-6738.rs (renamed from tests/ui/issues/issue-6738.rs)1
-rw-r--r--tests/ui/binop/struct-field-generic-type-binary-assignment-error-6738.stderr (renamed from tests/ui/issues/issue-6738.stderr)2
-rw-r--r--tests/ui/borrowck/auxiliary/aux-5518.rs (renamed from tests/ui/issues/auxiliary/issue-5518.rs)0
-rw-r--r--tests/ui/borrowck/borrowed-pointer-in-struct-5884.rs (renamed from tests/ui/issues/issue-5884.rs)1
-rw-r--r--tests/ui/borrowck/incorrect-loan-error-on-local-update-5550.rs (renamed from tests/ui/issues/issue-5550.rs)1
-rw-r--r--tests/ui/borrowck/struct-with-reference-to-trait-5708.rs (renamed from tests/ui/issues/issue-5708.rs)3
-rw-r--r--tests/ui/borrowck/trait-method-lifetime-substitution-5518.rs7
-rw-r--r--tests/ui/box/box-patterns-feature-usage-6557.rs (renamed from tests/ui/issues/issue-6557.rs)1
-rw-r--r--tests/ui/cast/associated-type-bounds-cast-54094.rs (renamed from tests/ui/issues/issue-54094.rs)1
-rw-r--r--tests/ui/cast/owned-struct-to-trait-cast-6318.rs (renamed from tests/ui/issues/issue-6318.rs)1
-rw-r--r--tests/ui/closures/closure-mut-argument-6153.rs (renamed from tests/ui/issues/issue-6153.rs)2
-rw-r--r--tests/ui/codegen/matrix-row-swap-54462.rs (renamed from tests/ui/issues/issue-54462-mutable-noalias-correctness.rs)1
-rw-r--r--tests/ui/codegen/static-array-comparison-7012.rs (renamed from tests/ui/issues/issue-7012.rs)1
-rw-r--r--tests/ui/coercion/coerce-mut-trait-object-8248.rs (renamed from tests/ui/coercion/mut-trait-coercion-8248.rs)0
-rw-r--r--tests/ui/coercion/coerce-mut-trait-object-8248.stderr (renamed from tests/ui/coercion/mut-trait-coercion-8248.stderr)2
-rw-r--r--tests/ui/collections/vecdeque-append-operation-54477.rs (renamed from tests/ui/issues/issue-54477-reduced-2.rs)1
-rw-r--r--tests/ui/cross-crate/auxiliary/aux-7178.rs (renamed from tests/ui/issues/auxiliary/issue-7178.rs)0
-rw-r--r--tests/ui/cross-crate/static-method-returning-self-with-generics-7178.rs9
-rw-r--r--tests/ui/cross-crate/static-with-cross-crate-regions-8259.rs (renamed from tests/ui/cross-crate/static-regions-in-cross-crate-8259.rs)0
-rw-r--r--tests/ui/cross-crate/tuple-struct-cross-crate-7899.rs10
-rw-r--r--tests/ui/enum/enum-referred-by-submodule-5900.rs (renamed from tests/ui/issues/issue-5900.rs)1
-rw-r--r--tests/ui/enum/enum-with-generic-parameter-5997.rs (renamed from tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997.rs)1
-rw-r--r--tests/ui/enum/match-either-enum-variants-6117.rs (renamed from tests/ui/issues/issue-6117.rs)1
-rw-r--r--tests/ui/function-pointer/function-pointer-comparison-54696.rs (renamed from tests/ui/issues/issue-54696.rs)1
-rw-r--r--tests/ui/generics/enum-definition-with-outer-generic-parameter-5997.rs (renamed from tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997-enum.rs)1
-rw-r--r--tests/ui/generics/enum-definition-with-outer-generic-parameter-5997.stderr (renamed from tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997-enum.stderr)2
-rw-r--r--tests/ui/issues/issue-54410.rs8
-rw-r--r--tests/ui/issues/issue-54410.stderr12
-rw-r--r--tests/ui/issues/issue-5518.rs7
-rw-r--r--tests/ui/issues/issue-5844.rs7
-rw-r--r--tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997-struct.rs10
-rw-r--r--tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997-struct.stderr13
-rw-r--r--tests/ui/issues/issue-6344-match.rs18
-rw-r--r--tests/ui/issues/issue-7178.rs9
-rw-r--r--tests/ui/lifetimes/dyn-trait-function-pointer-53419.rs (renamed from tests/ui/issues/issue-53419.rs)1
-rw-r--r--tests/ui/lifetimes/static-bound-fulfillment-with-pointer-7268.rs (renamed from tests/ui/issues/issue-7268.rs)1
-rw-r--r--tests/ui/loops/unreachable-while-loop-5741.rs (renamed from tests/ui/issues/issue-5741.rs)1
-rw-r--r--tests/ui/macros/macro-variable-declaration-with-bounds-5554.rs (renamed from tests/ui/issues/issue-5554.rs)2
-rw-r--r--tests/ui/macros/macro-variable-unused-reporting-5718.rs (renamed from tests/ui/issues/issue-5718.rs)1
-rw-r--r--tests/ui/match/mismatched-types-in-match-5358.rs (renamed from tests/ui/issues/issue-5358-1.rs)9
-rw-r--r--tests/ui/match/mismatched-types-in-match-5358.stderr (renamed from tests/ui/issues/issue-5358-1.stderr)3
-rw-r--r--tests/ui/match/mismatched-types-in-match-7867.rs (renamed from tests/ui/match/mismatched-types-in-match-pattern-7867.rs)0
-rw-r--r--tests/ui/match/mismatched-types-in-match-7867.stderr (renamed from tests/ui/match/mismatched-types-in-match-pattern-7867.stderr)2
-rw-r--r--tests/ui/methods/trait-method-resolution-7575.rs (renamed from tests/ui/methods/trait-method-self-param-error-7575.rs)0
-rw-r--r--tests/ui/methods/trait-method-resolution-7575.stderr (renamed from tests/ui/methods/trait-method-self-param-error-7575.stderr)2
-rw-r--r--tests/ui/modules/pub-use-module-alias-5950.rs (renamed from tests/ui/issues/issue-5950.rs)2
-rw-r--r--tests/ui/modules/use-statement-duplicate-check-7663.rs (renamed from tests/ui/resolve/module-import-resolution-7663.rs)0
-rw-r--r--tests/ui/numeric/type-limit-comparisons-6130.rs (renamed from tests/ui/issues/issue-6130.rs)1
-rw-r--r--tests/ui/parser/partial-eq-trait-bound-5572.rs (renamed from tests/ui/issues/issue-5572.rs)1
-rw-r--r--tests/ui/privacy/auxiliary/iss-6919.rs (renamed from tests/ui/issues/auxiliary/iss.rs)0
-rw-r--r--tests/ui/privacy/deref-separate-compile-unit-6919.rs (renamed from tests/ui/issues/issue-6919.rs)4
-rw-r--r--tests/ui/privacy/pub-restricted-path-usage-55376.rs (renamed from tests/ui/issues/issue-55376.rs)1
-rw-r--r--tests/ui/repr/packed-struct-with-enum-53728.rs (renamed from tests/ui/issues/issue-53728.rs)1
-rw-r--r--tests/ui/resolve/duplicate-name-in-module-6936.rs (renamed from tests/ui/issues/issue-6936.rs)2
-rw-r--r--tests/ui/resolve/duplicate-name-in-module-6936.stderr (renamed from tests/ui/issues/issue-6936.stderr)8
-rw-r--r--tests/ui/resolve/unit-like-struct-masks-constant-7044.rs (renamed from tests/ui/issues/issue-7044.rs)1
-rw-r--r--tests/ui/resolve/unit-like-struct-masks-constant-7044.stderr (renamed from tests/ui/issues/issue-7044.stderr)2
-rw-r--r--tests/ui/specialization/trait-specialization-default-methods-55380.rs (renamed from tests/ui/issues/issue-55380.rs)1
-rw-r--r--tests/ui/specialization/trait-specialization-default-methods-55380.stderr (renamed from tests/ui/issues/issue-55380.stderr)2
-rw-r--r--tests/ui/static/global-variable-promotion-error-7364.rs (renamed from tests/ui/issues/issue-7364.rs)1
-rw-r--r--tests/ui/static/global-variable-promotion-error-7364.stderr (renamed from tests/ui/issues/issue-7364.stderr)4
-rw-r--r--tests/ui/static/static-list-initialization-5917.rs (renamed from tests/ui/issues/issue-5917.rs)1
-rw-r--r--tests/ui/static/static-struct-initialization-5688.rs (renamed from tests/ui/issues/issue-5688.rs)1
-rw-r--r--tests/ui/structs/auxiliary/aux-8044.rs (renamed from tests/ui/structs-enums/auxiliary/aux-8044.rs)0
-rw-r--r--tests/ui/structs/btree-struct-usage-8044.rs (renamed from tests/ui/structs-enums/struct-and-enum-usage-8044.rs)0
-rw-r--r--tests/ui/structs/destructuring-struct-with-dtor-6344.rs (renamed from tests/ui/issues/issue-6344-let.rs)1
-rw-r--r--tests/ui/structs/nonexistent-struct-field-error-5439.rs (renamed from tests/ui/issues/issue-5439.rs)1
-rw-r--r--tests/ui/structs/nonexistent-struct-field-error-5439.stderr (renamed from tests/ui/issues/issue-5439.stderr)2
-rw-r--r--tests/ui/traits/dynamic-dispatch-trait-objects-5666.rs (renamed from tests/ui/issues/issue-5666.rs)2
-rw-r--r--tests/ui/traits/nll-ice-custom-type-ops-53568.rs (renamed from tests/ui/issues/issue-53568.rs)1
-rw-r--r--tests/ui/traits/opaque-trait-size-error-5883.rs (renamed from tests/ui/issues/issue-5883.rs)1
-rw-r--r--tests/ui/traits/opaque-trait-size-error-5883.stderr (renamed from tests/ui/issues/issue-5883.stderr)6
-rw-r--r--tests/ui/traits/self-not-send-in-default-method-8171.rs (renamed from tests/ui/traits/self-implements-kinds-in-default-methods-8171.rs)0
-rw-r--r--tests/ui/traits/trait-implementation-generic-access-6898.rs (renamed from tests/ui/issues/issue-6898.rs)1
-rw-r--r--tests/ui/traits/trait-implementation-restriction-5988.rs (renamed from tests/ui/issues/issue-5988.rs)1
-rw-r--r--tests/ui/traits/trait-object-lifetime-bounds-7563.rs (renamed from tests/ui/traits/trait-implementation-and-usage-7563.rs)0
-rw-r--r--tests/ui/unreachable-code/boolean-negation-in-unreachable-code-7344.rs (renamed from tests/ui/issues/issue-7344.rs)1
-rw-r--r--tests/ui/unsafe/auxiliary/aux-5844.rs (renamed from tests/ui/issues/auxiliary/issue-5844-aux.rs)0
-rw-r--r--tests/ui/unsafe/extern-function-requires-unsafe-5844.rs8
-rw-r--r--tests/ui/unsafe/extern-function-requires-unsafe-5844.stderr (renamed from tests/ui/issues/issue-5844.stderr)6
95 files changed, 202 insertions, 276 deletions
diff --git a/compiler/rustc_ast/src/tokenstream.rs b/compiler/rustc_ast/src/tokenstream.rs
index f4f35a4d2ee..a5d8fbfac61 100644
--- a/compiler/rustc_ast/src/tokenstream.rs
+++ b/compiler/rustc_ast/src/tokenstream.rs
@@ -3,15 +3,6 @@
 //! `TokenStream`s represent syntactic objects before they are converted into ASTs.
 //! A `TokenStream` is, roughly speaking, a sequence of [`TokenTree`]s,
 //! which are themselves a single [`Token`] or a `Delimited` subsequence of tokens.
-//!
-//! ## Ownership
-//!
-//! `TokenStream`s are persistent data structures constructed as ropes with reference
-//! counted-children. In general, this means that calling an operation on a `TokenStream`
-//! (such as `slice`) produces an entirely new `TokenStream` from the borrowed reference to
-//! the original. This essentially coerces `TokenStream`s into "views" of their subparts,
-//! and a borrowed `TokenStream` is sufficient to build an owned `TokenStream` without taking
-//! ownership of the original.
 
 use std::borrow::Cow;
 use std::ops::Range;
@@ -99,17 +90,6 @@ impl TokenTree {
     }
 }
 
-impl<CTX> HashStable<CTX> for TokenStream
-where
-    CTX: crate::HashStableContext,
-{
-    fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
-        for sub_tt in self.iter() {
-            sub_tt.hash_stable(hcx, hasher);
-        }
-    }
-}
-
 /// A lazy version of [`AttrTokenStream`], which defers creation of an actual
 /// `AttrTokenStream` until it is needed.
 #[derive(Clone)]
@@ -556,10 +536,6 @@ pub struct AttrsTarget {
     pub tokens: LazyAttrTokenStream,
 }
 
-/// A `TokenStream` is an abstract sequence of tokens, organized into [`TokenTree`]s.
-#[derive(Clone, Debug, Default, Encodable, Decodable)]
-pub struct TokenStream(pub(crate) Arc<Vec<TokenTree>>);
-
 /// Indicates whether a token can join with the following token to form a
 /// compound token. Used for conversions to `proc_macro::Spacing`. Also used to
 /// guide pretty-printing, which is where the `JointHidden` value (which isn't
@@ -620,58 +596,9 @@ pub enum Spacing {
     JointHidden,
 }
 
-impl TokenStream {
-    /// Given a `TokenStream` with a `Stream` of only two arguments, return a new `TokenStream`
-    /// separating the two arguments with a comma for diagnostic suggestions.
-    pub fn add_comma(&self) -> Option<(TokenStream, Span)> {
-        // Used to suggest if a user writes `foo!(a b);`
-        let mut suggestion = None;
-        let mut iter = self.0.iter().enumerate().peekable();
-        while let Some((pos, ts)) = iter.next() {
-            if let Some((_, next)) = iter.peek() {
-                let sp = match (&ts, &next) {
-                    (_, TokenTree::Token(Token { kind: token::Comma, .. }, _)) => continue,
-                    (
-                        TokenTree::Token(token_left, Spacing::Alone),
-                        TokenTree::Token(token_right, _),
-                    ) if (token_left.is_non_reserved_ident() || token_left.is_lit())
-                        && (token_right.is_non_reserved_ident() || token_right.is_lit()) =>
-                    {
-                        token_left.span
-                    }
-                    (TokenTree::Delimited(sp, ..), _) => sp.entire(),
-                    _ => continue,
-                };
-                let sp = sp.shrink_to_hi();
-                let comma = TokenTree::token_alone(token::Comma, sp);
-                suggestion = Some((pos, comma, sp));
-            }
-        }
-        if let Some((pos, comma, sp)) = suggestion {
-            let mut new_stream = Vec::with_capacity(self.0.len() + 1);
-            let parts = self.0.split_at(pos + 1);
-            new_stream.extend_from_slice(parts.0);
-            new_stream.push(comma);
-            new_stream.extend_from_slice(parts.1);
-            return Some((TokenStream::new(new_stream), sp));
-        }
-        None
-    }
-}
-
-impl FromIterator<TokenTree> for TokenStream {
-    fn from_iter<I: IntoIterator<Item = TokenTree>>(iter: I) -> Self {
-        TokenStream::new(iter.into_iter().collect::<Vec<TokenTree>>())
-    }
-}
-
-impl Eq for TokenStream {}
-
-impl PartialEq<TokenStream> for TokenStream {
-    fn eq(&self, other: &TokenStream) -> bool {
-        self.iter().eq(other.iter())
-    }
-}
+/// A `TokenStream` is an abstract sequence of tokens, organized into [`TokenTree`]s.
+#[derive(Clone, Debug, Default, Encodable, Decodable)]
+pub struct TokenStream(pub(crate) Arc<Vec<TokenTree>>);
 
 impl TokenStream {
     pub fn new(tts: Vec<TokenTree>) -> TokenStream {
@@ -847,6 +774,68 @@ impl TokenStream {
             }
         }
     }
+
+    /// Given a `TokenStream` with a `Stream` of only two arguments, return a new `TokenStream`
+    /// separating the two arguments with a comma for diagnostic suggestions.
+    pub fn add_comma(&self) -> Option<(TokenStream, Span)> {
+        // Used to suggest if a user writes `foo!(a b);`
+        let mut suggestion = None;
+        let mut iter = self.0.iter().enumerate().peekable();
+        while let Some((pos, ts)) = iter.next() {
+            if let Some((_, next)) = iter.peek() {
+                let sp = match (&ts, &next) {
+                    (_, TokenTree::Token(Token { kind: token::Comma, .. }, _)) => continue,
+                    (
+                        TokenTree::Token(token_left, Spacing::Alone),
+                        TokenTree::Token(token_right, _),
+                    ) if (token_left.is_non_reserved_ident() || token_left.is_lit())
+                        && (token_right.is_non_reserved_ident() || token_right.is_lit()) =>
+                    {
+                        token_left.span
+                    }
+                    (TokenTree::Delimited(sp, ..), _) => sp.entire(),
+                    _ => continue,
+                };
+                let sp = sp.shrink_to_hi();
+                let comma = TokenTree::token_alone(token::Comma, sp);
+                suggestion = Some((pos, comma, sp));
+            }
+        }
+        if let Some((pos, comma, sp)) = suggestion {
+            let mut new_stream = Vec::with_capacity(self.0.len() + 1);
+            let parts = self.0.split_at(pos + 1);
+            new_stream.extend_from_slice(parts.0);
+            new_stream.push(comma);
+            new_stream.extend_from_slice(parts.1);
+            return Some((TokenStream::new(new_stream), sp));
+        }
+        None
+    }
+}
+
+impl PartialEq<TokenStream> for TokenStream {
+    fn eq(&self, other: &TokenStream) -> bool {
+        self.iter().eq(other.iter())
+    }
+}
+
+impl Eq for TokenStream {}
+
+impl FromIterator<TokenTree> for TokenStream {
+    fn from_iter<I: IntoIterator<Item = TokenTree>>(iter: I) -> Self {
+        TokenStream::new(iter.into_iter().collect::<Vec<TokenTree>>())
+    }
+}
+
+impl<CTX> HashStable<CTX> for TokenStream
+where
+    CTX: crate::HashStableContext,
+{
+    fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {
+        for sub_tt in self.iter() {
+            sub_tt.hash_stable(hcx, hasher);
+        }
+    }
 }
 
 #[derive(Clone)]
diff --git a/src/tools/compiletest/src/bin/main.rs b/src/tools/compiletest/src/bin/main.rs
index 1f777e71cf9..8fac6ccdc58 100644
--- a/src/tools/compiletest/src/bin/main.rs
+++ b/src/tools/compiletest/src/bin/main.rs
@@ -2,7 +2,7 @@ use std::env;
 use std::io::IsTerminal;
 use std::sync::Arc;
 
-use compiletest::{early_config_check, log_config, parse_config, run_tests};
+use compiletest::{early_config_check, parse_config, run_tests};
 
 fn main() {
     tracing_subscriber::fmt::init();
@@ -19,6 +19,5 @@ fn main() {
 
     early_config_check(&config);
 
-    log_config(&config);
     run_tests(config);
 }
diff --git a/src/tools/compiletest/src/lib.rs b/src/tools/compiletest/src/lib.rs
index 58f7c6b5071..8737fec80bb 100644
--- a/src/tools/compiletest/src/lib.rs
+++ b/src/tools/compiletest/src/lib.rs
@@ -9,7 +9,6 @@
 mod tests;
 
 pub mod common;
-pub mod compute_diff;
 mod debuggers;
 pub mod diagnostics;
 pub mod directives;
@@ -44,7 +43,6 @@ use crate::common::{
 };
 use crate::directives::DirectivesCache;
 use crate::executor::{CollectedTest, ColorConfig};
-use crate::util::logv;
 
 /// Creates the `Config` instance for this invocation of compiletest.
 ///
@@ -477,51 +475,6 @@ pub fn parse_config(args: Vec<String>) -> Config {
     }
 }
 
-pub fn log_config(config: &Config) {
-    let c = config;
-    logv(c, "configuration:".to_string());
-    logv(c, format!("compile_lib_path: {}", config.compile_lib_path));
-    logv(c, format!("run_lib_path: {}", config.run_lib_path));
-    logv(c, format!("rustc_path: {}", config.rustc_path));
-    logv(c, format!("cargo_path: {:?}", config.cargo_path));
-    logv(c, format!("rustdoc_path: {:?}", config.rustdoc_path));
-
-    logv(c, format!("src_root: {}", config.src_root));
-    logv(c, format!("src_test_suite_root: {}", config.src_test_suite_root));
-
-    logv(c, format!("build_root: {}", config.build_root));
-    logv(c, format!("build_test_suite_root: {}", config.build_test_suite_root));
-
-    logv(c, format!("sysroot_base: {}", config.sysroot_base));
-
-    logv(c, format!("stage: {}", config.stage));
-    logv(c, format!("stage_id: {}", config.stage_id));
-    logv(c, format!("mode: {}", config.mode));
-    logv(c, format!("run_ignored: {}", config.run_ignored));
-    logv(c, format!("filters: {:?}", config.filters));
-    logv(c, format!("skip: {:?}", config.skip));
-    logv(c, format!("filter_exact: {}", config.filter_exact));
-    logv(
-        c,
-        format!("force_pass_mode: {}", opt_str(&config.force_pass_mode.map(|m| format!("{}", m))),),
-    );
-    logv(c, format!("runner: {}", opt_str(&config.runner)));
-    logv(c, format!("host-rustcflags: {:?}", config.host_rustcflags));
-    logv(c, format!("target-rustcflags: {:?}", config.target_rustcflags));
-    logv(c, format!("target: {}", config.target));
-    logv(c, format!("host: {}", config.host));
-    logv(c, format!("android-cross-path: {}", config.android_cross_path));
-    logv(c, format!("adb_path: {}", config.adb_path));
-    logv(c, format!("adb_test_dir: {}", config.adb_test_dir));
-    logv(c, format!("adb_device_status: {}", config.adb_device_status));
-    logv(c, format!("ar: {}", config.ar));
-    logv(c, format!("target-linker: {:?}", config.target_linker));
-    logv(c, format!("host-linker: {:?}", config.host_linker));
-    logv(c, format!("verbose: {}", config.verbose));
-    logv(c, format!("minicore_path: {}", config.minicore_path));
-    logv(c, "\n".to_string());
-}
-
 pub fn opt_str(maybestr: &Option<String>) -> &str {
     match *maybestr {
         None => "(none)",
@@ -538,6 +491,8 @@ pub fn opt_str2(maybestr: Option<String>) -> String {
 
 /// Called by `main` after the config has been parsed.
 pub fn run_tests(config: Arc<Config>) {
+    debug!(?config, "run_tests");
+
     // If we want to collect rustfix coverage information,
     // we first make sure that the coverage file does not exist.
     // It will be created later on.
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs
index 3a05b242519..867624cc8fa 100644
--- a/src/tools/compiletest/src/runtest.rs
+++ b/src/tools/compiletest/src/runtest.rs
@@ -7,7 +7,7 @@ use std::io::prelude::*;
 use std::io::{self, BufReader};
 use std::process::{Child, Command, ExitStatus, Output, Stdio};
 use std::sync::Arc;
-use std::{env, iter, str};
+use std::{env, fmt, iter, str};
 
 use build_helper::fs::remove_and_create_dir_all;
 use camino::{Utf8Path, Utf8PathBuf};
@@ -21,15 +21,13 @@ use crate::common::{
     UI_WINDOWS_SVG, expected_output_path, incremental_dir, output_base_dir, output_base_name,
     output_testname_unique,
 };
-use crate::compute_diff::{DiffLine, make_diff, write_diff, write_filtered_diff};
 use crate::directives::TestProps;
 use crate::errors::{Error, ErrorKind, load_errors};
 use crate::read2::{Truncated, read2_abbreviated};
-use crate::util::{Utf8PathBufExt, add_dylib_path, logv, static_regex};
+use crate::runtest::compute_diff::{DiffLine, make_diff, write_diff, write_filtered_diff};
+use crate::util::{Utf8PathBufExt, add_dylib_path, static_regex};
 use crate::{ColorConfig, help, json, stamp_file_path, warning};
 
-mod debugger;
-
 // Helper modules that implement test running logic for each test suite.
 // tidy-alphabetical-start
 mod assembly;
@@ -48,6 +46,8 @@ mod rustdoc_json;
 mod ui;
 // tidy-alphabetical-end
 
+mod compute_diff;
+mod debugger;
 #[cfg(test)]
 mod tests;
 
@@ -1459,7 +1459,7 @@ impl<'test> TestCx<'test> {
     ) -> ProcRes {
         let cmdline = {
             let cmdline = self.make_cmdline(&command, lib_path);
-            logv(self.config, format!("executing {}", cmdline));
+            self.logv(format_args!("executing {cmdline}"));
             cmdline
         };
 
@@ -2006,6 +2006,18 @@ impl<'test> TestCx<'test> {
         output_base_name(self.config, self.testpaths, self.safe_revision())
     }
 
+    /// Prints a message to (captured) stdout if `config.verbose` is true.
+    /// The message is also logged to `tracing::debug!` regardles of verbosity.
+    ///
+    /// Use `format_args!` as the argument to perform formatting if required.
+    fn logv(&self, message: impl fmt::Display) {
+        debug!("{message}");
+        if self.config.verbose {
+            // Note: `./x test ... --verbose --no-capture` is needed to see this print.
+            println!("{message}");
+        }
+    }
+
     /// Prefix to print before error messages. Normally just `error`, but also
     /// includes the revision name for tests that use revisions.
     #[must_use]
@@ -2666,8 +2678,8 @@ impl<'test> TestCx<'test> {
         //
         // It's not possible to detect paths in the error messages generally, but this is a
         // decent enough heuristic.
-        static_regex!(
-                r#"(?x)
+        let re = static_regex!(
+            r#"(?x)
                 (?:
                   # Match paths that don't include spaces.
                   (?:\\[\pL\pN\.\-_']+)+\.\pL+
@@ -2675,11 +2687,8 @@ impl<'test> TestCx<'test> {
                   # If the path starts with a well-known root, then allow spaces and no file extension.
                   \$(?:DIR|SRC_DIR|TEST_BUILD_DIR|BUILD_DIR|LIB_DIR)(?:\\[\pL\pN\.\-_'\ ]+)+
                 )"#
-            )
-            .replace_all(&output, |caps: &Captures<'_>| {
-                println!("{}", &caps[0]);
-                caps[0].replace(r"\", "/")
-            })
+        );
+        re.replace_all(&output, |caps: &Captures<'_>| caps[0].replace(r"\", "/"))
             .replace("\r\n", "\n")
     }
 
diff --git a/src/tools/compiletest/src/compute_diff.rs b/src/tools/compiletest/src/runtest/compute_diff.rs
index 509e7e11703..509e7e11703 100644
--- a/src/tools/compiletest/src/compute_diff.rs
+++ b/src/tools/compiletest/src/runtest/compute_diff.rs
diff --git a/src/tools/compiletest/src/runtest/debuginfo.rs b/src/tools/compiletest/src/runtest/debuginfo.rs
index 24fdbab3aec..88d022b8bba 100644
--- a/src/tools/compiletest/src/runtest/debuginfo.rs
+++ b/src/tools/compiletest/src/runtest/debuginfo.rs
@@ -10,7 +10,6 @@ use super::debugger::DebuggerCommands;
 use super::{Debugger, Emit, ProcRes, TestCx, Truncated, WillExecute};
 use crate::common::Config;
 use crate::debuggers::{extract_gdb_version, is_android_gdb_target};
-use crate::util::logv;
 
 impl TestCx<'_> {
     pub(super) fn run_debuginfo_test(&self) {
@@ -234,7 +233,7 @@ impl TestCx<'_> {
                 gdb.args(debugger_opts);
                 // FIXME(jieyouxu): don't pass an empty Path
                 let cmdline = self.make_cmdline(&gdb, Utf8Path::new(""));
-                logv(self.config, format!("executing {}", cmdline));
+                self.logv(format_args!("executing {cmdline}"));
                 cmdline
             };
 
diff --git a/src/tools/compiletest/src/runtest/mir_opt.rs b/src/tools/compiletest/src/runtest/mir_opt.rs
index efdb131bf14..55043bf4bc2 100644
--- a/src/tools/compiletest/src/runtest/mir_opt.rs
+++ b/src/tools/compiletest/src/runtest/mir_opt.rs
@@ -6,7 +6,7 @@ use miropt_test_tools::{MiroptTest, MiroptTestFile, files_for_miropt_test};
 use tracing::debug;
 
 use super::{Emit, TestCx, WillExecute};
-use crate::compute_diff::write_diff;
+use crate::runtest::compute_diff::write_diff;
 
 impl TestCx<'_> {
     pub(super) fn run_mir_opt_test(&self) {
diff --git a/src/tools/compiletest/src/runtest/pretty.rs b/src/tools/compiletest/src/runtest/pretty.rs
index e3b07f1d63d..26557727233 100644
--- a/src/tools/compiletest/src/runtest/pretty.rs
+++ b/src/tools/compiletest/src/runtest/pretty.rs
@@ -1,14 +1,13 @@
 use std::fs;
 
 use super::{ProcRes, ReadFrom, TestCx};
-use crate::util::logv;
 
 impl TestCx<'_> {
     pub(super) fn run_pretty_test(&self) {
         if self.props.pp_exact.is_some() {
-            logv(self.config, "testing for exact pretty-printing".to_owned());
+            self.logv("testing for exact pretty-printing");
         } else {
-            logv(self.config, "testing for converging pretty-printing".to_owned());
+            self.logv("testing for converging pretty-printing");
         }
 
         let rounds = match self.props.pp_exact {
@@ -21,10 +20,7 @@ impl TestCx<'_> {
 
         let mut round = 0;
         while round < rounds {
-            logv(
-                self.config,
-                format!("pretty-printing round {} revision {:?}", round, self.revision),
-            );
+            self.logv(format_args!("pretty-printing round {round} revision {:?}", self.revision));
             let read_from =
                 if round == 0 { ReadFrom::Path } else { ReadFrom::Stdin(srcs[round].to_owned()) };
 
diff --git a/src/tools/compiletest/src/util.rs b/src/tools/compiletest/src/util.rs
index fb047548c45..1f16a672a98 100644
--- a/src/tools/compiletest/src/util.rs
+++ b/src/tools/compiletest/src/util.rs
@@ -2,9 +2,6 @@ use std::env;
 use std::process::Command;
 
 use camino::{Utf8Path, Utf8PathBuf};
-use tracing::*;
-
-use crate::common::Config;
 
 #[cfg(test)]
 mod tests;
@@ -26,14 +23,6 @@ fn path_div() -> &'static str {
     ";"
 }
 
-pub fn logv(config: &Config, s: String) {
-    debug!("{}", s);
-    if config.verbose {
-        // Note: `./x test ... --verbose --no-capture` is needed to see this print.
-        println!("{}", s);
-    }
-}
-
 pub trait Utf8PathBufExt {
     /// Append an extension to the path, even if it already has one.
     fn with_extra_extension(&self, extension: &str) -> Utf8PathBuf;
diff --git a/tests/ui/array-slice-vec/pattern-matching-fixed-length-vectors-7784.rs b/tests/ui/array-slice-vec/fixed-length-vector-pattern-matching-7784.rs
index 7d987e92b63..7d987e92b63 100644
--- a/tests/ui/array-slice-vec/pattern-matching-fixed-length-vectors-7784.rs
+++ b/tests/ui/array-slice-vec/fixed-length-vector-pattern-matching-7784.rs
diff --git a/tests/ui/array-slice-vec/matching-on-vector-slice-option-8498.rs b/tests/ui/array-slice-vec/vector-slice-matching-8498.rs
index e243a247ed5..e243a247ed5 100644
--- a/tests/ui/array-slice-vec/matching-on-vector-slice-option-8498.rs
+++ b/tests/ui/array-slice-vec/vector-slice-matching-8498.rs
diff --git a/tests/ui/pattern/match-with-at-binding-8391.rs b/tests/ui/binding/match-with-at-binding-8391.rs
index bc4e7be7989..bc4e7be7989 100644
--- a/tests/ui/pattern/match-with-at-binding-8391.rs
+++ b/tests/ui/binding/match-with-at-binding-8391.rs
diff --git a/tests/ui/issues/issue-7092.rs b/tests/ui/binding/method-call-nonsensical-pattern-binding-7092.rs
index fab18bd7cf7..4cb04cdf5be 100644
--- a/tests/ui/issues/issue-7092.rs
+++ b/tests/ui/binding/method-call-nonsensical-pattern-binding-7092.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/7092
 enum Whatever {
 }
 
diff --git a/tests/ui/issues/issue-7092.stderr b/tests/ui/binding/method-call-nonsensical-pattern-binding-7092.stderr
index e2e57486746..1f8ff2d8df1 100644
--- a/tests/ui/issues/issue-7092.stderr
+++ b/tests/ui/binding/method-call-nonsensical-pattern-binding-7092.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-7092.rs:6:9
+  --> $DIR/method-call-nonsensical-pattern-binding-7092.rs:7:9
    |
 LL |     match x {
    |           - this expression has type `Whatever`
diff --git a/tests/ui/pattern/ref-in-function-parameter-patterns-8860.rs b/tests/ui/binding/ref-pattern-drop-behavior-8860.rs
index 1a67caf021c..1a67caf021c 100644
--- a/tests/ui/pattern/ref-in-function-parameter-patterns-8860.rs
+++ b/tests/ui/binding/ref-pattern-drop-behavior-8860.rs
diff --git a/tests/ui/issues/issue-6738.rs b/tests/ui/binop/struct-field-generic-type-binary-assignment-error-6738.rs
index a2f8dfe9c49..856caa2b297 100644
--- a/tests/ui/issues/issue-6738.rs
+++ b/tests/ui/binop/struct-field-generic-type-binary-assignment-error-6738.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/6738
 struct Foo<T> {
     x: T,
 }
diff --git a/tests/ui/issues/issue-6738.stderr b/tests/ui/binop/struct-field-generic-type-binary-assignment-error-6738.stderr
index f22d6a2e468..060d33079d3 100644
--- a/tests/ui/issues/issue-6738.stderr
+++ b/tests/ui/binop/struct-field-generic-type-binary-assignment-error-6738.stderr
@@ -1,5 +1,5 @@
 error[E0368]: binary assignment operation `+=` cannot be applied to type `T`
-  --> $DIR/issue-6738.rs:6:9
+  --> $DIR/struct-field-generic-type-binary-assignment-error-6738.rs:7:9
    |
 LL |         self.x += v.x;
    |         ------^^^^^^^
diff --git a/tests/ui/issues/auxiliary/issue-5518.rs b/tests/ui/borrowck/auxiliary/aux-5518.rs
index bfe96552a5c..bfe96552a5c 100644
--- a/tests/ui/issues/auxiliary/issue-5518.rs
+++ b/tests/ui/borrowck/auxiliary/aux-5518.rs
diff --git a/tests/ui/issues/issue-5884.rs b/tests/ui/borrowck/borrowed-pointer-in-struct-5884.rs
index 559b897395d..d2f17cf905d 100644
--- a/tests/ui/issues/issue-5884.rs
+++ b/tests/ui/borrowck/borrowed-pointer-in-struct-5884.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/5884
 //@ build-pass
 #![allow(dead_code)]
 
diff --git a/tests/ui/issues/issue-5550.rs b/tests/ui/borrowck/incorrect-loan-error-on-local-update-5550.rs
index 41de8ee5d32..2258d768657 100644
--- a/tests/ui/issues/issue-5550.rs
+++ b/tests/ui/borrowck/incorrect-loan-error-on-local-update-5550.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/5550
 //@ run-pass
 #![allow(unused_assignments)]
 
diff --git a/tests/ui/issues/issue-5708.rs b/tests/ui/borrowck/struct-with-reference-to-trait-5708.rs
index 6fa3cfa4724..5157a3bf36b 100644
--- a/tests/ui/issues/issue-5708.rs
+++ b/tests/ui/borrowck/struct-with-reference-to-trait-5708.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/5708
 //@ run-pass
 #![allow(unused_variables)]
 /*
@@ -10,7 +11,6 @@ This does not occur with concrete types, only with references
 to traits.
 */
 
-
 // original
 trait Inner {
     fn print(&self);
@@ -38,7 +38,6 @@ pub fn main() {
     outer.inner.print();
 }
 
-
 // minimal
 pub trait MyTrait<T> {
     fn dummy(&self, t: T) -> T { panic!() }
diff --git a/tests/ui/borrowck/trait-method-lifetime-substitution-5518.rs b/tests/ui/borrowck/trait-method-lifetime-substitution-5518.rs
new file mode 100644
index 00000000000..f254030a011
--- /dev/null
+++ b/tests/ui/borrowck/trait-method-lifetime-substitution-5518.rs
@@ -0,0 +1,7 @@
+// https://github.com/rust-lang/rust/issues/5518
+//@ run-pass
+//@ aux-build:aux-5518.rs
+
+extern crate aux_5518 as other;
+
+fn main() {}
diff --git a/tests/ui/issues/issue-6557.rs b/tests/ui/box/box-patterns-feature-usage-6557.rs
index 64a025a294f..e0d9b25c366 100644
--- a/tests/ui/issues/issue-6557.rs
+++ b/tests/ui/box/box-patterns-feature-usage-6557.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/6557
 //@ check-pass
 #![allow(dead_code)]
 
diff --git a/tests/ui/issues/issue-54094.rs b/tests/ui/cast/associated-type-bounds-cast-54094.rs
index 4ca7d1d81b6..c9f307e95b9 100644
--- a/tests/ui/issues/issue-54094.rs
+++ b/tests/ui/cast/associated-type-bounds-cast-54094.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/54094
 //@ check-pass
 trait Zoo {
     type X;
diff --git a/tests/ui/issues/issue-6318.rs b/tests/ui/cast/owned-struct-to-trait-cast-6318.rs
index d3f08285a93..8cfc77c4274 100644
--- a/tests/ui/issues/issue-6318.rs
+++ b/tests/ui/cast/owned-struct-to-trait-cast-6318.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/6318
 //@ run-pass
 
 pub enum Thing {
diff --git a/tests/ui/issues/issue-6153.rs b/tests/ui/closures/closure-mut-argument-6153.rs
index cd78c85d94b..ac19c2bd15f 100644
--- a/tests/ui/issues/issue-6153.rs
+++ b/tests/ui/closures/closure-mut-argument-6153.rs
@@ -1,6 +1,6 @@
+// https://github.com/rust-lang/rust/issues/6153
 //@ run-pass
 
-
 fn swap<F>(f: F) -> Vec<isize> where F: FnOnce(Vec<isize>) -> Vec<isize> {
     let x = vec![1, 2, 3];
     f(x)
diff --git a/tests/ui/issues/issue-54462-mutable-noalias-correctness.rs b/tests/ui/codegen/matrix-row-swap-54462.rs
index 70d0bee7332..6bfc600399a 100644
--- a/tests/ui/issues/issue-54462-mutable-noalias-correctness.rs
+++ b/tests/ui/codegen/matrix-row-swap-54462.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/54462
 //@ run-pass
 //
 //@ compile-flags: -Ccodegen-units=1 -O
diff --git a/tests/ui/issues/issue-7012.rs b/tests/ui/codegen/static-array-comparison-7012.rs
index 69b881e2a43..c08b1c0059b 100644
--- a/tests/ui/issues/issue-7012.rs
+++ b/tests/ui/codegen/static-array-comparison-7012.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/7012
 //@ run-pass
 #![allow(non_camel_case_types)]
 #![allow(non_upper_case_globals)]
diff --git a/tests/ui/coercion/mut-trait-coercion-8248.rs b/tests/ui/coercion/coerce-mut-trait-object-8248.rs
index a45a4d94315..a45a4d94315 100644
--- a/tests/ui/coercion/mut-trait-coercion-8248.rs
+++ b/tests/ui/coercion/coerce-mut-trait-object-8248.rs
diff --git a/tests/ui/coercion/mut-trait-coercion-8248.stderr b/tests/ui/coercion/coerce-mut-trait-object-8248.stderr
index 0c7d5f9dc45..c3b35a7063c 100644
--- a/tests/ui/coercion/mut-trait-coercion-8248.stderr
+++ b/tests/ui/coercion/coerce-mut-trait-object-8248.stderr
@@ -1,5 +1,5 @@
 warning: method `dummy` is never used
-  --> $DIR/mut-trait-coercion-8248.rs:5:8
+  --> $DIR/coerce-mut-trait-object-8248.rs:5:8
    |
 LL | trait A {
    |       - method in this trait
diff --git a/tests/ui/issues/issue-54477-reduced-2.rs b/tests/ui/collections/vecdeque-append-operation-54477.rs
index 5f65e545182..7680fd0bb01 100644
--- a/tests/ui/issues/issue-54477-reduced-2.rs
+++ b/tests/ui/collections/vecdeque-append-operation-54477.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/54477
 //@ run-pass
 // rust-lang/rust#54477: runtime bug in the VecDeque library that was
 // exposed by this test case, derived from test suite of crates.io
diff --git a/tests/ui/issues/auxiliary/issue-7178.rs b/tests/ui/cross-crate/auxiliary/aux-7178.rs
index 56ae5139af4..56ae5139af4 100644
--- a/tests/ui/issues/auxiliary/issue-7178.rs
+++ b/tests/ui/cross-crate/auxiliary/aux-7178.rs
diff --git a/tests/ui/cross-crate/static-method-returning-self-with-generics-7178.rs b/tests/ui/cross-crate/static-method-returning-self-with-generics-7178.rs
new file mode 100644
index 00000000000..3888d3bdaa9
--- /dev/null
+++ b/tests/ui/cross-crate/static-method-returning-self-with-generics-7178.rs
@@ -0,0 +1,9 @@
+// https://github.com/rust-lang/rust/issues/7178
+//@ run-pass
+//@ aux-build:aux-7178.rs
+
+extern crate aux_7178 as cross_crate_self;
+
+pub fn main() {
+    let _ = cross_crate_self::Foo::new(&1);
+}
diff --git a/tests/ui/cross-crate/static-regions-in-cross-crate-8259.rs b/tests/ui/cross-crate/static-with-cross-crate-regions-8259.rs
index 347cfa2aee1..347cfa2aee1 100644
--- a/tests/ui/cross-crate/static-regions-in-cross-crate-8259.rs
+++ b/tests/ui/cross-crate/static-with-cross-crate-regions-8259.rs
diff --git a/tests/ui/cross-crate/tuple-struct-cross-crate-7899.rs b/tests/ui/cross-crate/tuple-struct-cross-crate-7899.rs
new file mode 100644
index 00000000000..ce3ea7dd579
--- /dev/null
+++ b/tests/ui/cross-crate/tuple-struct-cross-crate-7899.rs
@@ -0,0 +1,10 @@
+// https://github.com/rust-lang/rust/issues/7899
+//@ run-pass
+#![allow(unused_variables)]
+//@ aux-build:aux-7899.rs
+
+extern crate aux_7899 as testcrate;
+
+fn main() {
+    let f = testcrate::V2(1.0f32, 2.0f32);
+}
diff --git a/tests/ui/issues/issue-5900.rs b/tests/ui/enum/enum-referred-by-submodule-5900.rs
index 14b7b8f815a..4ed092670a8 100644
--- a/tests/ui/issues/issue-5900.rs
+++ b/tests/ui/enum/enum-referred-by-submodule-5900.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/5900
 //@ check-pass
 #![allow(dead_code)]
 
diff --git a/tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997.rs b/tests/ui/enum/enum-with-generic-parameter-5997.rs
index 7ed8819f322..fab7ebbbbdc 100644
--- a/tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997.rs
+++ b/tests/ui/enum/enum-with-generic-parameter-5997.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/5997
 //@ run-pass
 #![allow(dead_code)]
 
diff --git a/tests/ui/issues/issue-6117.rs b/tests/ui/enum/match-either-enum-variants-6117.rs
index 3ccf67b0319..7b395066166 100644
--- a/tests/ui/issues/issue-6117.rs
+++ b/tests/ui/enum/match-either-enum-variants-6117.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/6117
 //@ run-pass
 #![allow(dead_code)]
 
diff --git a/tests/ui/issues/issue-54696.rs b/tests/ui/function-pointer/function-pointer-comparison-54696.rs
index 63ffbe42bcc..2e28dfeaaf8 100644
--- a/tests/ui/issues/issue-54696.rs
+++ b/tests/ui/function-pointer/function-pointer-comparison-54696.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/54696
 //@ run-pass
 
 #![allow(unpredictable_function_pointer_comparisons)]
diff --git a/tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997-enum.rs b/tests/ui/generics/enum-definition-with-outer-generic-parameter-5997.rs
index 0b1857ae3df..00bf66dd4e0 100644
--- a/tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997-enum.rs
+++ b/tests/ui/generics/enum-definition-with-outer-generic-parameter-5997.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/5997
 fn f<Z>() -> bool {
     enum E { V(Z) }
     //~^ ERROR can't use generic parameters from outer item
diff --git a/tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997-enum.stderr b/tests/ui/generics/enum-definition-with-outer-generic-parameter-5997.stderr
index c0b3cd6de66..aea0f049b07 100644
--- a/tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997-enum.stderr
+++ b/tests/ui/generics/enum-definition-with-outer-generic-parameter-5997.stderr
@@ -1,5 +1,5 @@
 error[E0401]: can't use generic parameters from outer item
-  --> $DIR/issue-5997-enum.rs:2:16
+  --> $DIR/enum-definition-with-outer-generic-parameter-5997.rs:3:16
    |
 LL | fn f<Z>() -> bool {
    |      - type parameter from outer item
diff --git a/tests/ui/issues/issue-54410.rs b/tests/ui/issues/issue-54410.rs
deleted file mode 100644
index e3e8ca985b9..00000000000
--- a/tests/ui/issues/issue-54410.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-extern "C" {
-    pub static mut symbol: [i8];
-    //~^ ERROR the size for values of type `[i8]` cannot be known at compilation time
-}
-
-fn main() {
-    println!("{:p}", unsafe { &symbol });
-}
diff --git a/tests/ui/issues/issue-54410.stderr b/tests/ui/issues/issue-54410.stderr
deleted file mode 100644
index cb68ada7e13..00000000000
--- a/tests/ui/issues/issue-54410.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error[E0277]: the size for values of type `[i8]` cannot be known at compilation time
-  --> $DIR/issue-54410.rs:2:5
-   |
-LL |     pub static mut symbol: [i8];
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
-   |
-   = help: the trait `Sized` is not implemented for `[i8]`
-   = note: statics and constants must have a statically known size
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/issues/issue-5518.rs b/tests/ui/issues/issue-5518.rs
deleted file mode 100644
index 333185c482f..00000000000
--- a/tests/ui/issues/issue-5518.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-//@ run-pass
-//@ aux-build:issue-5518.rs
-
-
-extern crate issue_5518 as other;
-
-fn main() {}
diff --git a/tests/ui/issues/issue-5844.rs b/tests/ui/issues/issue-5844.rs
deleted file mode 100644
index 23021207ae1..00000000000
--- a/tests/ui/issues/issue-5844.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-//@aux-build:issue-5844-aux.rs
-
-extern crate issue_5844_aux;
-
-fn main() {
-    issue_5844_aux::rand(); //~ ERROR: requires unsafe
-}
diff --git a/tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997-struct.rs b/tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997-struct.rs
deleted file mode 100644
index 19d994b0dfb..00000000000
--- a/tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997-struct.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-fn f<T>() -> bool {
-    struct S(T); //~ ERROR can't use generic parameters from outer item
-
-    true
-}
-
-fn main() {
-    let b = f::<isize>();
-    assert!(b);
-}
diff --git a/tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997-struct.stderr b/tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997-struct.stderr
deleted file mode 100644
index 670a54894b5..00000000000
--- a/tests/ui/issues/issue-5997-outer-generic-parameter/issue-5997-struct.stderr
+++ /dev/null
@@ -1,13 +0,0 @@
-error[E0401]: can't use generic parameters from outer item
-  --> $DIR/issue-5997-struct.rs:2:14
-   |
-LL | fn f<T>() -> bool {
-   |      - type parameter from outer item
-LL |     struct S(T);
-   |             -^ use of generic parameter from outer item
-   |             |
-   |             help: try introducing a local generic parameter here: `<T>`
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0401`.
diff --git a/tests/ui/issues/issue-6344-match.rs b/tests/ui/issues/issue-6344-match.rs
deleted file mode 100644
index 9251e274383..00000000000
--- a/tests/ui/issues/issue-6344-match.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-//@ run-pass
-#![allow(non_shorthand_field_patterns)]
-
-struct A { x: usize }
-
-impl Drop for A {
-    fn drop(&mut self) {}
-}
-
-pub fn main() {
-    let a = A { x: 0 };
-
-    match a {
-        A { x : ref x } => {
-            println!("{}", x)
-        }
-    }
-}
diff --git a/tests/ui/issues/issue-7178.rs b/tests/ui/issues/issue-7178.rs
deleted file mode 100644
index 408ce0b03eb..00000000000
--- a/tests/ui/issues/issue-7178.rs
+++ /dev/null
@@ -1,9 +0,0 @@
-//@ run-pass
-//@ aux-build:issue-7178.rs
-
-
-extern crate issue_7178 as cross_crate_self;
-
-pub fn main() {
-    let _ = cross_crate_self::Foo::new(&1);
-}
diff --git a/tests/ui/issues/issue-53419.rs b/tests/ui/lifetimes/dyn-trait-function-pointer-53419.rs
index 55d41f2005d..b1017b104ac 100644
--- a/tests/ui/issues/issue-53419.rs
+++ b/tests/ui/lifetimes/dyn-trait-function-pointer-53419.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/53419
 //@ check-pass
 
 struct Foo {
diff --git a/tests/ui/issues/issue-7268.rs b/tests/ui/lifetimes/static-bound-fulfillment-with-pointer-7268.rs
index a3bc1bc3446..8ec58e6cd80 100644
--- a/tests/ui/issues/issue-7268.rs
+++ b/tests/ui/lifetimes/static-bound-fulfillment-with-pointer-7268.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/7268
 //@ check-pass
 #![allow(dead_code)]
 
diff --git a/tests/ui/issues/issue-5741.rs b/tests/ui/loops/unreachable-while-loop-5741.rs
index af4702ec22c..bc69df0f675 100644
--- a/tests/ui/issues/issue-5741.rs
+++ b/tests/ui/loops/unreachable-while-loop-5741.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/5741
 //@ run-pass
 #![allow(while_true)]
 #![allow(unreachable_code)]
diff --git a/tests/ui/issues/issue-5554.rs b/tests/ui/macros/macro-variable-declaration-with-bounds-5554.rs
index 7d219a0df70..8ccf8e80131 100644
--- a/tests/ui/issues/issue-5554.rs
+++ b/tests/ui/macros/macro-variable-declaration-with-bounds-5554.rs
@@ -1,7 +1,7 @@
+// https://github.com/rust-lang/rust/issues/5554
 //@ run-pass
 #![allow(dead_code)]
 
-
 pub struct X<T> {
     a: T,
 }
diff --git a/tests/ui/issues/issue-5718.rs b/tests/ui/macros/macro-variable-unused-reporting-5718.rs
index 234fb2e2222..55da925461d 100644
--- a/tests/ui/issues/issue-5718.rs
+++ b/tests/ui/macros/macro-variable-unused-reporting-5718.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/5718
 //@ run-pass
 
 struct Element;
diff --git a/tests/ui/issues/issue-5358-1.rs b/tests/ui/match/mismatched-types-in-match-5358.rs
index 281f219c039..d096bf3a493 100644
--- a/tests/ui/issues/issue-5358-1.rs
+++ b/tests/ui/match/mismatched-types-in-match-5358.rs
@@ -1,8 +1,13 @@
-enum Either<T, U> { Left(T), Right(U) }
+// https://github.com/rust-lang/rust/issues/5358
+enum Either<T, U> {
+    Left(T),
+    Right(U),
+}
 struct S(Either<usize, usize>);
 
 fn main() {
-    match S(Either::Left(5)) { //~ NOTE this expression has type `S`
+    match S(Either::Left(5)) {
+        //~^ NOTE this expression has type `S`
         Either::Right(_) => {}
         //~^ ERROR mismatched types
         //~| NOTE expected `S`, found `Either<_, _>`
diff --git a/tests/ui/issues/issue-5358-1.stderr b/tests/ui/match/mismatched-types-in-match-5358.stderr
index e68db865dc4..6a6cf3ee269 100644
--- a/tests/ui/issues/issue-5358-1.stderr
+++ b/tests/ui/match/mismatched-types-in-match-5358.stderr
@@ -1,8 +1,9 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-5358-1.rs:6:9
+  --> $DIR/mismatched-types-in-match-5358.rs:11:9
    |
 LL |     match S(Either::Left(5)) {
    |           ------------------ this expression has type `S`
+LL |
 LL |         Either::Right(_) => {}
    |         ^^^^^^^^^^^^^^^^ expected `S`, found `Either<_, _>`
    |
diff --git a/tests/ui/match/mismatched-types-in-match-pattern-7867.rs b/tests/ui/match/mismatched-types-in-match-7867.rs
index 9ff8755c819..9ff8755c819 100644
--- a/tests/ui/match/mismatched-types-in-match-pattern-7867.rs
+++ b/tests/ui/match/mismatched-types-in-match-7867.rs
diff --git a/tests/ui/match/mismatched-types-in-match-pattern-7867.stderr b/tests/ui/match/mismatched-types-in-match-7867.stderr
index 8997f36114a..e41a61e42f4 100644
--- a/tests/ui/match/mismatched-types-in-match-pattern-7867.stderr
+++ b/tests/ui/match/mismatched-types-in-match-7867.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/mismatched-types-in-match-pattern-7867.rs:10:9
+  --> $DIR/mismatched-types-in-match-7867.rs:10:9
    |
 LL | enum A { B, C }
    |          - unit variant defined here
diff --git a/tests/ui/methods/trait-method-self-param-error-7575.rs b/tests/ui/methods/trait-method-resolution-7575.rs
index 9793d43cc24..9793d43cc24 100644
--- a/tests/ui/methods/trait-method-self-param-error-7575.rs
+++ b/tests/ui/methods/trait-method-resolution-7575.rs
diff --git a/tests/ui/methods/trait-method-self-param-error-7575.stderr b/tests/ui/methods/trait-method-resolution-7575.stderr
index 656db30352d..8bbc360de57 100644
--- a/tests/ui/methods/trait-method-self-param-error-7575.stderr
+++ b/tests/ui/methods/trait-method-resolution-7575.stderr
@@ -1,5 +1,5 @@
 warning: trait `Foo` is never used
-  --> $DIR/trait-method-self-param-error-7575.rs:4:7
+  --> $DIR/trait-method-resolution-7575.rs:4:7
    |
 LL | trait Foo {
    |       ^^^
diff --git a/tests/ui/issues/issue-5950.rs b/tests/ui/modules/pub-use-module-alias-5950.rs
index 6015560fcf8..91d3f9b16ff 100644
--- a/tests/ui/issues/issue-5950.rs
+++ b/tests/ui/modules/pub-use-module-alias-5950.rs
@@ -1,6 +1,6 @@
+// https://github.com/rust-lang/rust/issues/5950
 //@ check-pass
 
-
 pub use local as local_alias;
 
 pub mod local { }
diff --git a/tests/ui/resolve/module-import-resolution-7663.rs b/tests/ui/modules/use-statement-duplicate-check-7663.rs
index 872806594fc..872806594fc 100644
--- a/tests/ui/resolve/module-import-resolution-7663.rs
+++ b/tests/ui/modules/use-statement-duplicate-check-7663.rs
diff --git a/tests/ui/issues/issue-6130.rs b/tests/ui/numeric/type-limit-comparisons-6130.rs
index c675a8a41dd..54b3f631e67 100644
--- a/tests/ui/issues/issue-6130.rs
+++ b/tests/ui/numeric/type-limit-comparisons-6130.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/6130
 //@ run-pass
 
 pub fn main() {
diff --git a/tests/ui/issues/issue-5572.rs b/tests/ui/parser/partial-eq-trait-bound-5572.rs
index f27744ef0ac..7ee0cdc43ee 100644
--- a/tests/ui/issues/issue-5572.rs
+++ b/tests/ui/parser/partial-eq-trait-bound-5572.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/5572
 //@ check-pass
 #![allow(dead_code)]
 
diff --git a/tests/ui/issues/auxiliary/iss.rs b/tests/ui/privacy/auxiliary/iss-6919.rs
index cf32f6c2d5d..cf32f6c2d5d 100644
--- a/tests/ui/issues/auxiliary/iss.rs
+++ b/tests/ui/privacy/auxiliary/iss-6919.rs
diff --git a/tests/ui/issues/issue-6919.rs b/tests/ui/privacy/deref-separate-compile-unit-6919.rs
index 7fb8a2f33bc..5d8934987e5 100644
--- a/tests/ui/issues/issue-6919.rs
+++ b/tests/ui/privacy/deref-separate-compile-unit-6919.rs
@@ -1,7 +1,7 @@
+// https://github.com/rust-lang/rust/issues/6919
 //@ run-pass
 #![allow(unused_attributes)]
-//@ aux-build:iss.rs
-
+//@ aux-build:iss-6919.rs
 
 extern crate issue6919_3;
 
diff --git a/tests/ui/issues/issue-55376.rs b/tests/ui/privacy/pub-restricted-path-usage-55376.rs
index 5a6862b6530..ca4e27c30a8 100644
--- a/tests/ui/issues/issue-55376.rs
+++ b/tests/ui/privacy/pub-restricted-path-usage-55376.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/55376
 //@ run-pass
 // Tests that paths in `pub(...)` don't fail HIR verification.
 
diff --git a/tests/ui/issues/issue-53728.rs b/tests/ui/repr/packed-struct-with-enum-53728.rs
index 364965228c6..6ce65ed634f 100644
--- a/tests/ui/issues/issue-53728.rs
+++ b/tests/ui/repr/packed-struct-with-enum-53728.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/53728
 //@ run-pass
 
 #![allow(dead_code)]
diff --git a/tests/ui/issues/issue-6936.rs b/tests/ui/resolve/duplicate-name-in-module-6936.rs
index e9aa80b4eb3..ae9282c0c24 100644
--- a/tests/ui/issues/issue-6936.rs
+++ b/tests/ui/resolve/duplicate-name-in-module-6936.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/6936
 struct T;
 
 mod t1 {
@@ -30,5 +31,4 @@ mod t6 {
     impl Foo {} // ok
 }
 
-
 fn main() {}
diff --git a/tests/ui/issues/issue-6936.stderr b/tests/ui/resolve/duplicate-name-in-module-6936.stderr
index 03cc50636b4..76bb8f57386 100644
--- a/tests/ui/issues/issue-6936.stderr
+++ b/tests/ui/resolve/duplicate-name-in-module-6936.stderr
@@ -1,5 +1,5 @@
 error[E0428]: the name `Foo` is defined multiple times
-  --> $DIR/issue-6936.rs:5:5
+  --> $DIR/duplicate-name-in-module-6936.rs:6:5
    |
 LL |     type Foo = crate::T;
    |     -------------------- previous definition of the type `Foo` here
@@ -9,7 +9,7 @@ LL |     mod Foo {}
    = note: `Foo` must be defined only once in the type namespace of this module
 
 error[E0428]: the name `Foo` is defined multiple times
-  --> $DIR/issue-6936.rs:10:5
+  --> $DIR/duplicate-name-in-module-6936.rs:11:5
    |
 LL |     type Foo = crate::T;
    |     -------------------- previous definition of the type `Foo` here
@@ -19,7 +19,7 @@ LL |     struct Foo;
    = note: `Foo` must be defined only once in the type namespace of this module
 
 error[E0428]: the name `Foo` is defined multiple times
-  --> $DIR/issue-6936.rs:15:5
+  --> $DIR/duplicate-name-in-module-6936.rs:16:5
    |
 LL |     type Foo = crate::T;
    |     -------------------- previous definition of the type `Foo` here
@@ -29,7 +29,7 @@ LL |     enum Foo {}
    = note: `Foo` must be defined only once in the type namespace of this module
 
 error[E0428]: the name `Bar` is defined multiple times
-  --> $DIR/issue-6936.rs:25:5
+  --> $DIR/duplicate-name-in-module-6936.rs:26:5
    |
 LL |     type Bar<T> = T;
    |     ---------------- previous definition of the type `Bar` here
diff --git a/tests/ui/issues/issue-7044.rs b/tests/ui/resolve/unit-like-struct-masks-constant-7044.rs
index a6e22bc5237..f48dd695f01 100644
--- a/tests/ui/issues/issue-7044.rs
+++ b/tests/ui/resolve/unit-like-struct-masks-constant-7044.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/7044
 static X: isize = 0;
 struct X; //~ ERROR the name `X` is defined multiple times
 
diff --git a/tests/ui/issues/issue-7044.stderr b/tests/ui/resolve/unit-like-struct-masks-constant-7044.stderr
index 9d1fb3a10dd..48aa6fce455 100644
--- a/tests/ui/issues/issue-7044.stderr
+++ b/tests/ui/resolve/unit-like-struct-masks-constant-7044.stderr
@@ -1,5 +1,5 @@
 error[E0428]: the name `X` is defined multiple times
-  --> $DIR/issue-7044.rs:2:1
+  --> $DIR/unit-like-struct-masks-constant-7044.rs:3:1
    |
 LL | static X: isize = 0;
    | -------------------- previous definition of the value `X` here
diff --git a/tests/ui/issues/issue-55380.rs b/tests/ui/specialization/trait-specialization-default-methods-55380.rs
index 54894cdede0..b3d79fb5ffb 100644
--- a/tests/ui/issues/issue-55380.rs
+++ b/tests/ui/specialization/trait-specialization-default-methods-55380.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/55380
 //@ run-pass
 #![feature(specialization)]
 //~^ WARN the feature `specialization` is incomplete
diff --git a/tests/ui/issues/issue-55380.stderr b/tests/ui/specialization/trait-specialization-default-methods-55380.stderr
index 403844c726f..f7c1903da62 100644
--- a/tests/ui/issues/issue-55380.stderr
+++ b/tests/ui/specialization/trait-specialization-default-methods-55380.stderr
@@ -1,5 +1,5 @@
 warning: the feature `specialization` is incomplete and may not be safe to use and/or cause compiler crashes
-  --> $DIR/issue-55380.rs:2:12
+  --> $DIR/trait-specialization-default-methods-55380.rs:3:12
    |
 LL | #![feature(specialization)]
    |            ^^^^^^^^^^^^^^
diff --git a/tests/ui/issues/issue-7364.rs b/tests/ui/static/global-variable-promotion-error-7364.rs
index 4ce9beb68cd..dba4a484d61 100644
--- a/tests/ui/issues/issue-7364.rs
+++ b/tests/ui/static/global-variable-promotion-error-7364.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/7364
 use std::cell::RefCell;
 
 // Regression test for issue 7364
diff --git a/tests/ui/issues/issue-7364.stderr b/tests/ui/static/global-variable-promotion-error-7364.stderr
index a47a90c90ce..b9d75676bef 100644
--- a/tests/ui/issues/issue-7364.stderr
+++ b/tests/ui/static/global-variable-promotion-error-7364.stderr
@@ -1,5 +1,5 @@
 error[E0277]: `RefCell<isize>` cannot be shared between threads safely
-  --> $DIR/issue-7364.rs:4:15
+  --> $DIR/global-variable-promotion-error-7364.rs:5:15
    |
 LL | static boxed: Box<RefCell<isize>> = Box::new(RefCell::new(0));
    |               ^^^^^^^^^^^^^^^^^^^ `RefCell<isize>` cannot be shared between threads safely
@@ -12,7 +12,7 @@ note: required because it appears within the type `Box<RefCell<isize>>`
    = note: shared static variables must have a type that implements `Sync`
 
 error[E0015]: cannot call non-const associated function `Box::<RefCell<isize>>::new` in statics
-  --> $DIR/issue-7364.rs:4:37
+  --> $DIR/global-variable-promotion-error-7364.rs:5:37
    |
 LL | static boxed: Box<RefCell<isize>> = Box::new(RefCell::new(0));
    |                                     ^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/tests/ui/issues/issue-5917.rs b/tests/ui/static/static-list-initialization-5917.rs
index 8e91b1052a2..c6c32f7582e 100644
--- a/tests/ui/issues/issue-5917.rs
+++ b/tests/ui/static/static-list-initialization-5917.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/5917
 //@ run-pass
 #![allow(non_upper_case_globals)]
 
diff --git a/tests/ui/issues/issue-5688.rs b/tests/ui/static/static-struct-initialization-5688.rs
index a7db1dfb15f..6a4c2f45b6b 100644
--- a/tests/ui/issues/issue-5688.rs
+++ b/tests/ui/static/static-struct-initialization-5688.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/5688
 //@ run-pass
 /*
 # Corrupted initialization in the static struct
diff --git a/tests/ui/structs-enums/auxiliary/aux-8044.rs b/tests/ui/structs/auxiliary/aux-8044.rs
index 2ec25f51cde..2ec25f51cde 100644
--- a/tests/ui/structs-enums/auxiliary/aux-8044.rs
+++ b/tests/ui/structs/auxiliary/aux-8044.rs
diff --git a/tests/ui/structs-enums/struct-and-enum-usage-8044.rs b/tests/ui/structs/btree-struct-usage-8044.rs
index 9b544f33f1c..9b544f33f1c 100644
--- a/tests/ui/structs-enums/struct-and-enum-usage-8044.rs
+++ b/tests/ui/structs/btree-struct-usage-8044.rs
diff --git a/tests/ui/issues/issue-6344-let.rs b/tests/ui/structs/destructuring-struct-with-dtor-6344.rs
index 1e1bdfa17be..b107a99e89f 100644
--- a/tests/ui/issues/issue-6344-let.rs
+++ b/tests/ui/structs/destructuring-struct-with-dtor-6344.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/6344
 //@ run-pass
 #![allow(non_shorthand_field_patterns)]
 
diff --git a/tests/ui/issues/issue-5439.rs b/tests/ui/structs/nonexistent-struct-field-error-5439.rs
index 852b264dc5d..b2b3293ac91 100644
--- a/tests/ui/issues/issue-5439.rs
+++ b/tests/ui/structs/nonexistent-struct-field-error-5439.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/5439
 struct Foo {
     foo: isize,
 }
diff --git a/tests/ui/issues/issue-5439.stderr b/tests/ui/structs/nonexistent-struct-field-error-5439.stderr
index 6d1d74e3045..b560772fbf0 100644
--- a/tests/ui/issues/issue-5439.stderr
+++ b/tests/ui/structs/nonexistent-struct-field-error-5439.stderr
@@ -1,5 +1,5 @@
 error[E0560]: struct `Foo` has no field named `nonexistent`
-  --> $DIR/issue-5439.rs:11:31
+  --> $DIR/nonexistent-struct-field-error-5439.rs:12:31
    |
 LL |         return Box::new(Foo { nonexistent: self, foo: i });
    |                               ^^^^^^^^^^^ `Foo` does not have this field
diff --git a/tests/ui/issues/issue-5666.rs b/tests/ui/traits/dynamic-dispatch-trait-objects-5666.rs
index 76e2f8229a0..e335949d832 100644
--- a/tests/ui/issues/issue-5666.rs
+++ b/tests/ui/traits/dynamic-dispatch-trait-objects-5666.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/5666
 //@ run-pass
 
 struct Dog {
@@ -14,7 +15,6 @@ impl Barks for Dog {
     }
 }
 
-
 pub fn main() {
     let snoopy = Box::new(Dog{name: "snoopy".to_string()});
     let bubbles = Box::new(Dog{name: "bubbles".to_string()});
diff --git a/tests/ui/issues/issue-53568.rs b/tests/ui/traits/nll-ice-custom-type-ops-53568.rs
index 9862d4ced12..9b240cdc190 100644
--- a/tests/ui/issues/issue-53568.rs
+++ b/tests/ui/traits/nll-ice-custom-type-ops-53568.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/53568
 // Regression test for an NLL-related ICE (#53568) -- we failed to
 // resolve inference variables in "custom type-ops".
 //
diff --git a/tests/ui/issues/issue-5883.rs b/tests/ui/traits/opaque-trait-size-error-5883.rs
index dd4753e0344..e39e24e7342 100644
--- a/tests/ui/issues/issue-5883.rs
+++ b/tests/ui/traits/opaque-trait-size-error-5883.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/5883
 trait A {}
 
 struct Struct {
diff --git a/tests/ui/issues/issue-5883.stderr b/tests/ui/traits/opaque-trait-size-error-5883.stderr
index 2ca437b8c47..78de250b19a 100644
--- a/tests/ui/issues/issue-5883.stderr
+++ b/tests/ui/traits/opaque-trait-size-error-5883.stderr
@@ -1,19 +1,19 @@
 error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time
-  --> $DIR/issue-5883.rs:9:6
+  --> $DIR/opaque-trait-size-error-5883.rs:10:6
    |
 LL | ) -> Struct {
    |      ^^^^^^ doesn't have a size known at compile-time
    |
    = help: within `Struct`, the trait `Sized` is not implemented for `(dyn A + 'static)`
 note: required because it appears within the type `Struct`
-  --> $DIR/issue-5883.rs:3:8
+  --> $DIR/opaque-trait-size-error-5883.rs:4:8
    |
 LL | struct Struct {
    |        ^^^^^^
    = note: the return type of a function must have a statically known size
 
 error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time
-  --> $DIR/issue-5883.rs:8:8
+  --> $DIR/opaque-trait-size-error-5883.rs:9:8
    |
 LL |     r: dyn A + 'static
    |        ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
diff --git a/tests/ui/traits/self-implements-kinds-in-default-methods-8171.rs b/tests/ui/traits/self-not-send-in-default-method-8171.rs
index 59ea62c7690..59ea62c7690 100644
--- a/tests/ui/traits/self-implements-kinds-in-default-methods-8171.rs
+++ b/tests/ui/traits/self-not-send-in-default-method-8171.rs
diff --git a/tests/ui/issues/issue-6898.rs b/tests/ui/traits/trait-implementation-generic-access-6898.rs
index c810acaf61b..e9437b1c522 100644
--- a/tests/ui/issues/issue-6898.rs
+++ b/tests/ui/traits/trait-implementation-generic-access-6898.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/6898
 //@ check-pass
 
 use std::mem;
diff --git a/tests/ui/issues/issue-5988.rs b/tests/ui/traits/trait-implementation-restriction-5988.rs
index b7527d9bea8..d3a5b10569b 100644
--- a/tests/ui/issues/issue-5988.rs
+++ b/tests/ui/traits/trait-implementation-restriction-5988.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/5988
 //@ run-pass
 
 trait B {
diff --git a/tests/ui/traits/trait-implementation-and-usage-7563.rs b/tests/ui/traits/trait-object-lifetime-bounds-7563.rs
index 8cfc7a14ffe..8cfc7a14ffe 100644
--- a/tests/ui/traits/trait-implementation-and-usage-7563.rs
+++ b/tests/ui/traits/trait-object-lifetime-bounds-7563.rs
diff --git a/tests/ui/issues/issue-7344.rs b/tests/ui/unreachable-code/boolean-negation-in-unreachable-code-7344.rs
index 406b24634f5..8fd091872c3 100644
--- a/tests/ui/issues/issue-7344.rs
+++ b/tests/ui/unreachable-code/boolean-negation-in-unreachable-code-7344.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/7344
 //@ run-pass
 #![allow(unused_must_use)]
 
diff --git a/tests/ui/issues/auxiliary/issue-5844-aux.rs b/tests/ui/unsafe/auxiliary/aux-5844.rs
index ea83378cad6..ea83378cad6 100644
--- a/tests/ui/issues/auxiliary/issue-5844-aux.rs
+++ b/tests/ui/unsafe/auxiliary/aux-5844.rs
diff --git a/tests/ui/unsafe/extern-function-requires-unsafe-5844.rs b/tests/ui/unsafe/extern-function-requires-unsafe-5844.rs
new file mode 100644
index 00000000000..11863ce647a
--- /dev/null
+++ b/tests/ui/unsafe/extern-function-requires-unsafe-5844.rs
@@ -0,0 +1,8 @@
+// https://github.com/rust-lang/rust/issues/5844
+//@aux-build:aux-5844.rs
+
+extern crate aux_5844;
+
+fn main() {
+    aux_5844::rand(); //~ ERROR: requires unsafe
+}
diff --git a/tests/ui/issues/issue-5844.stderr b/tests/ui/unsafe/extern-function-requires-unsafe-5844.stderr
index bae917fa72c..44dee178991 100644
--- a/tests/ui/issues/issue-5844.stderr
+++ b/tests/ui/unsafe/extern-function-requires-unsafe-5844.stderr
@@ -1,8 +1,8 @@
 error[E0133]: call to unsafe function `rand` is unsafe and requires unsafe function or block
-  --> $DIR/issue-5844.rs:6:5
+  --> $DIR/extern-function-requires-unsafe-5844.rs:7:5
    |
-LL |     issue_5844_aux::rand();
-   |     ^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
+LL |     aux_5844::rand();
+   |     ^^^^^^^^^^^^^^^^ call to unsafe function
    |
    = note: consult the function's documentation for information on how to avoid undefined behavior