about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-05-21 00:46:30 +0000
committerbors <bors@rust-lang.org>2024-05-21 00:46:30 +0000
commit8e7517d99a8aaab02b512483ae91f8b79553fa3d (patch)
tree5ea87447eb3301f4f5248921740fef70842bfebd /tests
parent60faa271d9f11474caa68de6fe44ff502437f9e1 (diff)
parent63fa01eb094a5894fb3d9c776426749c8372f94e (diff)
downloadrust-8e7517d99a8aaab02b512483ae91f8b79553fa3d.tar.gz
rust-8e7517d99a8aaab02b512483ae91f8b79553fa3d.zip
Auto merge of #125349 - matthiaskrgr:rollup-p2mbdxi, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #124050 (Remove libc from MSVC targets)
 - #124283 (Note for E0599 if shadowed bindings has the method.)
 - #125123 (Fix `read_exact` and `read_buf_exact` for `&[u8]` and `io:Cursor`)
 - #125158 (hir pretty: fix block indent)
 - #125308 (track cycle participants per root)
 - #125332 (Update books)
 - #125333 (switch to the default implementation of `write_vectored`)
 - #125346 (Remove some `Path::to_str` from `rustc_codegen_llvm`)

Failed merges:

 - #125310 (Move ~100 tests from tests/ui to subdirs)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'tests')
-rw-r--r--tests/incremental/foreign.rs27
-rw-r--r--tests/pretty/issue-4264.pp46
-rw-r--r--tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs5
-rw-r--r--tests/run-make/link-path-order/main.rs6
-rw-r--r--tests/ui/attributes/rustc_confusables_std_cases.stderr8
-rw-r--r--tests/ui/derives/deriving-with-repr-packed-2.stderr8
-rw-r--r--tests/ui/env-null-vars.rs14
-rw-r--r--tests/ui/error-codes/E0259.rs4
-rw-r--r--tests/ui/error-codes/E0259.stderr4
-rw-r--r--tests/ui/feature-gates/rustc-private.rs2
-rw-r--r--tests/ui/feature-gates/rustc-private.stderr4
-rw-r--r--tests/ui/foreign/foreign-fn-linkname.rs10
-rw-r--r--tests/ui/foreign/foreign2.rs30
-rw-r--r--tests/ui/imports/issue-37887.rs4
-rw-r--r--tests/ui/imports/issue-37887.stderr16
-rw-r--r--tests/ui/lint/unnecessary-extern-crate.rs14
-rw-r--r--tests/ui/lint/unnecessary-extern-crate.stderr12
-rw-r--r--tests/ui/match/issue-82392.stdout14
-rw-r--r--tests/ui/meta/no_std-extern-libc.rs1
-rw-r--r--tests/ui/methods/issues/account-for-shadowed-bindings-issue-123558.rs7
-rw-r--r--tests/ui/methods/issues/account-for-shadowed-bindings-issue-123558.stderr17
-rw-r--r--tests/ui/process/no-stdio.rs8
-rw-r--r--tests/ui/runtime/on-broken-pipe/error.rs1
-rw-r--r--tests/ui/runtime/on-broken-pipe/inherit.rs1
-rw-r--r--tests/ui/runtime/on-broken-pipe/kill.rs1
-rw-r--r--tests/ui/runtime/on-broken-pipe/not-used.rs1
-rw-r--r--tests/ui/runtime/on-broken-pipe/with-rustc_main.rs1
-rw-r--r--tests/ui/runtime/out-of-stack.rs7
-rw-r--r--tests/ui/runtime/stdout-during-shutdown-unix.rs (renamed from tests/ui/runtime/stdout-during-shutdown.rs)1
-rw-r--r--tests/ui/runtime/stdout-during-shutdown-unix.run.stdout (renamed from tests/ui/runtime/stdout-during-shutdown.run.stdout)0
-rw-r--r--tests/ui/runtime/stdout-during-shutdown-windows.rs20
-rw-r--r--tests/ui/runtime/stdout-during-shutdown-windows.run.stdout1
-rw-r--r--tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr4
-rw-r--r--tests/ui/traits/next-solver/cycles/coinduction/incompleteness-unstable-result.rs2
-rw-r--r--tests/ui/traits/next-solver/cycles/coinduction/incompleteness-unstable-result.with.stderr (renamed from tests/ui/traits/next-solver/cycles/coinduction/incompleteness-unstable-result.stderr)6
-rw-r--r--tests/ui/traits/next-solver/cycles/coinduction/incompleteness-unstable-result.without.stderr26
-rw-r--r--tests/ui/type-alias-impl-trait/issue-60662.stdout4
-rw-r--r--tests/ui/unpretty/bad-literal.stdout4
-rw-r--r--tests/ui/unpretty/box.stdout8
-rw-r--r--tests/ui/unpretty/flattened-format-args.stdout14
-rw-r--r--tests/ui/unpretty/let-else-hir.stdout10
-rw-r--r--tests/ui/wait-forked-but-failed-child.rs3
42 files changed, 228 insertions, 148 deletions
diff --git a/tests/incremental/foreign.rs b/tests/incremental/foreign.rs
index cb040fe1296..1af203e9b77 100644
--- a/tests/incremental/foreign.rs
+++ b/tests/incremental/foreign.rs
@@ -1,38 +1,21 @@
 // Test what happens we save incremental compilation state that makes
 // use of foreign items. This used to ICE (#34991).
-//@ ignore-sgx no libc
-
 //@ revisions: rpass1
 
-#![feature(rustc_private)]
-
-extern crate libc;
-
 use std::ffi::CString;
 
 mod mlibc {
-    use libc::{c_char, c_long, c_longlong};
-
     extern "C" {
-        pub fn atol(x: *const c_char) -> c_long;
-        pub fn atoll(x: *const c_char) -> c_longlong;
+        // strlen is provided either by an external library or compiler-builtins as a fallback
+        pub fn strlen(x: *const std::ffi::c_char) -> usize;
     }
 }
 
