about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-08-10 20:44:38 +0000
committerbors <bors@rust-lang.org>2025-08-10 20:44:38 +0000
commitc8ca44c98eade864824a3c0a15fbdc1edb7f9dd4 (patch)
treeb3dda335c93326c2220e86f330da256b5fa8dfde
parent29737cb44beb67dbcf001ca1f11b7ec8964d8d06 (diff)
parentc9847db07e59097dcdbdcba033a7801370485ec9 (diff)
downloadrust-c8ca44c98eade864824a3c0a15fbdc1edb7f9dd4.tar.gz
rust-c8ca44c98eade864824a3c0a15fbdc1edb7f9dd4.zip
Auto merge of #145223 - jhpratt:rollup-xcqbwqe, r=jhpratt
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#144553 (Rehome 32 `tests/ui/issues/` tests to other subdirectories under `tests/ui/`)
 - rust-lang/rust#145064 (Add regression test for `saturating_sub` bounds check issue)
 - rust-lang/rust#145121 (bootstrap: `x.py dist rustc-src` should keep LLVM's siphash)
 - rust-lang/rust#145150 (Replace unsafe `security_attributes` function with safe `inherit_handle` alternative)
 - rust-lang/rust#145152 (Use `eq_ignore_ascii_case` to avoid heap alloc in `detect_confuse_type`)
 - rust-lang/rust#145200 (mbe: Fix typo in attribute tracing)
 - rust-lang/rust#145222 (Fix typo with paren rustc_llvm/build.rs)