-fn atol(s: String) -> isize {
-    let c = CString::new(s).unwrap();
-    unsafe { mlibc::atol(c.as_ptr()) as isize }
-}
-
-fn atoll(s: String) -> i64 {
+fn strlen(s: String) -> usize {
     let c = CString::new(s).unwrap();
-    unsafe { mlibc::atoll(c.as_ptr()) as i64 }
+    unsafe { mlibc::strlen(c.as_ptr()) }
 }
 
 pub fn main() {
-    assert_eq!(atol("1024".to_string()) * 10, atol("10240".to_string()));
-    assert_eq!(
-        (atoll("11111111111111111".to_string()) * 10),
-        atoll("111111111111111110".to_string())
-    );
+    assert_eq!(strlen("1024".to_string()), strlen("2048".to_string()));
 }
diff --git a/tests/pretty/issue-4264.pp b/tests/pretty/issue-4264.pp
index af64260d020..4d43db5716e 100644
--- a/tests/pretty/issue-4264.pp
+++ b/tests/pretty/issue-4264.pp
@@ -11,15 +11,15 @@ extern crate std;
 fn foo(_: [i32; (3 as usize)]) ({ } as ())
 
 fn bar() ({
-        const FOO: usize = ((5 as usize) - (4 as usize) as usize);
-        let _: [(); (FOO as usize)] = ([(() as ())] as [(); 1]);
+    const FOO: usize = ((5 as usize) - (4 as usize) as usize);
+    let _: [(); (FOO as usize)] = ([(() as ())] as [(); 1]);
 
-        let _: [(); (1 as usize)] = ([(() as ())] as [(); 1]);
+    let _: [(); (1 as usize)] = ([(() as ())] as [(); 1]);
 
-        let _ =
-            (((&([(1 as i32), (2 as i32), (3 as i32)] as [i32; 3]) as
-                        &[i32; 3]) as *const _ as *const [i32; 3]) as
-                *const [i32; (3 as usize)] as *const [i32; 3]);
+    let _ =
+        (((&([(1 as i32), (2 as i32), (3 as i32)] as [i32; 3]) as &[i32; 3])
+                as *const _ as *const [i32; 3]) as *const [i32; (3 as usize)]
+            as *const [i32; 3]);
 
 
 
@@ -29,17 +29,17 @@ fn bar() ({
 
 
 
-        ({
-                let res =
-                    ((::alloc::fmt::format as
-                            for<'a> fn(Arguments<'a>) -> String {format})(((format_arguments::new_const
-                                as
-                                fn(&[&'static str]) -> Arguments<'_> {Arguments::<'_>::new_const})((&([("test"
-                                            as &str)] as [&str; 1]) as &[&str; 1])) as Arguments<'_>))
-                        as String);
-                (res as String)
-            } as String);
-    } as ())
+    ({
+        let res =
+            ((::alloc::fmt::format as
+                    for<'a> fn(Arguments<'a>) -> String {format})(((format_arguments::new_const
+                        as
+                        fn(&[&'static str]) -> Arguments<'_> {Arguments::<'_>::new_const})((&([("test"
+                                    as &str)] as [&str; 1]) as &[&str; 1])) as Arguments<'_>))
+                as String);
+        (res as String)
+    } as String);
+} as ())
 type Foo = [i32; (3 as usize)];
 struct Bar {
     x: [i32; (3 as usize)],
@@ -48,9 +48,9 @@ struct TupleBar([i32; (4 as usize)]);
 enum Baz { BazVariant([i32; (5 as usize)]), }
 fn id<T>(x: T) -> T ({ (x as T) } as T)
 fn use_id() ({
-        let _ =
-            ((id::<[i32; (3 as usize)]> as
-                    fn([i32; 3]) -> [i32; 3] {id::<[i32; 3]>})(([(1 as i32),
-                        (2 as i32), (3 as i32)] as [i32; 3])) as [i32; 3]);
-    } as ())
+    let _ =
+        ((id::<[i32; (3 as usize)]> as
+                fn([i32; 3]) -> [i32; 3] {id::<[i32; 3]>})(([(1 as i32),
+                    (2 as i32), (3 as i32)] as [i32; 3])) as [i32; 3]);
+} as ())
 fn main() ({ } as ())
diff --git a/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs b/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs
index 5830ef033d3..e518579b906 100644
--- a/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs
+++ b/tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs
@@ -1,10 +1,7 @@
 #![crate_type = "staticlib"]
 #![feature(c_variadic)]
-#![feature(rustc_private)]
 
-extern crate libc;
-
-use libc::{c_char, c_double, c_int, c_long, c_longlong};
+use std::ffi::{c_char, c_double, c_int, c_long, c_longlong};
 use std::ffi::VaList;
 use std::ffi::{CString, CStr};
 
diff --git a/tests/run-make/link-path-order/main.rs b/tests/run-make/link-path-order/main.rs
index 8024e343d19..20a517dcda9 100644
--- a/tests/run-make/link-path-order/main.rs
+++ b/tests/run-make/link-path-order/main.rs
@@ -1,10 +1,8 @@
-#![feature(rustc_private)]
-
-extern crate libc;
+use std::ffi::c_int;
 
 #[link(name = "foo", kind = "static")]
 extern "C" {
-    fn should_return_one() -> libc::c_int;
+    fn should_return_one() -> c_int;
 }
 
 fn main() {
diff --git a/tests/ui/attributes/rustc_confusables_std_cases.stderr b/tests/ui/attributes/rustc_confusables_std_cases.stderr
index 45d571f435c..f4b6947ccd9 100644
--- a/tests/ui/attributes/rustc_confusables_std_cases.stderr
+++ b/tests/ui/attributes/rustc_confusables_std_cases.stderr
@@ -26,6 +26,14 @@ error[E0599]: no method named `push` found for struct `VecDeque` in the current
 LL |     x.push(1);
    |       ^^^^ method not found in `VecDeque<_>`
    |
+note: there's an earlier shadowed binding `x` of type `Vec<_>` that has method `push` available
+  --> $DIR/rustc_confusables_std_cases.rs:8:9
+   |
+LL |     let mut x = Vec::new();
+   |         ^^^^^ `x` of type `Vec<_>` that has method `push` defined earlier here
+...
+LL |     let mut x = VecDeque::new();
+   |         ----- earlier `x` shadowed here with type `VecDeque`
 help: you might have meant to use `push_back`
    |
 LL |     x.push_back(1);
diff --git a/tests/ui/derives/deriving-with-repr-packed-2.stderr b/tests/ui/derives/deriving-with-repr-packed-2.stderr
index 96f51a4e7a2..b62c67d9a9d 100644
--- a/tests/ui/derives/deriving-with-repr-packed-2.stderr
+++ b/tests/ui/derives/deriving-with-repr-packed-2.stderr
@@ -10,6 +10,14 @@ LL | struct NonCopy;
 LL |     _ = x.clone();
    |           ^^^^^ method cannot be called on `Foo<NonCopy>` due to unsatisfied trait bounds
    |
+note: there's an earlier shadowed binding `x` of type `Foo<u32>` that has method `clone` available
+  --> $DIR/deriving-with-repr-packed-2.rs:13:9
+   |
+LL |     let x: Foo<u32> = Foo(1, 2, 3);
+   |         ^ `x` of type `Foo<u32>` that has method `clone` defined earlier here
+...
+LL |     let x: Foo<NonCopy> = Foo(NonCopy, NonCopy, NonCopy);
+   |         - earlier `x` shadowed here with type `Foo<NonCopy>`
 note: the following trait bounds were not satisfied:
       `NonCopy: Clone`
       `NonCopy: Copy`
diff --git a/tests/ui/env-null-vars.rs b/tests/ui/env-null-vars.rs
index bb86fd353c4..24d783553d1 100644
--- a/tests/ui/env-null-vars.rs
+++ b/tests/ui/env-null-vars.rs
@@ -1,21 +1,15 @@
+// Ensure that env::vars() does not panic if environ is null.
+// Regression test for rust-lang/rust#53200
 //@ run-pass
 
-#![allow(unused_imports)]
-
-//@ ignore-windows
-
-// issue-53200
-
 #![feature(rustc_private)]
-extern crate libc;
-
-use std::env;
 
 // FIXME: more platforms?
 #[cfg(target_os = "linux")]
 fn main() {
+    extern crate libc;
     unsafe { libc::clearenv(); }
-    assert_eq!(env::vars().count(), 0);
+    assert_eq!(std::env::vars().count(), 0);
 }
 
 #[cfg(not(target_os = "linux"))]
diff --git a/tests/ui/error-codes/E0259.rs b/tests/ui/error-codes/E0259.rs
index e7e94d58635..78e56deccb4 100644
--- a/tests/ui/error-codes/E0259.rs
+++ b/tests/ui/error-codes/E0259.rs
@@ -1,8 +1,8 @@
-#![feature(rustc_private)]
+#![feature(test)]
 
 extern crate alloc;
 
-extern crate libc as alloc;
+extern crate test as alloc;
 //~^ ERROR E0259
 
 fn main() {}
diff --git a/tests/ui/error-codes/E0259.stderr b/tests/ui/error-codes/E0259.stderr
index 6e086268fc6..975d1a161a0 100644
--- a/tests/ui/error-codes/E0259.stderr
+++ b/tests/ui/error-codes/E0259.stderr
@@ -4,13 +4,13 @@ error[E0259]: the name `alloc` is defined multiple times
 LL | extern crate alloc;
    | ------------------- previous import of the extern crate `alloc` here
 LL |
-LL | extern crate libc as alloc;
+LL | extern crate test as alloc;
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `alloc` reimported here
    |
    = note: `alloc` must be defined only once in the type namespace of this module
 help: you can use `as` to change the binding name of the import
    |
-LL | extern crate libc as other_alloc;
+LL | extern crate test as other_alloc;
    |
 
 error: aborting due to 1 previous error
diff --git a/tests/ui/feature-gates/rustc-private.rs b/tests/ui/feature-gates/rustc-private.rs
index 7b8944bb0a0..aa44f790c8a 100644
--- a/tests/ui/feature-gates/rustc-private.rs
+++ b/tests/ui/feature-gates/rustc-private.rs
@@ -1,5 +1,5 @@
 // gate-test-rustc_private
 
-extern crate libc; //~ ERROR  use of unstable library feature 'rustc_private'
+extern crate cfg_if; //~ ERROR  use of unstable library feature 'rustc_private'
 
 fn main() {}
diff --git a/tests/ui/feature-gates/rustc-private.stderr b/tests/ui/feature-gates/rustc-private.stderr
index 03397cba763..96cc98619fd 100644
--- a/tests/ui/feature-gates/rustc-private.stderr
+++ b/tests/ui/feature-gates/rustc-private.stderr
@@ -1,8 +1,8 @@
 error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
   --> $DIR/rustc-private.rs:3:1
    |
-LL | extern crate libc;
-   | ^^^^^^^^^^^^^^^^^^
+LL | extern crate cfg_if;
+   | ^^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #27812 <https://github.com/rust-lang/rust/issues/27812> for more information
    = help: add `#![feature(rustc_private)]` to the crate attributes to enable
diff --git a/tests/ui/foreign/foreign-fn-linkname.rs b/tests/ui/foreign/foreign-fn-linkname.rs
index 47edf6fc7bb..7ced34e73fa 100644
--- a/tests/ui/foreign/foreign-fn-linkname.rs
+++ b/tests/ui/foreign/foreign-fn-linkname.rs
@@ -1,20 +1,14 @@
 //@ run-pass
 //@ ignore-sgx no libc
 
-// Ensure no false positive on "unused extern crate" lint
-#![deny(unused_extern_crates)]
-
-#![feature(rustc_private)]
-
-extern crate libc;
 use std::ffi::CString;
 
 mod mlibc {
-    use libc::{c_char, size_t};
+    use std::ffi::c_char;
 
     extern "C" {
         #[link_name = "strlen"]
-        pub fn my_strlen(str: *const c_char) -> size_t;
+        pub fn my_strlen(str: *const c_char) -> usize;
     }
 }
 
diff --git a/tests/ui/foreign/foreign2.rs b/tests/ui/foreign/foreign2.rs
index eb24df35033..178a04255cc 100644
--- a/tests/ui/foreign/foreign2.rs
+++ b/tests/ui/foreign/foreign2.rs
@@ -1,9 +1,8 @@
 //@ run-pass
-#![allow(dead_code)]
 //@ pretty-expanded FIXME #23616
-#![feature(rustc_private)]
 
-extern crate libc;
+#![allow(dead_code)]
+#![feature(rustc_private)]
 
 mod bar {
     extern "C" {}
@@ -13,14 +12,37 @@ mod zed {
     extern "C" {}
 }
 
+#[cfg(not(windows))]
 mod mlibc {
-    use libc::{c_int, c_void, size_t, ssize_t};
+    extern crate libc;
+    use self::libc::{c_int, c_void, size_t, ssize_t};
 
     extern "C" {
         pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t;
     }
 }
 
+#[cfg(windows)]
+mod mlibc {
+    #![allow(non_snake_case)]
+
+    use std::ffi::c_void;
+
+    pub type BOOL = i32;
+    pub type HANDLE = *mut c_void;
+
+    #[link(name = "ntdll")]
+    extern "system" {
+        pub fn WriteFile(
+            hfile: HANDLE,
+            lpbuffer: *const u8,
+            nnumberofbytestowrite: u32,
+            lpnumberofbyteswritten: *mut u32,
+            lpoverlapped: *mut c_void,
+        ) -> BOOL;
+    }
+}
+
 mod baz {
     extern "C" {}
 }
diff --git a/tests/ui/imports/issue-37887.rs b/tests/ui/imports/issue-37887.rs
index 58f0c6b651a..919f46d34c6 100644
--- a/tests/ui/imports/issue-37887.rs
+++ b/tests/ui/imports/issue-37887.rs
@@ -1,4 +1,4 @@
 fn main() {
-    extern crate libc; //~ ERROR use of unstable
-    use libc::*; //~ ERROR unresolved import
+    extern crate test; //~ ERROR use of unstable
+    use test::*; //~ ERROR unresolved import
 }
diff --git a/tests/ui/imports/issue-37887.stderr b/tests/ui/imports/issue-37887.stderr
index 6117fd21af1..e7792ac0d15 100644
--- a/tests/ui/imports/issue-37887.stderr
+++ b/tests/ui/imports/issue-37887.stderr
@@ -1,19 +1,19 @@
-error[E0432]: unresolved import `libc`
+error[E0432]: unresolved import `test`
   --> $DIR/issue-37887.rs:3:9
    |
-LL |     use libc::*;
-   |         ^^^^ maybe a missing crate `libc`?
+LL |     use test::*;
+   |         ^^^^ maybe a missing crate `test`?
    |
-   = help: consider adding `extern crate libc` to use the `libc` crate
+   = help: consider adding `extern crate test` to use the `test` crate
 
-error[E0658]: use of unstable library feature 'rustc_private': this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via `Cargo.toml` instead?
+error[E0658]: use of unstable library feature 'test'
   --> $DIR/issue-37887.rs:2:5
    |
-LL |     extern crate libc;
+LL |     extern crate test;
    |     ^^^^^^^^^^^^^^^^^^
    |
-   = note: see issue #27812 <https://github.com/rust-lang/rust/issues/27812> for more information
-   = help: add `#![feature(rustc_private)]` to the crate attributes to enable
+   = note: see issue #50297 <https://github.com/rust-lang/rust/issues/50297> for more information
+   = help: add `#![feature(test)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error: aborting due to 2 previous errors
diff --git a/tests/ui/lint/unnecessary-extern-crate.rs b/tests/ui/lint/unnecessary-extern-crate.rs
index 6ca3b96758f..7f97a4c469e 100644
--- a/tests/ui/lint/unnecessary-extern-crate.rs
+++ b/tests/ui/lint/unnecessary-extern-crate.rs
@@ -1,12 +1,12 @@
 //@ edition:2018
 
 #![deny(unused_extern_crates)]
-#![feature(test, rustc_private)]
+#![feature(test)]
 
-extern crate libc;
+extern crate core;
 //~^ ERROR unused extern crate
 //~| HELP remove
-extern crate libc as x;
+extern crate core as x;
 //~^ ERROR unused extern crate
 //~| HELP remove
 
@@ -28,11 +28,11 @@ mod foo {
 
     pub(super) extern crate alloc as d;
 
-    extern crate libc;
+    extern crate core;
     //~^ ERROR unused extern crate
     //~| HELP remove
 
-    extern crate libc as x;
+    extern crate core as x;
     //~^ ERROR unused extern crate
     //~| HELP remove
 
@@ -41,11 +41,11 @@ mod foo {
     pub extern crate test as y;
 
     mod bar {
-        extern crate libc;
+        extern crate core;
         //~^ ERROR unused extern crate
         //~| HELP remove
 
-        extern crate libc as x;
+        extern crate core as x;
         //~^ ERROR unused extern crate
         //~| HELP remove
 
diff --git a/tests/ui/lint/unnecessary-extern-crate.stderr b/tests/ui/lint/unnecessary-extern-crate.stderr
index 14ba9d052f4..1fa4aa9c9a9 100644
--- a/tests/ui/lint/unnecessary-extern-crate.stderr
+++ b/tests/ui/lint/unnecessary-extern-crate.stderr
@@ -1,7 +1,7 @@
 error: unused extern crate
   --> $DIR/unnecessary-extern-crate.rs:6:1
    |
-LL | extern crate libc;
+LL | extern crate core;
    | ^^^^^^^^^^^^^^^^^^ help: remove it
    |
 note: the lint level is defined here
@@ -13,31 +13,31 @@ LL | #![deny(unused_extern_crates)]
 error: unused extern crate
   --> $DIR/unnecessary-extern-crate.rs:9:1
    |
-LL | extern crate libc as x;
+LL | extern crate core as x;
    | ^^^^^^^^^^^^^^^^^^^^^^^ help: remove it
 
 error: unused extern crate
   --> $DIR/unnecessary-extern-crate.rs:31:5
    |
-LL |     extern crate libc;
+LL |     extern crate core;
    |     ^^^^^^^^^^^^^^^^^^ help: remove it
 
 error: unused extern crate
   --> $DIR/unnecessary-extern-crate.rs:35:5
    |
-LL |     extern crate libc as x;
+LL |     extern crate core as x;
    |     ^^^^^^^^^^^^^^^^^^^^^^^ help: remove it
 
 error: unused extern crate
   --> $DIR/unnecessary-extern-crate.rs:44:9
    |
-LL |         extern crate libc;
+LL |         extern crate core;
    |         ^^^^^^^^^^^^^^^^^^ help: remove it
 
 error: unused extern crate
   --> $DIR/unnecessary-extern-crate.rs:48:9
    |
-LL |         extern crate libc as x;
+LL |         extern crate core as x;
    |         ^^^^^^^^^^^^^^^^^^^^^^^ help: remove it
 
 error: aborting due to 6 previous errors
diff --git a/tests/ui/match/issue-82392.stdout b/tests/ui/match/issue-82392.stdout
index 8a23d906757..8949611ac12 100644
--- a/tests/ui/match/issue-82392.stdout
+++ b/tests/ui/match/issue-82392.stdout
@@ -7,10 +7,10 @@ extern crate std;
 //@ check-pass
 
 fn main() ({
-        (if (true as bool)
-                ({ } as
-                    ()) else if (let Some(a) =
-                       ((Some as
-                               fn(i32) -> Option<i32> {Option::<i32>::Some})((3 as i32)) as
-                           Option<i32>) as bool) ({ } as ()) as ())
-               } as ())
+    (if (true as bool)
+            ({ } as
+                ()) else if (let Some(a) =
+                   ((Some as
+                           fn(i32) -> Option<i32> {Option::<i32>::Some})((3 as i32)) as
+                       Option<i32>) as bool) ({ } as ()) as ())
+           } as ())
diff --git a/tests/ui/meta/no_std-extern-libc.rs b/tests/ui/meta/no_std-extern-libc.rs
index 919caf9428f..8b89e14382d 100644
--- a/tests/ui/meta/no_std-extern-libc.rs
+++ b/tests/ui/meta/no_std-extern-libc.rs
@@ -1,5 +1,6 @@
 // Test that `download-rustc` doesn't put duplicate copies of libc in the sysroot.
 //@ check-pass
+//@ ignore-windows doesn't necessarily have the libc crate
 #![crate_type = "lib"]
 #![no_std]
 #![feature(rustc_private)]
diff --git a/tests/ui/methods/issues/account-for-shadowed-bindings-issue-123558.rs b/tests/ui/methods/issues/account-for-shadowed-bindings-issue-123558.rs
new file mode 100644
index 00000000000..a08bbf1fdbe
--- /dev/null
+++ b/tests/ui/methods/issues/account-for-shadowed-bindings-issue-123558.rs
@@ -0,0 +1,7 @@
+fn main() {
+    let x = Some(3);
+    let y = vec![1, 2];
+    if let Some(y) = x {
+        y.push(y); //~ ERROR E0599
+    }
+}
diff --git a/tests/ui/methods/issues/account-for-shadowed-bindings-issue-123558.stderr b/tests/ui/methods/issues/account-for-shadowed-bindings-issue-123558.stderr
new file mode 100644
index 00000000000..aecad201c7b
--- /dev/null
+++ b/tests/ui/methods/issues/account-for-shadowed-bindings-issue-123558.stderr
@@ -0,0 +1,17 @@
+error[E0599]: no method named `push` found for type `{integer}` in the current scope
+  --> $DIR/account-for-shadowed-bindings-issue-123558.rs:5:11
+   |
+LL |         y.push(y);
+   |           ^^^^ method not found in `{integer}`
+   |
+note: there's an earlier shadowed binding `y` of type `Vec<{integer}>` that has method `push` available
+  --> $DIR/account-for-shadowed-bindings-issue-123558.rs:3:9
+   |
+LL |     let y = vec![1, 2];
+   |         ^ `y` of type `Vec<{integer}>` that has method `push` defined earlier here
+LL |     if let Some(y) = x {
+   |                 - earlier `y` shadowed here with type `{integer}`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0599`.
diff --git a/tests/ui/process/no-stdio.rs b/tests/ui/process/no-stdio.rs
index 05b1e52b799..8eebf6dbc7d 100644
--- a/tests/ui/process/no-stdio.rs
+++ b/tests/ui/process/no-stdio.rs
@@ -5,11 +5,13 @@
 
 #![feature(rustc_private)]
 
+#[cfg(unix)]
 extern crate libc;
 
-use std::process::{Command, Stdio};
 use std::env;
+use std::ffi::c_int;
 use std::io::{self, Read, Write};
+use std::process::{Command, Stdio};
 
 #[cfg(unix)]
 unsafe fn without_stdio<R, F: FnOnce() -> R>(f: F) -> R {
@@ -36,14 +38,14 @@ unsafe fn without_stdio<R, F: FnOnce() -> R>(f: F) -> R {
 }
 
 #[cfg(unix)]
-fn assert_fd_is_valid(fd: libc::c_int) {
+fn assert_fd_is_valid(fd: c_int) {
     if unsafe { libc::fcntl(fd, libc::F_GETFD) == -1 } {
         panic!("file descriptor {} is not valid: {}", fd, io::Error::last_os_error());
     }
 }
 
 #[cfg(windows)]
-fn assert_fd_is_valid(_fd: libc::c_int) {}
+fn assert_fd_is_valid(_fd: c_int) {}
 
 #[cfg(windows)]
 unsafe fn without_stdio<R, F: FnOnce() -> R>(f: F) -> R {
diff --git a/tests/ui/runtime/on-broken-pipe/error.rs b/tests/ui/runtime/on-broken-pipe/error.rs
index ab2036c2f41..0a020873df0 100644
--- a/tests/ui/runtime/on-broken-pipe/error.rs
+++ b/tests/ui/runtime/on-broken-pipe/error.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ aux-build:sigpipe-utils.rs
 //@ compile-flags: -Zon-broken-pipe=error
+//@ only-unix because SIGPIPE is a unix thing
 
 fn main() {
     extern crate sigpipe_utils;
diff --git a/tests/ui/runtime/on-broken-pipe/inherit.rs b/tests/ui/runtime/on-broken-pipe/inherit.rs
index 64909b73528..f3c8140eaae 100644
--- a/tests/ui/runtime/on-broken-pipe/inherit.rs
+++ b/tests/ui/runtime/on-broken-pipe/inherit.rs
@@ -4,6 +4,7 @@
 //@ aux-bin: assert-inherit-sig_ign.rs
 //@ run-pass
 //@ compile-flags: -Zon-broken-pipe=kill
+//@ only-unix because SIGPIPE is a unix thing
 
 #![feature(rustc_private)]
 
diff --git a/tests/ui/runtime/on-broken-pipe/kill.rs b/tests/ui/runtime/on-broken-pipe/kill.rs
index 5dace6f1c6f..748e53ffcdb 100644
--- a/tests/ui/runtime/on-broken-pipe/kill.rs
+++ b/tests/ui/runtime/on-broken-pipe/kill.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ aux-build:sigpipe-utils.rs
 //@ compile-flags: -Zon-broken-pipe=kill
+//@ only-unix because SIGPIPE is a unix thing
 
 fn main() {
     extern crate sigpipe_utils;
diff --git a/tests/ui/runtime/on-broken-pipe/not-used.rs b/tests/ui/runtime/on-broken-pipe/not-used.rs
index e31236f2b3d..22a26047874 100644
--- a/tests/ui/runtime/on-broken-pipe/not-used.rs
+++ b/tests/ui/runtime/on-broken-pipe/not-used.rs
@@ -1,5 +1,6 @@
 //@ run-pass
 //@ aux-build:sigpipe-utils.rs
+//@ only-unix because SIGPIPE is a unix thing
 
 fn main() {
     extern crate sigpipe_utils;
diff --git a/tests/ui/runtime/on-broken-pipe/with-rustc_main.rs b/tests/ui/runtime/on-broken-pipe/with-rustc_main.rs
index c1731200038..c40590ad87f 100644
--- a/tests/ui/runtime/on-broken-pipe/with-rustc_main.rs
+++ b/tests/ui/runtime/on-broken-pipe/with-rustc_main.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ aux-build:sigpipe-utils.rs
 //@ compile-flags: -Zon-broken-pipe=kill
+//@ only-unix because SIGPIPE is a unix thing
 
 #![feature(rustc_attrs)]
 
diff --git a/tests/ui/runtime/out-of-stack.rs b/tests/ui/runtime/out-of-stack.rs
index ab2b50b293c..a62398df8b8 100644
--- a/tests/ui/runtime/out-of-stack.rs
+++ b/tests/ui/runtime/out-of-stack.rs
@@ -8,21 +8,16 @@
 //@ ignore-fuchsia must translate zircon signal to SIGABRT, FIXME (#58590)
 //@ ignore-nto no stack overflow handler used (no alternate stack available)
 
-#![feature(core_intrinsics)]
 #![feature(rustc_private)]
 
 #[cfg(unix)]
 extern crate libc;
 
 use std::env;
+use std::hint::black_box;
 use std::process::Command;
 use std::thread;
 
-// Inlining to avoid llvm turning the recursive functions into tail calls,
-// which doesn't consume stack.
-#[inline(always)]
-pub fn black_box<T>(dummy: T) { std::intrinsics::black_box(dummy); }
-
 fn silent_recurse() {
     let buf = [0u8; 1000];
     black_box(buf);
diff --git a/tests/ui/runtime/stdout-during-shutdown.rs b/tests/ui/runtime/stdout-during-shutdown-unix.rs
index 8549f5d8eb6..8e0f1d371ae 100644
--- a/tests/ui/runtime/stdout-during-shutdown.rs
+++ b/tests/ui/runtime/stdout-during-shutdown-unix.rs
@@ -1,6 +1,7 @@
 //@ run-pass
 //@ check-run-results
 //@ ignore-emscripten
+//@ only-unix
 
 // Emscripten doesn't flush its own stdout buffers on exit, which would fail
 // this test. So this test is disabled on this platform.
diff --git a/tests/ui/runtime/stdout-during-shutdown.run.stdout b/tests/ui/runtime/stdout-during-shutdown-unix.run.stdout
index 30f51a3fba5..30f51a3fba5 100644
--- a/tests/ui/runtime/stdout-during-shutdown.run.stdout
+++ b/tests/ui/runtime/stdout-during-shutdown-unix.run.stdout
diff --git a/tests/ui/runtime/stdout-during-shutdown-windows.rs b/tests/ui/runtime/stdout-during-shutdown-windows.rs
new file mode 100644
index 00000000000..4644965b154
--- /dev/null
+++ b/tests/ui/runtime/stdout-during-shutdown-windows.rs
@@ -0,0 +1,20 @@
+//@ run-pass
+//@ check-run-results
+//@ only-windows
+
+struct Bye;
+
+impl Drop for Bye {
+    fn drop(&mut self) {
+        print!(", world!");
+    }
+}
+
+fn main() {
+    thread_local!{
+        static BYE: Bye = Bye;
+    }
+    BYE.with(|_| {
+        print!("hello");
+    });
+}
diff --git a/tests/ui/runtime/stdout-during-shutdown-windows.run.stdout b/tests/ui/runtime/stdout-during-shutdown-windows.run.stdout
new file mode 100644
index 00000000000..30f51a3fba5
--- /dev/null
+++ b/tests/ui/runtime/stdout-during-shutdown-windows.run.stdout
@@ -0,0 +1 @@
+hello, world!
\ No newline at end of file
diff --git a/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr b/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr
index 8df0613695b..99f8dbd9a6c 100644
--- a/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr
+++ b/tests/ui/sized/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.stderr
@@ -25,8 +25,8 @@ LL +     let str::as_bytes;
    |
 
 error[E0533]: expected unit struct, unit variant or constant, found associated function `str<{
-                      fn str() { let (/*ERROR*/); }
-                  }, T>::as_bytes`
+                  fn str() { let (/*ERROR*/); }
+              }, T>::as_bytes`
   --> $DIR/ensure-overriding-bindings-in-pattern-with-ty-err-doesnt-ice.rs:2:9
    |
 LL |     let str::<{fn str() { let str::T>>::as_bytes; }}, T>::as_bytes;
diff --git a/tests/ui/traits/next-solver/cycles/coinduction/incompleteness-unstable-result.rs b/tests/ui/traits/next-solver/cycles/coinduction/incompleteness-unstable-result.rs
index 7eea81ce03c..920f8add507 100644
--- a/tests/ui/traits/next-solver/cycles/coinduction/incompleteness-unstable-result.rs
+++ b/tests/ui/traits/next-solver/cycles/coinduction/incompleteness-unstable-result.rs
@@ -1,3 +1,4 @@
+//@ revisions: with without
 //@ compile-flags: -Znext-solver
 #![feature(rustc_attrs)]
 
@@ -56,6 +57,7 @@ where
     X: IncompleteGuidance<u32, i8>,
     X: IncompleteGuidance<u32, i16>,
 {
+    #[cfg(with)]
     impls_trait::<B<X>, _, _, _>(); // entering the cycle from `B` works
 
     // entering the cycle from `A` fails, but would work if we were to use the cache
diff --git a/tests/ui/traits/next-solver/cycles/coinduction/incompleteness-unstable-result.stderr b/tests/ui/traits/next-solver/cycles/coinduction/incompleteness-unstable-result.with.stderr
index ffa3f29e4bd..a81229e5e35 100644
--- a/tests/ui/traits/next-solver/cycles/coinduction/incompleteness-unstable-result.stderr
+++ b/tests/ui/traits/next-solver/cycles/coinduction/incompleteness-unstable-result.with.stderr
@@ -1,12 +1,12 @@
 error[E0277]: the trait bound `A<X>: Trait<_, _, _>` is not satisfied
-  --> $DIR/incompleteness-unstable-result.rs:63:19
+  --> $DIR/incompleteness-unstable-result.rs:65:19
    |
 LL |     impls_trait::<A<X>, _, _, _>();
    |                   ^^^^ the trait `Trait<_, _, _>` is not implemented for `A<X>`, which is required by `A<X>: Trait<_, _, _>`
    |
    = help: the trait `Trait<U, V, D>` is implemented for `A<T>`
 note: required for `A<X>` to implement `Trait<_, _, _>`
-  --> $DIR/incompleteness-unstable-result.rs:32:50
+  --> $DIR/incompleteness-unstable-result.rs:33:50
    |
 LL | impl<T: ?Sized, U: ?Sized, V: ?Sized, D: ?Sized> Trait<U, V, D> for A<T>
    |                                                  ^^^^^^^^^^^^^^     ^^^^
@@ -16,7 +16,7 @@ LL |     A<T>: Trait<U, D, V>,
    = note: 8 redundant requirements hidden
    = note: required for `A<X>` to implement `Trait<_, _, _>`
 note: required by a bound in `impls_trait`
-  --> $DIR/incompleteness-unstable-result.rs:51:28
+  --> $DIR/incompleteness-unstable-result.rs:52:28
    |
 LL | fn impls_trait<T: ?Sized + Trait<U, V, D>, U: ?Sized, V: ?Sized, D: ?Sized>() {}
    |                            ^^^^^^^^^^^^^^ required by this bound in `impls_trait`
diff --git a/tests/ui/traits/next-solver/cycles/coinduction/incompleteness-unstable-result.without.stderr b/tests/ui/traits/next-solver/cycles/coinduction/incompleteness-unstable-result.without.stderr
new file mode 100644
index 00000000000..a81229e5e35
--- /dev/null
+++ b/tests/ui/traits/next-solver/cycles/coinduction/incompleteness-unstable-result.without.stderr
@@ -0,0 +1,26 @@
+error[E0277]: the trait bound `A<X>: Trait<_, _, _>` is not satisfied
+  --> $DIR/incompleteness-unstable-result.rs:65:19
+   |
+LL |     impls_trait::<A<X>, _, _, _>();
+   |                   ^^^^ the trait `Trait<_, _, _>` is not implemented for `A<X>`, which is required by `A<X>: Trait<_, _, _>`
+   |
+   = help: the trait `Trait<U, V, D>` is implemented for `A<T>`
+note: required for `A<X>` to implement `Trait<_, _, _>`
+  --> $DIR/incompleteness-unstable-result.rs:33:50
+   |
+LL | impl<T: ?Sized, U: ?Sized, V: ?Sized, D: ?Sized> Trait<U, V, D> for A<T>
+   |                                                  ^^^^^^^^^^^^^^     ^^^^
+...
+LL |     A<T>: Trait<U, D, V>,
+   |           -------------- unsatisfied trait bound introduced here
+   = note: 8 redundant requirements hidden
+   = note: required for `A<X>` to implement `Trait<_, _, _>`
+note: required by a bound in `impls_trait`
+  --> $DIR/incompleteness-unstable-result.rs:52:28
+   |
+LL | fn impls_trait<T: ?Sized + Trait<U, V, D>, U: ?Sized, V: ?Sized, D: ?Sized>() {}
+   |                            ^^^^^^^^^^^^^^ required by this bound in `impls_trait`
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0277`.
diff --git a/tests/ui/type-alias-impl-trait/issue-60662.stdout b/tests/ui/type-alias-impl-trait/issue-60662.stdout
index e643dba1245..b541cbeb227 100644
--- a/tests/ui/type-alias-impl-trait/issue-60662.stdout
+++ b/tests/ui/type-alias-impl-trait/issue-60662.stdout
@@ -10,5 +10,5 @@ extern crate std;
 trait Animal { }
 
 fn main() {
-        type ServeFut = /*impl Trait*/;
-    }
+    type ServeFut = /*impl Trait*/;
+}
diff --git a/tests/ui/unpretty/bad-literal.stdout b/tests/ui/unpretty/bad-literal.stdout
index 07ecb99dccc..c5272711d6e 100644
--- a/tests/ui/unpretty/bad-literal.stdout
+++ b/tests/ui/unpretty/bad-literal.stdout
@@ -7,5 +7,5 @@ extern crate std;
 
 // In #100948 this caused an ICE with -Zunpretty=hir.
 fn main() {
-        <bad-literal>;
-    }
+    <bad-literal>;
+}
diff --git a/tests/ui/unpretty/box.stdout b/tests/ui/unpretty/box.stdout
index 0fd51edea24..e3b9b9ac207 100644
--- a/tests/ui/unpretty/box.stdout
+++ b/tests/ui/unpretty/box.stdout
@@ -8,7 +8,7 @@ use ::std::prelude::rust_2015::*;
 extern crate std;
 
 fn main() {
-        let _ =
-            #[rustc_box]
-            Box::new(1);
-    }
+    let _ =
+        #[rustc_box]
+        Box::new(1);
+}
diff --git a/tests/ui/unpretty/flattened-format-args.stdout b/tests/ui/unpretty/flattened-format-args.stdout
index 275fa104e66..2de1cdd96b5 100644
--- a/tests/ui/unpretty/flattened-format-args.stdout
+++ b/tests/ui/unpretty/flattened-format-args.stdout
@@ -6,10 +6,10 @@ extern crate std;
 //@ check-pass
 
 fn main() {
-        let x = 1;
-        // Should flatten to println!("a 123 b {x} xyz\n"):
-        {
-                ::std::io::_print(format_arguments::new_v1(&["a 123 b ",
-                                    " xyz\n"], &[format_argument::new_display(&x)]));
-            };
-    }
+    let x = 1;
+    // Should flatten to println!("a 123 b {x} xyz\n"):
+    {
+        ::std::io::_print(format_arguments::new_v1(&["a 123 b ", " xyz\n"],
+                &[format_argument::new_display(&x)]));
+    };
+}
diff --git a/tests/ui/unpretty/let-else-hir.stdout b/tests/ui/unpretty/let-else-hir.stdout
index ed55f293876..a2ffa5de567 100644
--- a/tests/ui/unpretty/let-else-hir.stdout
+++ b/tests/ui/unpretty/let-else-hir.stdout
@@ -9,10 +9,10 @@ extern crate std;
 
 fn foo(x:
         Option<u32>) {
-        let Some(_) = x else
-            {
+    let Some(_) = x else
+        {
 
-            { ::std::rt::begin_panic("explicit panic") }
-        };
-    }
+        { ::std::rt::begin_panic("explicit panic") }
+    };
+}
 fn main() { }
diff --git a/tests/ui/wait-forked-but-failed-child.rs b/tests/ui/wait-forked-but-failed-child.rs
index 3d052cc193c..dd6a7fa0e65 100644
--- a/tests/ui/wait-forked-but-failed-child.rs
+++ b/tests/ui/wait-forked-but-failed-child.rs
@@ -7,8 +7,6 @@
 
 #![feature(rustc_private)]
 
-extern crate libc;
-
 use std::process::Command;
 
 // The output from "ps -A -o pid,ppid,args" should look like this:
@@ -28,6 +26,7 @@ use std::process::Command;
 
 #[cfg(unix)]
 fn find_zombies() {
+    extern crate libc;
     let my_pid = unsafe { libc::getpid() };
 
     // https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ps.html