r? `@ghost`
`@rustbot` modify labels: rollup
-rw-r--r--compiler/rustc_errors/src/emitter.rs2
-rw-r--r--compiler/rustc_expand/src/mbe/macro_rules.rs2
-rw-r--r--compiler/rustc_llvm/build.rs2
-rw-r--r--library/std/src/sys/fs/windows.rs15
-rw-r--r--library/std/src/sys/process/windows.rs8
-rw-r--r--src/bootstrap/src/core/build_steps/dist.rs14
-rw-r--r--tests/codegen-llvm/issues/saturating-sub-index-139759.rs19
-rw-r--r--tests/ui/associated-types/unioned-keys-with-associated-type-23442.rs (renamed from tests/ui/issues/issue-23442.rs)1
-rw-r--r--tests/ui/autoref-autoderef/auto-deref-on-cow-regression-91489.rs (renamed from tests/ui/issues/issue-91489.rs)1
-rw-r--r--tests/ui/binding/struct-destructuring-repeated-bindings-9725.rs (renamed from tests/ui/issues/issue-9725.rs)1
-rw-r--r--tests/ui/binding/struct-destructuring-repeated-bindings-9725.stderr (renamed from tests/ui/issues/issue-9725.stderr)4
-rw-r--r--tests/ui/cast/constant-expression-cast-9942.rs (renamed from tests/ui/issues/issue-9942.rs)1
-rw-r--r--tests/ui/closures/closure-type-inference-in-context-9129.rs (renamed from tests/ui/issues/issue-9129.rs)1
-rw-r--r--tests/ui/coercion/trait-object-coercion-distribution-9951.rs (renamed from tests/ui/issues/issue-9951.rs)1
-rw-r--r--tests/ui/coercion/trait-object-coercion-distribution-9951.stderr (renamed from tests/ui/issues/issue-9951.stderr)2
-rw-r--r--tests/ui/const-generics/try-from-with-const-genericsrs-98299.rs (renamed from tests/ui/issues/issue-98299.rs)1
-rw-r--r--tests/ui/const-generics/try-from-with-const-genericsrs-98299.stderr (renamed from tests/ui/issues/issue-98299.stderr)12
-rw-r--r--tests/ui/cross-crate/auxiliary/aux-9155.rs (renamed from tests/ui/issues/auxiliary/issue-9155.rs)0
-rw-r--r--tests/ui/cross-crate/auxiliary/aux-9906.rs (renamed from tests/ui/issues/auxiliary/issue-9906.rs)0
-rw-r--r--tests/ui/cross-crate/generic-newtypes-cross-crate-usage-9155.rs11
-rw-r--r--tests/ui/cross-crate/reexported-structs-impls-link-error-9906.rs10
-rw-r--r--tests/ui/deref/dereferenceable-type-behavior-22992.rs (renamed from tests/ui/issues/issue-22992.rs)2
-rw-r--r--tests/ui/drop/multiple-drop-safe-code-25549.rs (renamed from tests/ui/issues/issue-25549-multiple-drop.rs)1
-rw-r--r--tests/ui/drop/static-variable-with-drop-trait-9243.rs (renamed from tests/ui/issues/issue-9243.rs)1
-rw-r--r--tests/ui/editions/edition-specific-identifier-shadowing-53333.rs (renamed from tests/ui/issues/issue-53333.rs)1
-rw-r--r--tests/ui/enum-discriminant/enum-discriminant-const-eval-truncation-9837.rs (renamed from tests/ui/issues/issue-9837.rs)1
-rw-r--r--tests/ui/enum/single-variant-enum-deref-error-9814.rs (renamed from tests/ui/issues/issue-9814.rs)1
-rw-r--r--tests/ui/enum/single-variant-enum-deref-error-9814.stderr (renamed from tests/ui/issues/issue-9814.stderr)2
-rw-r--r--tests/ui/enum/zero-variant-enum-pattern-matching-3037.rs (renamed from tests/ui/issues/issue-3037.rs)1
-rw-r--r--tests/ui/imports/auxiliary/aux-9968.rs (renamed from tests/ui/issues/auxiliary/issue-9968.rs)0
-rw-r--r--tests/ui/imports/pub-use-link-errors-9968.rs12
-rw-r--r--tests/ui/issues/issue-9155.rs11
-rw-r--r--tests/ui/issues/issue-9906.rs10
-rw-r--r--tests/ui/issues/issue-9968.rs12
-rw-r--r--tests/ui/iterators/for-loop-over-mut-iterator-21655.rs (renamed from tests/ui/issues/issue-21655.rs)1
-rw-r--r--tests/ui/lifetimes/struct-with-lifetime-parameters-9259.rs (renamed from tests/ui/issues/issue-9259.rs)1
-rw-r--r--tests/ui/lint/unused-results-lint-triggered-by-derive-debug-29710.rs (renamed from tests/ui/issues/issue-29710.rs)1
-rw-r--r--tests/ui/loops/loop-with-label-9047.rs (renamed from tests/ui/issues/issue-9047.rs)1
-rw-r--r--tests/ui/macros/macro-expansion-module-structure-9110.rs (renamed from tests/ui/issues/issue-9110.rs)1
-rw-r--r--tests/ui/macros/macro-invocation-with-variable-in-scope-9737.rs (renamed from tests/ui/issues/issue-9737.rs)1
-rw-r--r--tests/ui/macros/private-struct-member-macro-access-25386.rs (renamed from tests/ui/issues/issue-25386.rs)1
-rw-r--r--tests/ui/macros/private-struct-member-macro-access-25386.stderr (renamed from tests/ui/issues/issue-25386.stderr)2
-rw-r--r--tests/ui/mismatched_types/newlines-in-diagnostic-fix-suggestions-92741.fixed (renamed from tests/ui/issues/issue-92741.fixed)1
-rw-r--r--tests/ui/mismatched_types/newlines-in-diagnostic-fix-suggestions-92741.rs (renamed from tests/ui/issues/issue-92741.rs)1
-rw-r--r--tests/ui/mismatched_types/newlines-in-diagnostic-fix-suggestions-92741.stderr (renamed from tests/ui/issues/issue-92741.stderr)6
-rw-r--r--tests/ui/packed/misaligned-reference-drop-field-99838.rs (renamed from tests/ui/issues/issue-99838.rs)1
-rw-r--r--tests/ui/pattern/unit-variant-pattern-matching-29383.rs (renamed from tests/ui/issues/issue-pr29383.rs)1
-rw-r--r--tests/ui/pattern/unit-variant-pattern-matching-29383.stderr (renamed from tests/ui/issues/issue-pr29383.stderr)4
-rw-r--r--tests/ui/static/static-string-slice-9249.rs (renamed from tests/ui/issues/issue-9249.rs)1
-rw-r--r--tests/ui/structs/struct-field-access-errors-24365.rs (renamed from tests/ui/issues/issue-24365.rs)1
-rw-r--r--tests/ui/structs/struct-field-access-errors-24365.stderr (renamed from tests/ui/issues/issue-24365.stderr)6
-rw-r--r--tests/ui/thread-local/thread-local-with-attributes-30756.rs (renamed from tests/ui/issues/issue-30756.rs)1
-rw-r--r--tests/ui/typeck/unused-type-parameter-span-30236.rs (renamed from tests/ui/issues/issue-30236.rs)1
-rw-r--r--tests/ui/typeck/unused-type-parameter-span-30236.stderr (renamed from tests/ui/issues/issue-30236.stderr)2
-rw-r--r--tests/ui/uninhabited/uninhabited-type-layout-computation-88150.rs (renamed from tests/ui/issues/issue-88150.rs)1
55 files changed, 130 insertions, 69 deletions
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs
index 0c839f94f7f..97c47fa9b9a 100644
--- a/compiler/rustc_errors/src/emitter.rs
+++ b/compiler/rustc_errors/src/emitter.rs
@@ -3546,7 +3546,7 @@ pub fn detect_confusion_type(sm: &SourceMap, suggested: &str, sp: Span) -> Confu
 
         for (f, s) in iter::zip(found.chars(), suggested.chars()) {
             if f != s {
-                if f.to_lowercase().to_string() == s.to_lowercase().to_string() {
+                if f.eq_ignore_ascii_case(&s) {
                     // Check for case differences (any character that differs only in case)
                     if ascii_confusables.contains(&f) || ascii_confusables.contains(&s) {
                         has_case_diff = true;
diff --git a/compiler/rustc_expand/src/mbe/macro_rules.rs b/compiler/rustc_expand/src/mbe/macro_rules.rs
index 37b236a2e26..08b0efb74a0 100644
--- a/compiler/rustc_expand/src/mbe/macro_rules.rs
+++ b/compiler/rustc_expand/src/mbe/macro_rules.rs
@@ -347,7 +347,7 @@ fn expand_macro_attr(
 
     if cx.trace_macros() {
         let msg = format!(
-            "expanding `$[{name}({})] {}`",
+            "expanding `#[{name}({})] {}`",
             pprust::tts_to_string(&args),
             pprust::tts_to_string(&body),
         );
diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
index 6c740156c4d..1394edcee6b 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
@@ -255,7 +255,7 @@ fn main() {
         println!("cargo:rustc-link-lib=kstat");
     }
 
-    if (target.starts_with("arm") && !target.contains("freebsd")) && !target.contains("ohos")
+    if (target.starts_with("arm") && !target.contains("freebsd") && !target.contains("ohos"))
         || target.starts_with("mips-")
         || target.starts_with("mipsel-")
         || target.starts_with("powerpc-")
diff --git a/library/std/src/sys/fs/windows.rs b/library/std/src/sys/fs/windows.rs
index 9b674a25165..09feddd0be9 100644
--- a/library/std/src/sys/fs/windows.rs
+++ b/library/std/src/sys/fs/windows.rs
@@ -80,7 +80,7 @@ pub struct OpenOptions {
     attributes: u32,
     share_mode: u32,
     security_qos_flags: u32,
-    security_attributes: *mut c::SECURITY_ATTRIBUTES,
+    inherit_handle: bool,
 }
 
 #[derive(Clone, PartialEq, Eq, Debug)]
@@ -203,7 +203,7 @@ impl OpenOptions {
             share_mode: c::FILE_SHARE_READ | c::FILE_SHARE_WRITE | c::FILE_SHARE_DELETE,
             attributes: 0,
             security_qos_flags: 0,
-            security_attributes: ptr::null_mut(),
+            inherit_handle: false,
         }
     }
 
@@ -243,8 +243,8 @@ impl OpenOptions {
         // receive is `SECURITY_ANONYMOUS = 0x0`, which we can't check for later on.
         self.security_qos_flags = flags | c::SECURITY_SQOS_PRESENT;
     }
-    pub fn security_attributes(&mut self, attrs: *mut c::SECURITY_ATTRIBUTES) {
-        self.security_attributes = attrs;
+    pub fn inherit_handle(&mut self, inherit: bool) {
+        self.inherit_handle = inherit;
     }
 
     fn get_access_mode(&self) -> io::Result<u32> {
@@ -307,12 +307,17 @@ impl File {
 
     fn open_native(path: &WCStr, opts: &OpenOptions) -> io::Result<File> {
         let creation = opts.get_creation_mode()?;
+        let sa = c::SECURITY_ATTRIBUTES {
+            nLength: size_of::<c::SECURITY_ATTRIBUTES>() as u32,
+            lpSecurityDescriptor: ptr::null_mut(),
+            bInheritHandle: opts.inherit_handle as c::BOOL,
+        };
         let handle = unsafe {
             c::CreateFileW(
                 path.as_ptr(),
                 opts.get_access_mode()?,
                 opts.share_mode,
-                opts.security_attributes,
+                if opts.inherit_handle { &sa } else { ptr::null() },
                 creation,
                 opts.get_flags_and_attributes(),
                 ptr::null_mut(),
diff --git a/library/std/src/sys/process/windows.rs b/library/std/src/sys/process/windows.rs
index 1ee3fbd285f..f9e15b82475 100644
--- a/library/std/src/sys/process/windows.rs
+++ b/library/std/src/sys/process/windows.rs
@@ -623,16 +623,10 @@ impl Stdio {
             // permissions as well as the ability to be inherited to child
             // processes (as this is about to be inherited).
             Stdio::Null => {
-                let size = size_of::<c::SECURITY_ATTRIBUTES>();
-                let mut sa = c::SECURITY_ATTRIBUTES {
-                    nLength: size as u32,
-                    lpSecurityDescriptor: ptr::null_mut(),
-                    bInheritHandle: 1,
-                };
                 let mut opts = OpenOptions::new();
                 opts.read(stdio_id == c::STD_INPUT_HANDLE);
                 opts.write(stdio_id != c::STD_INPUT_HANDLE);
-                opts.security_attributes(&mut sa);
+                opts.inherit_handle(true);
                 File::open(Path::new(r"\\.\NUL"), &opts).map(|file| file.into_inner())
             }
         }
diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
index 3fbc8cdbcd5..2c3fb9458ef 100644
--- a/src/bootstrap/src/core/build_steps/dist.rs
+++ b/src/bootstrap/src/core/build_steps/dist.rs
@@ -925,6 +925,8 @@ fn copy_src_dirs(
             "llvm-project\\cmake",
             "llvm-project/runtimes",
             "llvm-project\\runtimes",
+            "llvm-project/third-party",
+            "llvm-project\\third-party",
         ];
         if spath.contains("llvm-project")
             && !spath.ends_with("llvm-project")
@@ -933,6 +935,18 @@ fn copy_src_dirs(
             return false;
         }
 
+        // Keep only these third party libraries
+        const LLVM_THIRD_PARTY: &[&str] =
+            &["llvm-project/third-party/siphash", "llvm-project\\third-party\\siphash"];
+        if (spath.starts_with("llvm-project/third-party")
+            || spath.starts_with("llvm-project\\third-party"))
+            && !(spath.ends_with("llvm-project/third-party")
+                || spath.ends_with("llvm-project\\third-party"))
+            && !LLVM_THIRD_PARTY.iter().any(|path| spath.contains(path))
+        {
+            return false;
+        }
+
         const LLVM_TEST: &[&str] = &["llvm-project/llvm/test", "llvm-project\\llvm\\test"];
         if LLVM_TEST.iter().any(|path| spath.contains(path))
             && (spath.ends_with(".ll") || spath.ends_with(".td") || spath.ends_with(".s"))
diff --git a/tests/codegen-llvm/issues/saturating-sub-index-139759.rs b/tests/codegen-llvm/issues/saturating-sub-index-139759.rs
new file mode 100644
index 00000000000..eac2f4d306b
--- /dev/null
+++ b/tests/codegen-llvm/issues/saturating-sub-index-139759.rs
@@ -0,0 +1,19 @@
+// Test that calculating an index with saturating subtraction from an in-bounds
+// index doesn't generate another bounds check.
+
+//@ compile-flags: -Copt-level=3
+//@ min-llvm-version: 21
+
+#![crate_type = "lib"]
+
+// CHECK-LABEL: @bounds_check_is_elided
+#[no_mangle]
+pub fn bounds_check_is_elided(s: &[i32], index: usize) -> i32 {
+    // CHECK-NOT: panic_bounds_check
+    if index < s.len() {
+        let lower_bound = index.saturating_sub(1);
+        s[lower_bound]
+    } else {
+        -1
+    }
+}
diff --git a/tests/ui/issues/issue-23442.rs b/tests/ui/associated-types/unioned-keys-with-associated-type-23442.rs
index 883c5bb511a..89a2d0177a3 100644
--- a/tests/ui/issues/issue-23442.rs
+++ b/tests/ui/associated-types/unioned-keys-with-associated-type-23442.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/23442
 //@ check-pass
 #![allow(dead_code)]
 use std::marker::PhantomData;
diff --git a/tests/ui/issues/issue-91489.rs b/tests/ui/autoref-autoderef/auto-deref-on-cow-regression-91489.rs
index 0566302c481..929e98ad719 100644
--- a/tests/ui/issues/issue-91489.rs
+++ b/tests/ui/autoref-autoderef/auto-deref-on-cow-regression-91489.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/91489
 //@ check-pass
 
 // regression test for #91489
diff --git a/tests/ui/issues/issue-9725.rs b/tests/ui/binding/struct-destructuring-repeated-bindings-9725.rs
index 360effbd119..6b0b8e37b8c 100644
--- a/tests/ui/issues/issue-9725.rs
+++ b/tests/ui/binding/struct-destructuring-repeated-bindings-9725.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/9725
 struct A { foo: isize }
 
 fn main() {
diff --git a/tests/ui/issues/issue-9725.stderr b/tests/ui/binding/struct-destructuring-repeated-bindings-9725.stderr
index 687e0cc0f3e..f4d19bed419 100644
--- a/tests/ui/issues/issue-9725.stderr
+++ b/tests/ui/binding/struct-destructuring-repeated-bindings-9725.stderr
@@ -1,11 +1,11 @@
 error[E0416]: identifier `foo` is bound more than once in the same pattern
-  --> $DIR/issue-9725.rs:4:18
+  --> $DIR/struct-destructuring-repeated-bindings-9725.rs:5:18
    |
 LL |     let A { foo, foo } = A { foo: 3 };
    |                  ^^^ used in a pattern more than once
 
 error[E0025]: field `foo` bound multiple times in the pattern
-  --> $DIR/issue-9725.rs:4:18
+  --> $DIR/struct-destructuring-repeated-bindings-9725.rs:5:18
    |
 LL |     let A { foo, foo } = A { foo: 3 };
    |             ---  ^^^ multiple uses of `foo` in pattern
diff --git a/tests/ui/issues/issue-9942.rs b/tests/ui/cast/constant-expression-cast-9942.rs
index 6332d9b3e08..d0a6f27b7e3 100644
--- a/tests/ui/issues/issue-9942.rs
+++ b/tests/ui/cast/constant-expression-cast-9942.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/9942
 //@ run-pass
 
 pub fn main() {
diff --git a/tests/ui/issues/issue-9129.rs b/tests/ui/closures/closure-type-inference-in-context-9129.rs
index 3856cd133e8..53ee8faab85 100644
--- a/tests/ui/issues/issue-9129.rs
+++ b/tests/ui/closures/closure-type-inference-in-context-9129.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/9129
 //@ run-pass
 #![allow(dead_code)]
 #![allow(non_camel_case_types)]
diff --git a/tests/ui/issues/issue-9951.rs b/tests/ui/coercion/trait-object-coercion-distribution-9951.rs
index 2cd7cd4f430..526d6561510 100644
--- a/tests/ui/issues/issue-9951.rs
+++ b/tests/ui/coercion/trait-object-coercion-distribution-9951.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/9951
 //@ run-pass
 
 #![allow(unused_variables)]
diff --git a/tests/ui/issues/issue-9951.stderr b/tests/ui/coercion/trait-object-coercion-distribution-9951.stderr
index 62ed9f3e0cc..0c672aa9b33 100644
--- a/tests/ui/issues/issue-9951.stderr
+++ b/tests/ui/coercion/trait-object-coercion-distribution-9951.stderr
@@ -1,5 +1,5 @@
 warning: method `noop` is never used
-  --> $DIR/issue-9951.rs:6:6
+  --> $DIR/trait-object-coercion-distribution-9951.rs:7:6
    |
 LL | trait Bar {
    |       --- method in this trait
diff --git a/tests/ui/issues/issue-98299.rs b/tests/ui/const-generics/try-from-with-const-genericsrs-98299.rs
index ba63d963475..49c88856bc9 100644
--- a/tests/ui/issues/issue-98299.rs
+++ b/tests/ui/const-generics/try-from-with-const-genericsrs-98299.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/98299
 use std::convert::TryFrom;
 
 pub fn test_usage(p: ()) {
diff --git a/tests/ui/issues/issue-98299.stderr b/tests/ui/const-generics/try-from-with-const-genericsrs-98299.stderr
index b645267e3b9..1557b83b00e 100644
--- a/tests/ui/issues/issue-98299.stderr
+++ b/tests/ui/const-generics/try-from-with-const-genericsrs-98299.stderr
@@ -1,5 +1,5 @@
 error[E0284]: type annotations needed for `SmallCString<_>`
-  --> $DIR/issue-98299.rs:4:36
+  --> $DIR/try-from-with-const-genericsrs-98299.rs:5:36
    |
 LL |     SmallCString::try_from(p).map(|cstr| cstr);
    |     ------------                   ^^^^
@@ -7,7 +7,7 @@ LL |     SmallCString::try_from(p).map(|cstr| cstr);
    |     type must be known at this point
    |
 note: required by a const generic parameter in `SmallCString`
-  --> $DIR/issue-98299.rs:10:25
+  --> $DIR/try-from-with-const-genericsrs-98299.rs:11:25
    |
 LL | pub struct SmallCString<const N: usize> {}
    |                         ^^^^^^^^^^^^^^ required by this const generic parameter in `SmallCString`
@@ -17,7 +17,7 @@ LL |     SmallCString::try_from(p).map(|cstr: SmallCString<N>| cstr);
    |                                        +++++++++++++++++
 
 error[E0284]: type annotations needed for `SmallCString<_>`
-  --> $DIR/issue-98299.rs:4:36
+  --> $DIR/try-from-with-const-genericsrs-98299.rs:5:36
    |
 LL |     SmallCString::try_from(p).map(|cstr| cstr);
    |     ------------                   ^^^^
@@ -25,7 +25,7 @@ LL |     SmallCString::try_from(p).map(|cstr| cstr);
    |     type must be known at this point
    |
 note: required for `SmallCString<_>` to implement `TryFrom<()>`
-  --> $DIR/issue-98299.rs:12:22
+  --> $DIR/try-from-with-const-genericsrs-98299.rs:13:22
    |
 LL | impl<const N: usize> TryFrom<()> for SmallCString<N> {
    |      --------------  ^^^^^^^^^^^     ^^^^^^^^^^^^^^^
@@ -37,7 +37,7 @@ LL |     SmallCString::try_from(p).map(|cstr: SmallCString<N>| cstr);
    |                                        +++++++++++++++++
 
 error[E0284]: type annotations needed for `SmallCString<_>`
-  --> $DIR/issue-98299.rs:4:36
+  --> $DIR/try-from-with-const-genericsrs-98299.rs:5:36
    |
 LL |     SmallCString::try_from(p).map(|cstr| cstr);
    |     -------------------------      ^^^^
@@ -45,7 +45,7 @@ LL |     SmallCString::try_from(p).map(|cstr| cstr);
    |     type must be known at this point
    |
 note: required for `SmallCString<_>` to implement `TryFrom<()>`
-  --> $DIR/issue-98299.rs:12:22
+  --> $DIR/try-from-with-const-genericsrs-98299.rs:13:22
    |
 LL | impl<const N: usize> TryFrom<()> for SmallCString<N> {
    |      --------------  ^^^^^^^^^^^     ^^^^^^^^^^^^^^^
diff --git a/tests/ui/issues/auxiliary/issue-9155.rs b/tests/ui/cross-crate/auxiliary/aux-9155.rs
index 049a96a655a..049a96a655a 100644
--- a/tests/ui/issues/auxiliary/issue-9155.rs
+++ b/tests/ui/cross-crate/auxiliary/aux-9155.rs
diff --git a/tests/ui/issues/auxiliary/issue-9906.rs b/tests/ui/cross-crate/auxiliary/aux-9906.rs
index 8a3eea790a2..8a3eea790a2 100644
--- a/tests/ui/issues/auxiliary/issue-9906.rs
+++ b/tests/ui/cross-crate/auxiliary/aux-9906.rs
diff --git a/tests/ui/cross-crate/generic-newtypes-cross-crate-usage-9155.rs b/tests/ui/cross-crate/generic-newtypes-cross-crate-usage-9155.rs
new file mode 100644
index 00000000000..35286615980
--- /dev/null
+++ b/tests/ui/cross-crate/generic-newtypes-cross-crate-usage-9155.rs
@@ -0,0 +1,11 @@
+// https://github.com/rust-lang/rust/issues/9155
+//@ run-pass
+//@ aux-build:aux-9155.rs
+
+extern crate aux_9155;
+
+struct Baz;
+
+pub fn main() {
+    aux_9155::Foo::new(Baz);
+}
diff --git a/tests/ui/cross-crate/reexported-structs-impls-link-error-9906.rs b/tests/ui/cross-crate/reexported-structs-impls-link-error-9906.rs
new file mode 100644
index 00000000000..b49951bd1f9
--- /dev/null
+++ b/tests/ui/cross-crate/reexported-structs-impls-link-error-9906.rs
@@ -0,0 +1,10 @@
+// https://github.com/rust-lang/rust/issues/9906
+//@ run-pass
+//@ aux-build:aux-9906.rs
+
+extern crate aux_9906 as testmod;
+
+pub fn main() {
+    testmod::foo();
+    testmod::FooBar::new(1);
+}
diff --git a/tests/ui/issues/issue-22992.rs b/tests/ui/deref/dereferenceable-type-behavior-22992.rs
index 3bc15cc948a..19fc2e7eb0b 100644
--- a/tests/ui/issues/issue-22992.rs
+++ b/tests/ui/deref/dereferenceable-type-behavior-22992.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/22992
 //@ run-pass
 
 struct X { val: i32 }
@@ -6,7 +7,6 @@ impl std::ops::Deref for X {
     fn deref(&self) -> &i32 { &self.val }
 }
 
-
 trait            M                   { fn m(self); }
 impl             M for i32           { fn m(self) { println!("i32::m()"); } }
 impl             M for X             { fn m(self) { println!("X::m()"); } }
diff --git a/tests/ui/issues/issue-25549-multiple-drop.rs b/tests/ui/drop/multiple-drop-safe-code-25549.rs
index 1eec15a4aa2..dcf7a3fc79c 100644
--- a/tests/ui/issues/issue-25549-multiple-drop.rs
+++ b/tests/ui/drop/multiple-drop-safe-code-25549.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/25549
 //@ run-pass
 #![allow(unused_variables)]
 struct Foo<'r>(&'r mut i32);
diff --git a/tests/ui/issues/issue-9243.rs b/tests/ui/drop/static-variable-with-drop-trait-9243.rs
index 34ae944d1d8..0ae32c983e9 100644
--- a/tests/ui/issues/issue-9243.rs
+++ b/tests/ui/drop/static-variable-with-drop-trait-9243.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/9243
 //@ build-pass
 #![allow(dead_code)]
 // Regression test for issue 9243
diff --git a/tests/ui/issues/issue-53333.rs b/tests/ui/editions/edition-specific-identifier-shadowing-53333.rs
index 468b7d8075f..dd973bb8439 100644
--- a/tests/ui/issues/issue-53333.rs
+++ b/tests/ui/editions/edition-specific-identifier-shadowing-53333.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/53333
 //@ run-pass
 #![allow(unused_imports)]
 //@ edition:2018
diff --git a/tests/ui/issues/issue-9837.rs b/tests/ui/enum-discriminant/enum-discriminant-const-eval-truncation-9837.rs
index 33152a5d077..8768d81b93f 100644
--- a/tests/ui/issues/issue-9837.rs
+++ b/tests/ui/enum-discriminant/enum-discriminant-const-eval-truncation-9837.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/9837
 //@ run-pass
 const C1: i32 = 0x12345678;
 const C2: isize = C1 as i16 as isize;
diff --git a/tests/ui/issues/issue-9814.rs b/tests/ui/enum/single-variant-enum-deref-error-9814.rs
index a87478e221b..f10d665299c 100644
--- a/tests/ui/issues/issue-9814.rs
+++ b/tests/ui/enum/single-variant-enum-deref-error-9814.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/9814
 // Verify that single-variant enums can't be de-referenced
 // Regression test for issue #9814
 
diff --git a/tests/ui/issues/issue-9814.stderr b/tests/ui/enum/single-variant-enum-deref-error-9814.stderr
index fa23fb7c176..5e069f4c21d 100644
--- a/tests/ui/issues/issue-9814.stderr
+++ b/tests/ui/enum/single-variant-enum-deref-error-9814.stderr
@@ -1,5 +1,5 @@
 error[E0614]: type `Foo` cannot be dereferenced
-  --> $DIR/issue-9814.rs:7:13
+  --> $DIR/single-variant-enum-deref-error-9814.rs:8:13
    |
 LL |     let _ = *Foo::Bar(2);
    |             ^^^^^^^^^^^^ can't be dereferenced
diff --git a/tests/ui/issues/issue-3037.rs b/tests/ui/enum/zero-variant-enum-pattern-matching-3037.rs
index 933b450ac8e..7a7abb1c67c 100644
--- a/tests/ui/issues/issue-3037.rs
+++ b/tests/ui/enum/zero-variant-enum-pattern-matching-3037.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/3037
 //@ run-pass
 #![allow(dead_code)]
 #![allow(non_camel_case_types)]
diff --git a/tests/ui/issues/auxiliary/issue-9968.rs b/tests/ui/imports/auxiliary/aux-9968.rs
index 8d795b59ea8..8d795b59ea8 100644
--- a/tests/ui/issues/auxiliary/issue-9968.rs
+++ b/tests/ui/imports/auxiliary/aux-9968.rs
diff --git a/tests/ui/imports/pub-use-link-errors-9968.rs b/tests/ui/imports/pub-use-link-errors-9968.rs
new file mode 100644
index 00000000000..517a0049ce0
--- /dev/null
+++ b/tests/ui/imports/pub-use-link-errors-9968.rs
@@ -0,0 +1,12 @@
+// https://github.com/rust-lang/rust/issues/9968
+//@ run-pass
+//@ aux-build:aux-9968.rs
+
+extern crate aux_9968 as lib;
+
+use lib::{Trait, Struct};
+
+pub fn main()
+{
+    Struct::init().test();
+}
diff --git a/tests/ui/issues/issue-9155.rs b/tests/ui/issues/issue-9155.rs
deleted file mode 100644
index dfd9dea2009..00000000000
--- a/tests/ui/issues/issue-9155.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-//@ run-pass
-//@ aux-build:issue-9155.rs
-
-
-extern crate issue_9155;
-
-struct Baz;
-
-pub fn main() {
-    issue_9155::Foo::new(Baz);
-}
diff --git a/tests/ui/issues/issue-9906.rs b/tests/ui/issues/issue-9906.rs
deleted file mode 100644
index 50417d3e456..00000000000
--- a/tests/ui/issues/issue-9906.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-//@ run-pass
-//@ aux-build:issue-9906.rs
-
-
-extern crate issue_9906 as testmod;
-
-pub fn main() {
-    testmod::foo();
-    testmod::FooBar::new(1);
-}
diff --git a/tests/ui/issues/issue-9968.rs b/tests/ui/issues/issue-9968.rs
deleted file mode 100644
index 89e60ba5ac7..00000000000
--- a/tests/ui/issues/issue-9968.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-//@ run-pass
-//@ aux-build:issue-9968.rs
-
-
-extern crate issue_9968 as lib;
-
-use lib::{Trait, Struct};
-
-pub fn main()
-{
-    Struct::init().test();
-}
diff --git a/tests/ui/issues/issue-21655.rs b/tests/ui/iterators/for-loop-over-mut-iterator-21655.rs
index 1068b28b338..b5c9826bd45 100644
--- a/tests/ui/issues/issue-21655.rs
+++ b/tests/ui/iterators/for-loop-over-mut-iterator-21655.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/21655
 //@ run-pass
 
 fn test(it: &mut dyn Iterator<Item=i32>) {
diff --git a/tests/ui/issues/issue-9259.rs b/tests/ui/lifetimes/struct-with-lifetime-parameters-9259.rs
index c45288f7d65..7e39fdc3f10 100644
--- a/tests/ui/issues/issue-9259.rs
+++ b/tests/ui/lifetimes/struct-with-lifetime-parameters-9259.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/9259
 //@ run-pass
 #![allow(dead_code)]
 
diff --git a/tests/ui/issues/issue-29710.rs b/tests/ui/lint/unused-results-lint-triggered-by-derive-debug-29710.rs
index 906ffe9e77b..51702f69c20 100644
--- a/tests/ui/issues/issue-29710.rs
+++ b/tests/ui/lint/unused-results-lint-triggered-by-derive-debug-29710.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/29710
 //@ check-pass
 #![deny(unused_results)]
 #![allow(dead_code)]
diff --git a/tests/ui/issues/issue-9047.rs b/tests/ui/loops/loop-with-label-9047.rs
index 97733588d51..29e6dba0b9e 100644
--- a/tests/ui/issues/issue-9047.rs
+++ b/tests/ui/loops/loop-with-label-9047.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/9047
 //@ run-pass
 #![allow(unused_mut)]
 #![allow(unused_variables)]
diff --git a/tests/ui/issues/issue-9110.rs b/tests/ui/macros/macro-expansion-module-structure-9110.rs
index 47533dc43b5..b6241a7c18e 100644
--- a/tests/ui/issues/issue-9110.rs
+++ b/tests/ui/macros/macro-expansion-module-structure-9110.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/9110
 //@ check-pass
 #![allow(dead_code)]
 #![allow(non_snake_case)]
diff --git a/tests/ui/issues/issue-9737.rs b/tests/ui/macros/macro-invocation-with-variable-in-scope-9737.rs
index a8a17e58dd6..957c2e3f103 100644
--- a/tests/ui/issues/issue-9737.rs
+++ b/tests/ui/macros/macro-invocation-with-variable-in-scope-9737.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/9737
 //@ run-pass
 #![allow(unused_variables)]
 macro_rules! f {
diff --git a/tests/ui/issues/issue-25386.rs b/tests/ui/macros/private-struct-member-macro-access-25386.rs
index b26cc77680d..88e5a22a699 100644
--- a/tests/ui/issues/issue-25386.rs
+++ b/tests/ui/macros/private-struct-member-macro-access-25386.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/25386
 mod stuff {
     pub struct Item {
         c_object: Box<CObj>,
diff --git a/tests/ui/issues/issue-25386.stderr b/tests/ui/macros/private-struct-member-macro-access-25386.stderr
index 720b77866a5..d02a41848f4 100644
--- a/tests/ui/issues/issue-25386.stderr
+++ b/tests/ui/macros/private-struct-member-macro-access-25386.stderr
@@ -1,5 +1,5 @@
 error[E0616]: field `c_object` of struct `Item` is private
-  --> $DIR/issue-25386.rs:19:16
+  --> $DIR/private-struct-member-macro-access-25386.rs:20:16
    |
 LL |         (*$var.c_object).$member.is_some()
    |                ^^^^^^^^ private field
diff --git a/tests/ui/issues/issue-92741.fixed b/tests/ui/mismatched_types/newlines-in-diagnostic-fix-suggestions-92741.fixed
index cb37d25273f..c165779e402 100644
--- a/tests/ui/issues/issue-92741.fixed
+++ b/tests/ui/mismatched_types/newlines-in-diagnostic-fix-suggestions-92741.fixed
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/92741
 //@ run-rustfix
 fn main() {}
 fn _foo() -> bool {
diff --git a/tests/ui/issues/issue-92741.rs b/tests/ui/mismatched_types/newlines-in-diagnostic-fix-suggestions-92741.rs
index 1c5d5810a57..b3fa5f77308 100644
--- a/tests/ui/issues/issue-92741.rs
+++ b/tests/ui/mismatched_types/newlines-in-diagnostic-fix-suggestions-92741.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/92741
 //@ run-rustfix
 fn main() {}
 fn _foo() -> bool {
diff --git a/tests/ui/issues/issue-92741.stderr b/tests/ui/mismatched_types/newlines-in-diagnostic-fix-suggestions-92741.stderr
index 49315e7a8bf..60917d9a63e 100644
--- a/tests/ui/issues/issue-92741.stderr
+++ b/tests/ui/mismatched_types/newlines-in-diagnostic-fix-suggestions-92741.stderr
@@ -1,5 +1,5 @@
 error[E0308]: mismatched types
-  --> $DIR/issue-92741.rs:4:5
+  --> $DIR/newlines-in-diagnostic-fix-suggestions-92741.rs:5:5
    |
 LL |   fn _foo() -> bool {
    |                ---- expected `bool` because of return type
@@ -15,7 +15,7 @@ LL -     mut
    |
 
 error[E0308]: mismatched types
-  --> $DIR/issue-92741.rs:10:5
+  --> $DIR/newlines-in-diagnostic-fix-suggestions-92741.rs:11:5
    |
 LL |   fn _bar() -> bool {
    |                ---- expected `bool` because of return type
@@ -31,7 +31,7 @@ LL +     if true { true } else { false }
    |
 
 error[E0308]: mismatched types
-  --> $DIR/issue-92741.rs:15:5
+  --> $DIR/newlines-in-diagnostic-fix-suggestions-92741.rs:16:5
    |
 LL |   fn _baz() -> bool {
    |                ---- expected `bool` because of return type
diff --git a/tests/ui/issues/issue-99838.rs b/tests/ui/packed/misaligned-reference-drop-field-99838.rs
index 687b47fbe71..58e168162cb 100644
--- a/tests/ui/issues/issue-99838.rs
+++ b/tests/ui/packed/misaligned-reference-drop-field-99838.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/99838
 //@ run-pass
 
 use std::hint;
diff --git a/tests/ui/issues/issue-pr29383.rs b/tests/ui/pattern/unit-variant-pattern-matching-29383.rs
index 2bcc0aa2782..e339dc01f46 100644
--- a/tests/ui/issues/issue-pr29383.rs
+++ b/tests/ui/pattern/unit-variant-pattern-matching-29383.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/29383
 enum E {
     A,
     B,
diff --git a/tests/ui/issues/issue-pr29383.stderr b/tests/ui/pattern/unit-variant-pattern-matching-29383.stderr
index 57783d75ba1..e30837568a5 100644
--- a/tests/ui/issues/issue-pr29383.stderr
+++ b/tests/ui/pattern/unit-variant-pattern-matching-29383.stderr
@@ -1,5 +1,5 @@
 error[E0532]: expected tuple struct or tuple variant, found unit variant `E::A`
-  --> $DIR/issue-pr29383.rs:9:14
+  --> $DIR/unit-variant-pattern-matching-29383.rs:10:14
    |
 LL |     A,
    |     - `E::A` defined here
@@ -8,7 +8,7 @@ LL |         Some(E::A(..)) => {}
    |              ^^^^^^^^ help: use this syntax instead: `E::A`
 
 error[E0532]: expected tuple struct or tuple variant, found unit variant `E::B`
-  --> $DIR/issue-pr29383.rs:11:14
+  --> $DIR/unit-variant-pattern-matching-29383.rs:12:14
    |
 LL |     B,
    |     - `E::B` defined here
diff --git a/tests/ui/issues/issue-9249.rs b/tests/ui/static/static-string-slice-9249.rs
index b98ba050521..da099117bd4 100644
--- a/tests/ui/issues/issue-9249.rs
+++ b/tests/ui/static/static-string-slice-9249.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/9249
 //@ check-pass
 #![allow(dead_code)]
 
diff --git a/tests/ui/issues/issue-24365.rs b/tests/ui/structs/struct-field-access-errors-24365.rs
index da195116047..13a95cd1cca 100644
--- a/tests/ui/issues/issue-24365.rs
+++ b/tests/ui/structs/struct-field-access-errors-24365.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/24365
 pub enum Attribute {
     Code {attr_name_idx: u16},
 }
diff --git a/tests/ui/issues/issue-24365.stderr b/tests/ui/structs/struct-field-access-errors-24365.stderr
index 3f6ed0231d8..65275af4701 100644
--- a/tests/ui/issues/issue-24365.stderr
+++ b/tests/ui/structs/struct-field-access-errors-24365.stderr
@@ -1,17 +1,17 @@
 error[E0609]: no field `b` on type `Foo`
-  --> $DIR/issue-24365.rs:10:22
+  --> $DIR/struct-field-access-errors-24365.rs:11:22
    |
 LL |     println!("{}", a.b);
    |                      ^ unknown field
 
 error[E0609]: no field `attr_name_idx` on type `&Attribute`
-  --> $DIR/issue-24365.rs:17:18
+  --> $DIR/struct-field-access-errors-24365.rs:18:18
    |
 LL |     let z = (&x).attr_name_idx;
    |                  ^^^^^^^^^^^^^ unknown field
 
 error[E0609]: no field `attr_name_idx` on type `Attribute`
-  --> $DIR/issue-24365.rs:18:15
+  --> $DIR/struct-field-access-errors-24365.rs:19:15
    |
 LL |     let y = x.attr_name_idx;
    |               ^^^^^^^^^^^^^ unknown field
diff --git a/tests/ui/issues/issue-30756.rs b/tests/ui/thread-local/thread-local-with-attributes-30756.rs
index d103776406c..fcf7bb813c8 100644
--- a/tests/ui/issues/issue-30756.rs
+++ b/tests/ui/thread-local/thread-local-with-attributes-30756.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/30756
 //@ run-pass
 #![forbid(unsafe_code)]
 
diff --git a/tests/ui/issues/issue-30236.rs b/tests/ui/typeck/unused-type-parameter-span-30236.rs
index 08d08a54402..bcdc922a71b 100644
--- a/tests/ui/issues/issue-30236.rs
+++ b/tests/ui/typeck/unused-type-parameter-span-30236.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/30236
 type Foo<
     Unused //~ ERROR type parameter `Unused` is never used
     > = u8;
diff --git a/tests/ui/issues/issue-30236.stderr b/tests/ui/typeck/unused-type-parameter-span-30236.stderr
index bfe374a653f..038bd1ebd28 100644
--- a/tests/ui/issues/issue-30236.stderr
+++ b/tests/ui/typeck/unused-type-parameter-span-30236.stderr
@@ -1,5 +1,5 @@
 error[E0091]: type parameter `Unused` is never used
-  --> $DIR/issue-30236.rs:2:5
+  --> $DIR/unused-type-parameter-span-30236.rs:3:5
    |
 LL |     Unused
    |     ^^^^^^ unused type parameter
diff --git a/tests/ui/issues/issue-88150.rs b/tests/ui/uninhabited/uninhabited-type-layout-computation-88150.rs
index 1dadba307c0..1387c5b6c10 100644
--- a/tests/ui/issues/issue-88150.rs
+++ b/tests/ui/uninhabited/uninhabited-type-layout-computation-88150.rs
@@ -1,3 +1,4 @@
+// https://github.com/rust-lang/rust/issues/88150
 //@ run-pass
 //@ compile-flags:-C debuginfo=2
 //@ edition:2018