From 2bdd0755139cf7183d6c63bda16925d824640f10 Mon Sep 17 00:00:00 2001 From: ibraheemdev Date: Thu, 2 Sep 2021 16:03:41 -0400 Subject: [PATCH 01/12] implement `Termination` for `Result` --- library/std/src/process.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/library/std/src/process.rs b/library/std/src/process.rs index c9b21fcf9c6..d94b6896751 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -106,6 +106,7 @@ mod tests; use crate::io::prelude::*; +use crate::convert::Infallible; use crate::ffi::OsStr; use crate::fmt; use crate::fs; @@ -2051,6 +2052,15 @@ impl Termination for Result { } } +#[unstable(feature = "termination_trait_lib", issue = "43301")] +impl Termination for Result { + fn report(self) -> i32 { + let Err(err) = self; + eprintln!("Error: {:?}", err); + ExitCode::FAILURE.report() + } +} + #[unstable(feature = "termination_trait_lib", issue = "43301")] impl Termination for ExitCode { #[inline] From 2433d3788e7b5fe7c095316fa38e462ff8093948 Mon Sep 17 00:00:00 2001 From: Ibraheem Ahmed Date: Fri, 3 Sep 2021 11:24:25 -0400 Subject: [PATCH 02/12] simplify `impl Termination for Result` Co-authored-by: Konrad Borowski --- library/std/src/process.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/std/src/process.rs b/library/std/src/process.rs index d94b6896751..4f67cd88652 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -2056,8 +2056,7 @@ impl Termination for Result { impl Termination for Result { fn report(self) -> i32 { let Err(err) = self; - eprintln!("Error: {:?}", err); - ExitCode::FAILURE.report() + Err::(err).report() } } From caf206b8202f4d417e39c378d424bc813f60bf99 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Thu, 27 May 2021 15:13:33 -0700 Subject: [PATCH 03/12] Stabilize File::options() Renames File::with_options to File::options, per consensus in rust-lang/rust#65439, and stabilizes it. --- library/std/src/fs.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index e13add799bc..a14f1e2ecb2 100644 --- a/library/std/src/fs.rs +++ b/library/std/src/fs.rs @@ -358,7 +358,7 @@ impl File { /// /// It is equivalent to `OpenOptions::new()` but allows you to write more /// readable code. Instead of `OpenOptions::new().read(true).open("foo.txt")` - /// you can write `File::with_options().read(true).open("foo.txt")`. This + /// you can write `File::options().read(true).open("foo.txt")`. This /// also avoids the need to import `OpenOptions`. /// /// See the [`OpenOptions::new`] function for more details. @@ -366,17 +366,16 @@ impl File { /// # Examples /// /// ```no_run - /// #![feature(with_options)] /// use std::fs::File; /// /// fn main() -> std::io::Result<()> { - /// let mut f = File::with_options().read(true).open("foo.txt")?; + /// let mut f = File::options().read(true).open("foo.txt")?; /// Ok(()) /// } /// ``` #[must_use] - #[unstable(feature = "with_options", issue = "65439")] - pub fn with_options() -> OpenOptions { + #[stable(feature = "with_options", since = "1.58.0")] + pub fn options() -> OpenOptions { OpenOptions::new() } From 181716a16cfd088108463b5f9130af75a5993a93 Mon Sep 17 00:00:00 2001 From: tamaron Date: Thu, 11 Nov 2021 11:40:34 +0900 Subject: [PATCH 04/12] compare between Path instead of str --- library/std/src/fs/tests.rs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs index 628de13156c..1417d860c47 100644 --- a/library/std/src/fs/tests.rs +++ b/library/std/src/fs/tests.rs @@ -833,20 +833,11 @@ fn symlink_noexist() { fn read_link() { if cfg!(windows) { // directory symlink - assert_eq!( - check!(fs::read_link(r"C:\Users\All Users")).to_str().unwrap(), - r"C:\ProgramData" - ); + assert_eq!(check!(fs::read_link(r"C:\Users\All Users")), Path::new(r"C:\ProgramData")); // junction - assert_eq!( - check!(fs::read_link(r"C:\Users\Default User")).to_str().unwrap(), - r"C:\Users\Default" - ); + assert_eq!(check!(fs::read_link(r"C:\Users\Default User")), Path::new(r"C:\Users\Default")); // junction with special permissions - assert_eq!( - check!(fs::read_link(r"C:\Documents and Settings\")).to_str().unwrap(), - r"C:\Users" - ); + assert_eq!(check!(fs::read_link(r"C:\Documents and Settings\")), Path::new(r"C:\Users")); } let tmpdir = tmpdir(); let link = tmpdir.join("link"); From a24e2eddb1f5b1fca76eb1a3a6079188f9d54fd7 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 12 Nov 2021 09:09:08 -0800 Subject: [PATCH 05/12] Android is not GNU --- compiler/rustc_target/src/spec/android_base.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_target/src/spec/android_base.rs b/compiler/rustc_target/src/spec/android_base.rs index aaf81648c51..0f01a78c8c5 100644 --- a/compiler/rustc_target/src/spec/android_base.rs +++ b/compiler/rustc_target/src/spec/android_base.rs @@ -1,7 +1,7 @@ use crate::spec::{LinkerFlavor, TargetOptions}; pub fn opts() -> TargetOptions { - let mut base = super::linux_gnu_base::opts(); + let mut base = super::linux_base::opts(); base.os = "android".to_string(); // Many of the symbols defined in compiler-rt are also defined in libgcc. // Android's linker doesn't like that by default. From 2d46d1bec94ba9239f9c2305c574b34b853de1e5 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 12 Nov 2021 09:25:32 -0800 Subject: [PATCH 06/12] Rename WASI's `is_character_device` to `is_char_device`. Rename WASI's `FileTypeExt::is_character_device` to `FileTypeExt::is_char_device`, for consistency with the Unix `FileTypeExt::is_char_device`. Also, add a `FileTypeExt::is_socket` function, for consistency with the Unix `FileTypeExt::is_socket` function. --- library/std/src/os/wasi/fs.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/std/src/os/wasi/fs.rs b/library/std/src/os/wasi/fs.rs index 907368061d7..5c62679f552 100644 --- a/library/std/src/os/wasi/fs.rs +++ b/library/std/src/os/wasi/fs.rs @@ -444,18 +444,22 @@ pub trait FileTypeExt { /// Returns `true` if this file type is a block device. fn is_block_device(&self) -> bool; /// Returns `true` if this file type is a character device. - fn is_character_device(&self) -> bool; + fn is_char_device(&self) -> bool; /// Returns `true` if this file type is a socket datagram. fn is_socket_dgram(&self) -> bool; /// Returns `true` if this file type is a socket stream. fn is_socket_stream(&self) -> bool; + /// Returns `true` if this file type is any type of socket. + fn is_socket(&self) -> bool { + self.is_socket_stream() || self.is_socket_dgram() + } } impl FileTypeExt for fs::FileType { fn is_block_device(&self) -> bool { self.as_inner().bits() == wasi::FILETYPE_BLOCK_DEVICE } - fn is_character_device(&self) -> bool { + fn is_char_device(&self) -> bool { self.as_inner().bits() == wasi::FILETYPE_CHARACTER_DEVICE } fn is_socket_dgram(&self) -> bool { From 6323f928bf7676eb8af8230f01672f96fd9498c4 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Fri, 12 Nov 2021 17:00:47 -0800 Subject: [PATCH 07/12] Remove bigint_helper_methods for *signed* types These are working well for *unsigned* types, for the the signed ones there are a bunch of questions about what the semantics and API should be. And for the main "helpers for big integer implementations" use, there's no need for the signed versions anyway. And there are plenty of other methods which exist for unsigned types but not signed ones, like `next_power_of_two`, so this isn't unusual. Fixes 90541 --- library/core/src/num/int_macros.rs | 54 ------------------------------ library/core/src/num/mod.rs | 15 +-------- 2 files changed, 1 insertion(+), 68 deletions(-) diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 052e1a21b32..9a668d34b62 100644 --- a/library/core/src/num/int_macros.rs +++ b/library/core/src/num/int_macros.rs @@ -1511,33 +1511,6 @@ macro_rules! int_impl { (a as Self, b) } - /// Calculates `self + rhs + carry` without the ability to overflow. - /// - /// Performs "ternary addition" which takes in an extra bit to add, and may return an - /// additional bit of overflow. This allows for chaining together multiple additions - /// to create "big integers" which represent larger values. - /// - /// # Examples - /// - /// Basic usage - /// - /// ``` - /// #![feature(bigint_helper_methods)] - #[doc = concat!("assert_eq!(5", stringify!($SelfT), ".carrying_add(2, false), (7, false));")] - #[doc = concat!("assert_eq!(5", stringify!($SelfT), ".carrying_add(2, true), (8, false));")] - #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.carrying_add(1, false), (", stringify!($SelfT), "::MIN, false));")] - #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.carrying_add(1, true), (", stringify!($SelfT), "::MIN + 1, false));")] - /// ``` - #[unstable(feature = "bigint_helper_methods", issue = "85532")] - #[rustc_const_unstable(feature = "const_bigint_helper_methods", issue = "85532")] - #[must_use = "this returns the result of the operation, \ - without modifying the original"] - #[inline] - pub const fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool) { - let (sum, carry) = (self as $UnsignedT).carrying_add(rhs as $UnsignedT, carry); - (sum as $SelfT, carry) - } - /// Calculates `self` + `rhs` with an unsigned `rhs` /// /// Returns a tuple of the addition along with a boolean indicating @@ -1589,33 +1562,6 @@ macro_rules! int_impl { (a as Self, b) } - /// Calculates `self - rhs - borrow` without the ability to overflow. - /// - /// Performs "ternary subtraction" which takes in an extra bit to subtract, and may return - /// an additional bit of overflow. This allows for chaining together multiple subtractions - /// to create "big integers" which represent larger values. - /// - /// # Examples - /// - /// Basic usage - /// - /// ``` - /// #![feature(bigint_helper_methods)] - #[doc = concat!("assert_eq!(5", stringify!($SelfT), ".borrowing_sub(2, false), (3, false));")] - #[doc = concat!("assert_eq!(5", stringify!($SelfT), ".borrowing_sub(2, true), (2, false));")] - #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.borrowing_sub(1, false), (", stringify!($SelfT), "::MAX, false));")] - #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN.borrowing_sub(1, true), (", stringify!($SelfT), "::MAX - 1, false));")] - /// ``` - #[unstable(feature = "bigint_helper_methods", issue = "85532")] - #[rustc_const_unstable(feature = "const_bigint_helper_methods", issue = "85532")] - #[must_use = "this returns the result of the operation, \ - without modifying the original"] - #[inline] - pub const fn borrowing_sub(self, rhs: Self, borrow: bool) -> (Self, bool) { - let (sum, borrow) = (self as $UnsignedT).borrowing_sub(rhs as $UnsignedT, borrow); - (sum as $SelfT, borrow) - } - /// Calculates `self` - `rhs` with an unsigned `rhs` /// /// Returns a tuple of the subtraction along with a boolean indicating diff --git a/library/core/src/num/mod.rs b/library/core/src/num/mod.rs index 0c00db5fdf3..a8f2ded4659 100644 --- a/library/core/src/num/mod.rs +++ b/library/core/src/num/mod.rs @@ -95,12 +95,6 @@ depending on the target pointer size. macro_rules! widening_impl { ($SelfT:ty, $WideT:ty, $BITS:literal, unsigned) => { - widening_impl!($SelfT, $WideT, $BITS, ""); - }; - ($SelfT:ty, $WideT:ty, $BITS:literal, signed) => { - widening_impl!($SelfT, $WideT, $BITS, "# //"); - }; - ($SelfT:ty, $WideT:ty, $BITS:literal, $AdaptiveTestPrefix:literal) => { /// Calculates the complete product `self * rhs` without the possibility to overflow. /// /// This returns the low-order (wrapping) bits and the high-order (overflow) bits @@ -154,7 +148,7 @@ macro_rules! widening_impl { /// assert_eq!(5u32.carrying_mul(2, 10), (20, 0)); /// assert_eq!(1_000_000_000u32.carrying_mul(10, 0), (1410065408, 2)); /// assert_eq!(1_000_000_000u32.carrying_mul(10, 10), (1410065418, 2)); - #[doc = concat!($AdaptiveTestPrefix, "assert_eq!(", + #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.carrying_mul(", stringify!($SelfT), "::MAX, ", stringify!($SelfT), "::MAX), ", "(0, ", stringify!($SelfT), "::MAX));" )] @@ -203,14 +197,12 @@ macro_rules! widening_impl { impl i8 { int_impl! { i8, i8, u8, 8, 7, -128, 127, 2, "-0x7e", "0xa", "0x12", "0x12", "0x48", "[0x12]", "[0x12]", "", "" } - widening_impl! { i8, i16, 8, signed } } #[lang = "i16"] impl i16 { int_impl! { i16, i16, u16, 16, 15, -32768, 32767, 4, "-0x5ffd", "0x3a", "0x1234", "0x3412", "0x2c48", "[0x34, 0x12]", "[0x12, 0x34]", "", "" } - widening_impl! { i16, i32, 16, signed } } #[lang = "i32"] @@ -218,7 +210,6 @@ impl i32 { int_impl! { i32, i32, u32, 32, 31, -2147483648, 2147483647, 8, "0x10000b3", "0xb301", "0x12345678", "0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]", "[0x12, 0x34, 0x56, 0x78]", "", "" } - widening_impl! { i32, i64, 32, signed } } #[lang = "i64"] @@ -227,7 +218,6 @@ impl i64 { "0xaa00000000006e1", "0x6e10aa", "0x1234567890123456", "0x5634129078563412", "0x6a2c48091e6a2c48", "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]", "[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]", "", "" } - widening_impl! { i64, i128, 64, signed } } #[lang = "i128"] @@ -248,7 +238,6 @@ impl isize { int_impl! { isize, i16, usize, 16, 15, -32768, 32767, 4, "-0x5ffd", "0x3a", "0x1234", "0x3412", "0x2c48", "[0x34, 0x12]", "[0x12, 0x34]", usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() } - widening_impl! { isize, i32, 16, signed } } #[cfg(target_pointer_width = "32")] @@ -258,7 +247,6 @@ impl isize { "0x12345678", "0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]", "[0x12, 0x34, 0x56, 0x78]", usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() } - widening_impl! { isize, i64, 32, signed } } #[cfg(target_pointer_width = "64")] @@ -269,7 +257,6 @@ impl isize { "0x6a2c48091e6a2c48", "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]", "[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]", usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() } - widening_impl! { isize, i128, 64, signed } } /// If 6th bit set ascii is upper case. From 94ca0b392df7c0f551c136394bf3456bee041357 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 13 Nov 2021 20:55:33 -0500 Subject: [PATCH 08/12] fix ICE on Miri/CTFE copy of half a pointer --- .../rustc_const_eval/src/interpret/memory.rs | 19 +++++++------- src/test/ui/consts/issue-miri-1910.rs | 12 +++++++++ src/test/ui/consts/issue-miri-1910.stderr | 26 +++++++++++++++++++ 3 files changed, 47 insertions(+), 10 deletions(-) create mode 100644 src/test/ui/consts/issue-miri-1910.rs create mode 100644 src/test/ui/consts/issue-miri-1910.stderr diff --git a/compiler/rustc_const_eval/src/interpret/memory.rs b/compiler/rustc_const_eval/src/interpret/memory.rs index b8b6ff93753..4aa3c83cc02 100644 --- a/compiler/rustc_const_eval/src/interpret/memory.rs +++ b/compiler/rustc_const_eval/src/interpret/memory.rs @@ -1057,20 +1057,19 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> Memory<'mir, 'tcx, M> { Some(dest_ptr) => dest_ptr, }; - // first copy the relocations to a temporary buffer, because - // `get_bytes_mut` will clear the relocations, which is correct, - // since we don't want to keep any relocations at the target. - // (`get_bytes_with_uninit_and_ptr` below checks that there are no - // relocations overlapping the edges; those would not be handled correctly). - let relocations = - src_alloc.prepare_relocation_copy(self, src_range, dest_offset, num_copies); - // Prepare a copy of the initialization mask. - let compressed = src_alloc.compress_uninit_range(src_range); - // This checks relocation edges on the src. + // This checks relocation edges on the src, which needs to happen before + // `prepare_relocation_copy`. let src_bytes = src_alloc .get_bytes_with_uninit_and_ptr(&tcx, src_range) .map_err(|e| e.to_interp_error(src_alloc_id))? .as_ptr(); // raw ptr, so we can also get a ptr to the destination allocation + // first copy the relocations to a temporary buffer, because + // `get_bytes_mut` will clear the relocations, which is correct, + // since we don't want to keep any relocations at the target. + let relocations = + src_alloc.prepare_relocation_copy(self, src_range, dest_offset, num_copies); + // Prepare a copy of the initialization mask. + let compressed = src_alloc.compress_uninit_range(src_range); // Destination alloc preparations and access hooks. let (dest_alloc, extra) = self.get_raw_mut(dest_alloc_id)?; diff --git a/src/test/ui/consts/issue-miri-1910.rs b/src/test/ui/consts/issue-miri-1910.rs new file mode 100644 index 00000000000..20efa145dbe --- /dev/null +++ b/src/test/ui/consts/issue-miri-1910.rs @@ -0,0 +1,12 @@ +// error-pattern unable to turn pointer into raw bytes +#![feature(const_ptr_read)] +#![feature(const_ptr_offset)] + +const C: () = unsafe { + let foo = Some(&42 as *const i32); + let one_and_a_half_pointers = std::mem::size_of::<*const i32>()/2*3; + (&foo as *const _ as *const u8).add(one_and_a_half_pointers).read(); +}; + +fn main() { +} diff --git a/src/test/ui/consts/issue-miri-1910.stderr b/src/test/ui/consts/issue-miri-1910.stderr new file mode 100644 index 00000000000..e2f4ef63588 --- /dev/null +++ b/src/test/ui/consts/issue-miri-1910.stderr @@ -0,0 +1,26 @@ +error: any use of this value will cause an error + --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL + | +LL | copy_nonoverlapping(src, tmp.as_mut_ptr(), 1); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | unable to turn pointer into raw bytes + | inside `std::ptr::read::` at $SRC_DIR/core/src/ptr/mod.rs:LL:COL + | inside `ptr::const_ptr::::read` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL + | inside `C` at $DIR/issue-miri-1910.rs:8:5 + | + ::: $DIR/issue-miri-1910.rs:5:1 + | +LL | / const C: () = unsafe { +LL | | let foo = Some(&42 as *const i32); +LL | | let one_and_a_half_pointers = std::mem::size_of::<*const i32>()/2*3; +LL | | (&foo as *const _ as *const u8).add(one_and_a_half_pointers).read(); +LL | | }; + | |__- + | + = note: `#[deny(const_err)]` on by default + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! + = note: for more information, see issue #71800 + +error: aborting due to previous error + From 60595f7bde03c6c17a798f1aed6fb8bedd9bd3ca Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 14 Nov 2021 11:56:52 -0500 Subject: [PATCH 09/12] disable portable SIMD tests in Miri --- library/core/src/lib.rs | 2 ++ library/core/tests/simd.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 1099877a008..74ae0fb91c7 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -402,11 +402,13 @@ pub mod arch { #[allow(missing_debug_implementations, dead_code, unsafe_op_in_unsafe_fn, unused_unsafe)] #[allow(rustdoc::bare_urls)] #[unstable(feature = "portable_simd", issue = "86656")] +#[cfg(not(all(miri, doctest)))] // Miri does not support all SIMD intrinsics #[cfg(not(bootstrap))] mod core_simd; #[doc = include_str!("../../portable-simd/crates/core_simd/src/core_simd_docs.md")] #[unstable(feature = "portable_simd", issue = "86656")] +#[cfg(not(all(miri, doctest)))] // Miri does not support all SIMD intrinsics #[cfg(not(bootstrap))] pub mod simd { #[unstable(feature = "portable_simd", issue = "86656")] diff --git a/library/core/tests/simd.rs b/library/core/tests/simd.rs index 8c11d788c67..50c92968c9d 100644 --- a/library/core/tests/simd.rs +++ b/library/core/tests/simd.rs @@ -1,3 +1,5 @@ +#![cfg(not(miri))] // Miri does not support all SIMD intrinsics + use core::simd::f32x4; #[test] From ab5434f9b8d3937fe33f813b3f8e1a43a4657781 Mon Sep 17 00:00:00 2001 From: Caio Date: Sun, 14 Nov 2021 14:38:42 -0300 Subject: [PATCH 10/12] Move some tests to more reasonable directories --- .../ui/{ => abi}/c-stack-returning-int64.rs | 0 src/test/ui/{ => abi}/x86stdcall.rs | 0 src/test/ui/{ => abi}/x86stdcall2.rs | 0 .../default-alloc-error-hook.rs | 0 src/test/ui/alloca-from-derived-tydesc.rs | 15 -------------- .../associated-item-long-paths.rs | 0 .../default-associated-types.rs | 0 ...correct-move-async-order-issue-79694.fixed | 0 .../incorrect-move-async-order-issue-79694.rs | 0 ...orrect-move-async-order-issue-79694.stderr | 0 .../ui/{ => attributes}/attr-eq-token-tree.rs | 0 .../attr-eq-token-tree.stderr | 0 .../ui/{ => attributes}/tool_attributes.rs | 0 .../ui/augmented-assignments-feature-gate.rs | 15 -------------- .../ui/{ => binop}/shift-various-bad-types.rs | 0 .../shift-various-bad-types.stderr | 0 .../{ => borrowck}/access-mode-in-closures.rs | 0 .../access-mode-in-closures.stderr | 0 src/test/ui/{ => borrowck}/lazy-init.rs | 0 src/test/ui/{ => box}/new-box-syntax.rs | 0 src/test/ui/{ => cast}/codegen-object-shim.rs | 0 src/test/ui/{ => cfg}/crt-static-off-works.rs | 0 src/test/ui/{ => cfg}/expanded-cfg.rs | 0 .../ui/{ => closures}/closure-expected.rs | 0 .../ui/{ => closures}/closure-expected.stderr | 0 .../ui/{ => closures}/closure_promotion.rs | 0 .../{ => closures}/semistatement-in-lambda.rs | 0 .../thir-unsafeck-issue-85871.rs | 0 src/test/ui/{ => coercion}/unsafe-coercion.rs | 0 src/test/ui/{ => consts}/eval-enum.rs | 0 src/test/ui/{ => consts}/eval-enum.stderr | 0 .../ui/{ => drop}/auxiliary/inline_dtor.rs | 0 src/test/ui/{ => drop}/use_inline_dtor.rs | 0 .../edition-keywords-2015-2015.rs | 0 .../edition-keywords-2018-2015.rs | 0 src/test/ui/estr-uniq.rs | 15 -------------- src/test/ui/export-import.rs | 11 ---------- src/test/ui/export-import.stderr | 15 -------------- src/test/ui/export-non-interference2.rs | 11 ---------- src/test/ui/export-non-interference3.rs | 11 ---------- src/test/ui/export2.rs | 11 ---------- src/test/ui/export2.stderr | 9 --------- src/test/ui/expr-block-unique.rs | 4 ---- src/test/ui/{ => expr/if}/expr-if.rs | 0 .../auxiliary/reexport-should-still-link.rs | 0 .../{ => feature-gates}/gated-bad-feature.rs | 0 .../gated-bad-feature.stderr | 0 .../ui/{ => feature-gates}/stable-features.rs | 0 .../stable-features.stderr | 0 src/test/ui/{ => fn}/expr-fn.rs | 0 .../nested-function-names-issue-8587.rs | 0 .../while-let-2.rs} | 0 .../while-let-2.stderr} | 6 +++--- src/test/ui/{ => generics}/autobind.rs | 0 .../lifetime-before-type-params.rs | 0 .../lifetime-before-type-params.stderr | 0 .../{ => generics}/type-params-in-for-each.rs | 0 src/test/ui/{ => imports}/export-multi.rs | 0 src/test/ui/{ => imports}/glob-cycles.rs | 0 src/test/ui/{ => imports}/no-std-inject.rs | 0 .../ui/{ => imports}/no-std-inject.stderr | 0 src/test/ui/{ => imports}/use-mod.rs | 0 .../question-mark-type-infer.rs | 0 .../question-mark-type-infer.stderr | 0 src/test/ui/{ => inference}/simple-infer.rs | 0 src/test/ui/keyword-changes-2012-07-31.rs | 20 ------------------- .../no_owned_box_lang_item.rs | 0 .../no_owned_box_lang_item.stderr | 0 .../{ => linkage-attr}/auxiliary/linkage1.rs | 0 src/test/ui/{ => linkage-attr}/linkage1.rs | 0 ...est-allow-dead-extern-static-no-warning.rs | 0 src/test/ui/{ => lint}/warn-path-statement.rs | 0 .../ui/{ => lint}/warn-path-statement.stderr | 0 .../{ => lto}/auxiliary/debuginfo-lto-aux.rs | 0 src/test/ui/{ => lto}/debuginfo-lto.rs | 0 src/test/ui/{ => lto}/fat-lto.rs | 0 .../{ => macros}/auxiliary/proc_macro_def.rs | 0 src/test/ui/{ => macros}/concat.rs | 0 src/test/ui/{ => macros}/concat.stderr | 0 .../include-single-expr-helper-1.rs | 0 .../include-single-expr-helper.rs | 0 .../ui/{ => macros}/include-single-expr.rs | 0 .../{ => macros}/include-single-expr.stderr | 0 .../ui/{ => macros}/malformed_macro_lhs.rs | 0 .../{ => macros}/malformed_macro_lhs.stderr | 0 src/test/ui/{ => macros}/no-std-macros.rs | 0 src/test/ui/{ => macros}/proc_macro.rs | 0 src/test/ui/{ => nll}/lub-match.nll.stderr | 0 src/test/ui/{ => nll}/lub-match.rs | 0 src/test/ui/{ => nll}/lub-match.stderr | 0 src/test/ui/{ => nll}/ref-suggestion.rs | 0 src/test/ui/{ => nll}/ref-suggestion.stderr | 0 .../integer-literal-suffix-inference.rs | 0 .../integer-literal-suffix-inference.stderr | 0 ...ject-lifetime-default-default-to-static.rs | 0 ...object-lifetime-default-from-ref-struct.rs | 0 .../object-lifetime-default-from-rptr-box.rs | 0 .../object-lifetime-default-from-rptr-mut.rs | 0 ...bject-lifetime-default-from-rptr-struct.rs | 0 .../object-lifetime-default-from-rptr.rs | 0 .../object-lifetime-default-inferred.rs | 0 .../ui/{ => overloaded}/fixup-deref-mut.rs | 0 src/test/ui/paren-free.rs | 7 ------- src/test/ui/{ => parser}/issue-83639.rs | 0 src/test/ui/{ => parser}/issue-83639.stderr | 0 .../obsolete-syntax-impl-for-dotdot.rs | 0 .../obsolete-syntax-impl-for-dotdot.stderr | 0 src/test/ui/{ => parser}/ranges-precedence.rs | 0 src/test/ui/{ => parser}/similar-tokens.rs | 0 .../ui/{ => parser}/similar-tokens.stderr | 0 src/test/ui/{ => parser}/utf8_idents-rpass.rs | 0 src/test/ui/{ => privacy}/useless-pub.rs | 0 src/test/ui/{ => privacy}/useless-pub.stderr | 0 .../{ => proc-macro}/auxiliary/cond_plugin.rs | 0 .../ui/{ => proc-macro}/macro-quote-cond.rs | 0 src/test/ui/{ => process}/fds-are-cloexec.rs | 0 .../sigpipe-should-be-ignored.rs | 0 src/test/ui/purity-infer.rs | 6 ------ src/test/ui/readalias.rs | 12 ----------- src/test/ui/{ => recursion}/instantiable.rs | 0 src/test/ui/reexport-should-still-link.rs | 10 ---------- .../ui/{ => regions}/init-res-into-things.rs | 0 .../ui/{ => regions}/owned-implies-static.rs | 0 .../{ => regions}/rcvr-borrowed-to-region.rs | 0 src/test/ui/{ => repr}/attr-usage-repr.rs | 0 src/test/ui/{ => repr}/attr-usage-repr.stderr | 0 src/test/ui/{ => repr}/repr.rs | 0 src/test/ui/{ => repr}/repr.stderr | 0 src/test/ui/{ => resolve}/crate-in-paths.rs | 0 .../ui/{ => resolve}/crate-in-paths.stderr | 0 .../{ => resolve}/editions-crate-root-2018.rs | 0 .../editions-crate-root-2018.stderr | 0 .../ui/{ => resolve}/enums-pats-not-idents.rs | 0 .../enums-pats-not-idents.stderr | 0 .../no-implicit-prelude-nested.rs | 0 .../no-implicit-prelude-nested.stderr | 0 .../ui/{ => resolve}/resolve-issue-2428.rs | 0 src/test/ui/ret-none.rs | 13 ------------ src/test/ui/{ => runtime}/out-of-stack.rs | 0 .../rt-explody-panic-payloads.rs | 0 .../{ => runtime}/running-with-no-runtime.rs | 0 .../signal-alternate-stack-cleanup.rs | 0 .../{ => runtime}/stdout-during-shutdown.rs | 0 .../stdout-during-shutdown.run.stdout | 0 .../ui/{ => rustdoc}/duplicate_doc_alias.rs | 0 .../{ => rustdoc}/duplicate_doc_alias.stderr | 0 .../hidden-doc-associated-item.rs | 0 src/test/ui/{ => self}/class-missing-self.rs | 0 .../ui/{ => self}/class-missing-self.stderr | 0 .../objects-owned-object-owned-method.rs | 0 .../refer-to-other-statics-by-value.rs | 0 .../{ => static}/static_sized_requirement.rs | 0 .../{ => stdlib-unit-tests}/builtin-clone.rs | 0 .../eq-multidispatch.rs | 0 src/test/ui/{ => stdlib-unit-tests}/istr.rs | 0 .../log-knows-the-names-of-variants-in-std.rs | 0 .../ui/{ => stdlib-unit-tests}/seq-compare.rs | 0 src/test/ui/{ => structs}/large-records.rs | 0 .../{ => suggestions}/bound-suggestions.fixed | 0 .../ui/{ => suggestions}/bound-suggestions.rs | 0 .../bound-suggestions.stderr | 0 .../child-outlives-parent.rs | 0 .../ui/{ => threads-sendsync}/mpsc_stress.rs | 0 .../{ => threads-sendsync}/unwind-resource.rs | 0 src/test/ui/{ => threads-sendsync}/yield.rs | 0 src/test/ui/{ => threads-sendsync}/yield1.rs | 0 src/test/ui/{ => traits}/bug-7295.rs | 0 src/test/ui/{ => traits}/monad.rs | 0 ...nomorphized-callees-with-ty-params-3314.rs | 0 ...ispatch-conditional-impl-not-considered.rs | 0 src/test/ui/{ => traits}/multidispatch1.rs | 0 src/test/ui/{ => traits}/multidispatch2.rs | 0 ...owned-object-borrowed-method-headerless.rs | 0 .../ui/{ => traits}/staticness-mismatch.rs | 0 .../{ => traits}/staticness-mismatch.stderr | 0 .../typeclasses-eq-example-static.rs | 0 .../ui/{ => traits}/typeclasses-eq-example.rs | 0 .../ui/{ => traits}/vtable-res-trait-param.rs | 0 .../vtable-res-trait-param.stderr | 0 .../ui/{ => tuple}/tuple-index-fat-types.rs | 0 src/test/ui/type-in-nested-module.rs | 17 ---------------- src/test/ui/{ => typeck}/prim-with-args.rs | 0 .../ui/{ => typeck}/prim-with-args.stderr | 0 .../{ => unsized}/maybe-bounds-where-cpass.rs | 2 +- src/test/ui/use-crate-name-alias.rs | 7 ------- src/test/ui/writealias.rs | 19 ------------------ src/tools/tidy/src/ui_tests.rs | 6 +++++- 187 files changed, 9 insertions(+), 233 deletions(-) rename src/test/ui/{ => abi}/c-stack-returning-int64.rs (100%) rename src/test/ui/{ => abi}/x86stdcall.rs (100%) rename src/test/ui/{ => abi}/x86stdcall2.rs (100%) rename src/test/ui/{ => alloc-error}/default-alloc-error-hook.rs (100%) delete mode 100644 src/test/ui/alloca-from-derived-tydesc.rs rename src/test/ui/{ => associated-types}/associated-item-long-paths.rs (100%) rename src/test/ui/{ => associated-types}/default-associated-types.rs (100%) rename src/test/ui/{parser => async-await}/incorrect-move-async-order-issue-79694.fixed (100%) rename src/test/ui/{parser => async-await}/incorrect-move-async-order-issue-79694.rs (100%) rename src/test/ui/{parser => async-await}/incorrect-move-async-order-issue-79694.stderr (100%) rename src/test/ui/{ => attributes}/attr-eq-token-tree.rs (100%) rename src/test/ui/{ => attributes}/attr-eq-token-tree.stderr (100%) rename src/test/ui/{ => attributes}/tool_attributes.rs (100%) delete mode 100644 src/test/ui/augmented-assignments-feature-gate.rs rename src/test/ui/{ => binop}/shift-various-bad-types.rs (100%) rename src/test/ui/{ => binop}/shift-various-bad-types.stderr (100%) rename src/test/ui/{ => borrowck}/access-mode-in-closures.rs (100%) rename src/test/ui/{ => borrowck}/access-mode-in-closures.stderr (100%) rename src/test/ui/{ => borrowck}/lazy-init.rs (100%) rename src/test/ui/{ => box}/new-box-syntax.rs (100%) rename src/test/ui/{ => cast}/codegen-object-shim.rs (100%) rename src/test/ui/{ => cfg}/crt-static-off-works.rs (100%) rename src/test/ui/{ => cfg}/expanded-cfg.rs (100%) rename src/test/ui/{ => closures}/closure-expected.rs (100%) rename src/test/ui/{ => closures}/closure-expected.stderr (100%) rename src/test/ui/{ => closures}/closure_promotion.rs (100%) rename src/test/ui/{ => closures}/semistatement-in-lambda.rs (100%) rename src/test/ui/{ => closures}/thir-unsafeck-issue-85871.rs (100%) rename src/test/ui/{ => coercion}/unsafe-coercion.rs (100%) rename src/test/ui/{ => consts}/eval-enum.rs (100%) rename src/test/ui/{ => consts}/eval-enum.stderr (100%) rename src/test/ui/{ => drop}/auxiliary/inline_dtor.rs (100%) rename src/test/ui/{ => drop}/use_inline_dtor.rs (100%) rename src/test/ui/{ => editions}/edition-keywords-2015-2015.rs (100%) rename src/test/ui/{ => editions}/edition-keywords-2018-2015.rs (100%) delete mode 100644 src/test/ui/estr-uniq.rs delete mode 100644 src/test/ui/export-import.rs delete mode 100644 src/test/ui/export-import.stderr delete mode 100644 src/test/ui/export-non-interference2.rs delete mode 100644 src/test/ui/export-non-interference3.rs delete mode 100644 src/test/ui/export2.rs delete mode 100644 src/test/ui/export2.stderr delete mode 100644 src/test/ui/expr-block-unique.rs rename src/test/ui/{ => expr/if}/expr-if.rs (100%) rename src/test/ui/{ => extern}/auxiliary/reexport-should-still-link.rs (100%) rename src/test/ui/{ => feature-gates}/gated-bad-feature.rs (100%) rename src/test/ui/{ => feature-gates}/gated-bad-feature.stderr (100%) rename src/test/ui/{ => feature-gates}/stable-features.rs (100%) rename src/test/ui/{ => feature-gates}/stable-features.stderr (100%) rename src/test/ui/{ => fn}/expr-fn.rs (100%) rename src/test/ui/{ => fn}/nested-function-names-issue-8587.rs (100%) rename src/test/ui/{while-let.rs => for-loop-while/while-let-2.rs} (100%) rename src/test/ui/{while-let.stderr => for-loop-while/while-let-2.stderr} (93%) rename src/test/ui/{ => generics}/autobind.rs (100%) rename src/test/ui/{ => generics}/lifetime-before-type-params.rs (100%) rename src/test/ui/{ => generics}/lifetime-before-type-params.stderr (100%) rename src/test/ui/{ => generics}/type-params-in-for-each.rs (100%) rename src/test/ui/{ => imports}/export-multi.rs (100%) rename src/test/ui/{ => imports}/glob-cycles.rs (100%) rename src/test/ui/{ => imports}/no-std-inject.rs (100%) rename src/test/ui/{ => imports}/no-std-inject.stderr (100%) rename src/test/ui/{ => imports}/use-mod.rs (100%) rename src/test/ui/{ => inference}/question-mark-type-infer.rs (100%) rename src/test/ui/{ => inference}/question-mark-type-infer.stderr (100%) rename src/test/ui/{ => inference}/simple-infer.rs (100%) delete mode 100644 src/test/ui/keyword-changes-2012-07-31.rs rename src/test/ui/{ => lang-items}/no_owned_box_lang_item.rs (100%) rename src/test/ui/{ => lang-items}/no_owned_box_lang_item.stderr (100%) rename src/test/ui/{ => linkage-attr}/auxiliary/linkage1.rs (100%) rename src/test/ui/{ => linkage-attr}/linkage1.rs (100%) rename src/test/ui/{ => lint}/test-allow-dead-extern-static-no-warning.rs (100%) rename src/test/ui/{ => lint}/warn-path-statement.rs (100%) rename src/test/ui/{ => lint}/warn-path-statement.stderr (100%) rename src/test/ui/{ => lto}/auxiliary/debuginfo-lto-aux.rs (100%) rename src/test/ui/{ => lto}/debuginfo-lto.rs (100%) rename src/test/ui/{ => lto}/fat-lto.rs (100%) rename src/test/ui/{ => macros}/auxiliary/proc_macro_def.rs (100%) rename src/test/ui/{ => macros}/concat.rs (100%) rename src/test/ui/{ => macros}/concat.stderr (100%) rename src/test/ui/{ => macros}/include-single-expr-helper-1.rs (100%) rename src/test/ui/{ => macros}/include-single-expr-helper.rs (100%) rename src/test/ui/{ => macros}/include-single-expr.rs (100%) rename src/test/ui/{ => macros}/include-single-expr.stderr (100%) rename src/test/ui/{ => macros}/malformed_macro_lhs.rs (100%) rename src/test/ui/{ => macros}/malformed_macro_lhs.stderr (100%) rename src/test/ui/{ => macros}/no-std-macros.rs (100%) rename src/test/ui/{ => macros}/proc_macro.rs (100%) rename src/test/ui/{ => nll}/lub-match.nll.stderr (100%) rename src/test/ui/{ => nll}/lub-match.rs (100%) rename src/test/ui/{ => nll}/lub-match.stderr (100%) rename src/test/ui/{ => nll}/ref-suggestion.rs (100%) rename src/test/ui/{ => nll}/ref-suggestion.stderr (100%) rename src/test/ui/{ => numeric}/integer-literal-suffix-inference.rs (100%) rename src/test/ui/{ => numeric}/integer-literal-suffix-inference.stderr (100%) rename src/test/ui/{ => object-lifetime}/object-lifetime-default-default-to-static.rs (100%) rename src/test/ui/{structs-enums => object-lifetime}/object-lifetime-default-from-ref-struct.rs (100%) rename src/test/ui/{ => object-lifetime}/object-lifetime-default-from-rptr-box.rs (100%) rename src/test/ui/{ => object-lifetime}/object-lifetime-default-from-rptr-mut.rs (100%) rename src/test/ui/{structs-enums => object-lifetime}/object-lifetime-default-from-rptr-struct.rs (100%) rename src/test/ui/{ => object-lifetime}/object-lifetime-default-from-rptr.rs (100%) rename src/test/ui/{ => object-lifetime}/object-lifetime-default-inferred.rs (100%) rename src/test/ui/{ => overloaded}/fixup-deref-mut.rs (100%) delete mode 100644 src/test/ui/paren-free.rs rename src/test/ui/{ => parser}/issue-83639.rs (100%) rename src/test/ui/{ => parser}/issue-83639.stderr (100%) rename src/test/ui/{ => parser}/obsolete-syntax-impl-for-dotdot.rs (100%) rename src/test/ui/{ => parser}/obsolete-syntax-impl-for-dotdot.stderr (100%) rename src/test/ui/{ => parser}/ranges-precedence.rs (100%) rename src/test/ui/{ => parser}/similar-tokens.rs (100%) rename src/test/ui/{ => parser}/similar-tokens.stderr (100%) rename src/test/ui/{ => parser}/utf8_idents-rpass.rs (100%) rename src/test/ui/{ => privacy}/useless-pub.rs (100%) rename src/test/ui/{ => privacy}/useless-pub.stderr (100%) rename src/test/ui/{ => proc-macro}/auxiliary/cond_plugin.rs (100%) rename src/test/ui/{ => proc-macro}/macro-quote-cond.rs (100%) rename src/test/ui/{ => process}/fds-are-cloexec.rs (100%) rename src/test/ui/{ => process}/sigpipe-should-be-ignored.rs (100%) delete mode 100644 src/test/ui/purity-infer.rs delete mode 100644 src/test/ui/readalias.rs rename src/test/ui/{ => recursion}/instantiable.rs (100%) delete mode 100644 src/test/ui/reexport-should-still-link.rs rename src/test/ui/{ => regions}/init-res-into-things.rs (100%) rename src/test/ui/{ => regions}/owned-implies-static.rs (100%) rename src/test/ui/{ => regions}/rcvr-borrowed-to-region.rs (100%) rename src/test/ui/{ => repr}/attr-usage-repr.rs (100%) rename src/test/ui/{ => repr}/attr-usage-repr.stderr (100%) rename src/test/ui/{ => repr}/repr.rs (100%) rename src/test/ui/{ => repr}/repr.stderr (100%) rename src/test/ui/{ => resolve}/crate-in-paths.rs (100%) rename src/test/ui/{ => resolve}/crate-in-paths.stderr (100%) rename src/test/ui/{ => resolve}/editions-crate-root-2018.rs (100%) rename src/test/ui/{ => resolve}/editions-crate-root-2018.stderr (100%) rename src/test/ui/{ => resolve}/enums-pats-not-idents.rs (100%) rename src/test/ui/{ => resolve}/enums-pats-not-idents.stderr (100%) rename src/test/ui/{ => resolve}/no-implicit-prelude-nested.rs (100%) rename src/test/ui/{ => resolve}/no-implicit-prelude-nested.stderr (100%) rename src/test/ui/{ => resolve}/resolve-issue-2428.rs (100%) delete mode 100644 src/test/ui/ret-none.rs rename src/test/ui/{ => runtime}/out-of-stack.rs (100%) rename src/test/ui/{ => runtime}/rt-explody-panic-payloads.rs (100%) rename src/test/ui/{ => runtime}/running-with-no-runtime.rs (100%) rename src/test/ui/{ => runtime}/signal-alternate-stack-cleanup.rs (100%) rename src/test/ui/{ => runtime}/stdout-during-shutdown.rs (100%) rename src/test/ui/{ => runtime}/stdout-during-shutdown.run.stdout (100%) rename src/test/ui/{ => rustdoc}/duplicate_doc_alias.rs (100%) rename src/test/ui/{ => rustdoc}/duplicate_doc_alias.stderr (100%) rename src/test/ui/{ => rustdoc}/hidden-doc-associated-item.rs (100%) rename src/test/ui/{ => self}/class-missing-self.rs (100%) rename src/test/ui/{ => self}/class-missing-self.stderr (100%) rename src/test/ui/{ => self}/objects-owned-object-owned-method.rs (100%) rename src/test/ui/{ => static}/refer-to-other-statics-by-value.rs (100%) rename src/test/ui/{ => static}/static_sized_requirement.rs (100%) rename src/test/ui/{ => stdlib-unit-tests}/builtin-clone.rs (100%) rename src/test/ui/{ => stdlib-unit-tests}/eq-multidispatch.rs (100%) rename src/test/ui/{ => stdlib-unit-tests}/istr.rs (100%) rename src/test/ui/{ => stdlib-unit-tests}/log-knows-the-names-of-variants-in-std.rs (100%) rename src/test/ui/{ => stdlib-unit-tests}/seq-compare.rs (100%) rename src/test/ui/{ => structs}/large-records.rs (100%) rename src/test/ui/{ => suggestions}/bound-suggestions.fixed (100%) rename src/test/ui/{ => suggestions}/bound-suggestions.rs (100%) rename src/test/ui/{ => suggestions}/bound-suggestions.stderr (100%) rename src/test/ui/{ => threads-sendsync}/child-outlives-parent.rs (100%) rename src/test/ui/{ => threads-sendsync}/mpsc_stress.rs (100%) rename src/test/ui/{ => threads-sendsync}/unwind-resource.rs (100%) rename src/test/ui/{ => threads-sendsync}/yield.rs (100%) rename src/test/ui/{ => threads-sendsync}/yield1.rs (100%) rename src/test/ui/{ => traits}/bug-7295.rs (100%) rename src/test/ui/{ => traits}/monad.rs (100%) rename src/test/ui/{ => traits}/monomorphized-callees-with-ty-params-3314.rs (100%) rename src/test/ui/{ => traits}/multidispatch-conditional-impl-not-considered.rs (100%) rename src/test/ui/{ => traits}/multidispatch1.rs (100%) rename src/test/ui/{ => traits}/multidispatch2.rs (100%) rename src/test/ui/{ => traits}/objects-owned-object-borrowed-method-headerless.rs (100%) rename src/test/ui/{ => traits}/staticness-mismatch.rs (100%) rename src/test/ui/{ => traits}/staticness-mismatch.stderr (100%) rename src/test/ui/{ => traits}/typeclasses-eq-example-static.rs (100%) rename src/test/ui/{ => traits}/typeclasses-eq-example.rs (100%) rename src/test/ui/{ => traits}/vtable-res-trait-param.rs (100%) rename src/test/ui/{ => traits}/vtable-res-trait-param.stderr (100%) rename src/test/ui/{ => tuple}/tuple-index-fat-types.rs (100%) delete mode 100644 src/test/ui/type-in-nested-module.rs rename src/test/ui/{ => typeck}/prim-with-args.rs (100%) rename src/test/ui/{ => typeck}/prim-with-args.stderr (100%) rename src/test/ui/{ => unsized}/maybe-bounds-where-cpass.rs (69%) delete mode 100644 src/test/ui/use-crate-name-alias.rs delete mode 100644 src/test/ui/writealias.rs diff --git a/src/test/ui/c-stack-returning-int64.rs b/src/test/ui/abi/c-stack-returning-int64.rs similarity index 100% rename from src/test/ui/c-stack-returning-int64.rs rename to src/test/ui/abi/c-stack-returning-int64.rs diff --git a/src/test/ui/x86stdcall.rs b/src/test/ui/abi/x86stdcall.rs similarity index 100% rename from src/test/ui/x86stdcall.rs rename to src/test/ui/abi/x86stdcall.rs diff --git a/src/test/ui/x86stdcall2.rs b/src/test/ui/abi/x86stdcall2.rs similarity index 100% rename from src/test/ui/x86stdcall2.rs rename to src/test/ui/abi/x86stdcall2.rs diff --git a/src/test/ui/default-alloc-error-hook.rs b/src/test/ui/alloc-error/default-alloc-error-hook.rs similarity index 100% rename from src/test/ui/default-alloc-error-hook.rs rename to src/test/ui/alloc-error/default-alloc-error-hook.rs diff --git a/src/test/ui/alloca-from-derived-tydesc.rs b/src/test/ui/alloca-from-derived-tydesc.rs deleted file mode 100644 index c7f7fbad435..00000000000 --- a/src/test/ui/alloca-from-derived-tydesc.rs +++ /dev/null @@ -1,15 +0,0 @@ -// run-pass - -#![allow(non_camel_case_types)] -#![allow(dead_code)] - - -// pretty-expanded FIXME #23616 - -enum option { some(T), none, } - -struct R {v: Vec> } - -fn f() -> Vec { return Vec::new(); } - -pub fn main() { let mut r: R = R {v: Vec::new()}; r.v = f(); } diff --git a/src/test/ui/associated-item-long-paths.rs b/src/test/ui/associated-types/associated-item-long-paths.rs similarity index 100% rename from src/test/ui/associated-item-long-paths.rs rename to src/test/ui/associated-types/associated-item-long-paths.rs diff --git a/src/test/ui/default-associated-types.rs b/src/test/ui/associated-types/default-associated-types.rs similarity index 100% rename from src/test/ui/default-associated-types.rs rename to src/test/ui/associated-types/default-associated-types.rs diff --git a/src/test/ui/parser/incorrect-move-async-order-issue-79694.fixed b/src/test/ui/async-await/incorrect-move-async-order-issue-79694.fixed similarity index 100% rename from src/test/ui/parser/incorrect-move-async-order-issue-79694.fixed rename to src/test/ui/async-await/incorrect-move-async-order-issue-79694.fixed diff --git a/src/test/ui/parser/incorrect-move-async-order-issue-79694.rs b/src/test/ui/async-await/incorrect-move-async-order-issue-79694.rs similarity index 100% rename from src/test/ui/parser/incorrect-move-async-order-issue-79694.rs rename to src/test/ui/async-await/incorrect-move-async-order-issue-79694.rs diff --git a/src/test/ui/parser/incorrect-move-async-order-issue-79694.stderr b/src/test/ui/async-await/incorrect-move-async-order-issue-79694.stderr similarity index 100% rename from src/test/ui/parser/incorrect-move-async-order-issue-79694.stderr rename to src/test/ui/async-await/incorrect-move-async-order-issue-79694.stderr diff --git a/src/test/ui/attr-eq-token-tree.rs b/src/test/ui/attributes/attr-eq-token-tree.rs similarity index 100% rename from src/test/ui/attr-eq-token-tree.rs rename to src/test/ui/attributes/attr-eq-token-tree.rs diff --git a/src/test/ui/attr-eq-token-tree.stderr b/src/test/ui/attributes/attr-eq-token-tree.stderr similarity index 100% rename from src/test/ui/attr-eq-token-tree.stderr rename to src/test/ui/attributes/attr-eq-token-tree.stderr diff --git a/src/test/ui/tool_attributes.rs b/src/test/ui/attributes/tool_attributes.rs similarity index 100% rename from src/test/ui/tool_attributes.rs rename to src/test/ui/attributes/tool_attributes.rs diff --git a/src/test/ui/augmented-assignments-feature-gate.rs b/src/test/ui/augmented-assignments-feature-gate.rs deleted file mode 100644 index 8e686796fee..00000000000 --- a/src/test/ui/augmented-assignments-feature-gate.rs +++ /dev/null @@ -1,15 +0,0 @@ -// run-pass - -use std::ops::AddAssign; - -struct Int(i32); - -impl AddAssign for Int { - fn add_assign(&mut self, _: i32) { - } -} - -fn main() { - let mut x = Int(0); - x += 1; -} diff --git a/src/test/ui/shift-various-bad-types.rs b/src/test/ui/binop/shift-various-bad-types.rs similarity index 100% rename from src/test/ui/shift-various-bad-types.rs rename to src/test/ui/binop/shift-various-bad-types.rs diff --git a/src/test/ui/shift-various-bad-types.stderr b/src/test/ui/binop/shift-various-bad-types.stderr similarity index 100% rename from src/test/ui/shift-various-bad-types.stderr rename to src/test/ui/binop/shift-various-bad-types.stderr diff --git a/src/test/ui/access-mode-in-closures.rs b/src/test/ui/borrowck/access-mode-in-closures.rs similarity index 100% rename from src/test/ui/access-mode-in-closures.rs rename to src/test/ui/borrowck/access-mode-in-closures.rs diff --git a/src/test/ui/access-mode-in-closures.stderr b/src/test/ui/borrowck/access-mode-in-closures.stderr similarity index 100% rename from src/test/ui/access-mode-in-closures.stderr rename to src/test/ui/borrowck/access-mode-in-closures.stderr diff --git a/src/test/ui/lazy-init.rs b/src/test/ui/borrowck/lazy-init.rs similarity index 100% rename from src/test/ui/lazy-init.rs rename to src/test/ui/borrowck/lazy-init.rs diff --git a/src/test/ui/new-box-syntax.rs b/src/test/ui/box/new-box-syntax.rs similarity index 100% rename from src/test/ui/new-box-syntax.rs rename to src/test/ui/box/new-box-syntax.rs diff --git a/src/test/ui/codegen-object-shim.rs b/src/test/ui/cast/codegen-object-shim.rs similarity index 100% rename from src/test/ui/codegen-object-shim.rs rename to src/test/ui/cast/codegen-object-shim.rs diff --git a/src/test/ui/crt-static-off-works.rs b/src/test/ui/cfg/crt-static-off-works.rs similarity index 100% rename from src/test/ui/crt-static-off-works.rs rename to src/test/ui/cfg/crt-static-off-works.rs diff --git a/src/test/ui/expanded-cfg.rs b/src/test/ui/cfg/expanded-cfg.rs similarity index 100% rename from src/test/ui/expanded-cfg.rs rename to src/test/ui/cfg/expanded-cfg.rs diff --git a/src/test/ui/closure-expected.rs b/src/test/ui/closures/closure-expected.rs similarity index 100% rename from src/test/ui/closure-expected.rs rename to src/test/ui/closures/closure-expected.rs diff --git a/src/test/ui/closure-expected.stderr b/src/test/ui/closures/closure-expected.stderr similarity index 100% rename from src/test/ui/closure-expected.stderr rename to src/test/ui/closures/closure-expected.stderr diff --git a/src/test/ui/closure_promotion.rs b/src/test/ui/closures/closure_promotion.rs similarity index 100% rename from src/test/ui/closure_promotion.rs rename to src/test/ui/closures/closure_promotion.rs diff --git a/src/test/ui/semistatement-in-lambda.rs b/src/test/ui/closures/semistatement-in-lambda.rs similarity index 100% rename from src/test/ui/semistatement-in-lambda.rs rename to src/test/ui/closures/semistatement-in-lambda.rs diff --git a/src/test/ui/thir-unsafeck-issue-85871.rs b/src/test/ui/closures/thir-unsafeck-issue-85871.rs similarity index 100% rename from src/test/ui/thir-unsafeck-issue-85871.rs rename to src/test/ui/closures/thir-unsafeck-issue-85871.rs diff --git a/src/test/ui/unsafe-coercion.rs b/src/test/ui/coercion/unsafe-coercion.rs similarity index 100% rename from src/test/ui/unsafe-coercion.rs rename to src/test/ui/coercion/unsafe-coercion.rs diff --git a/src/test/ui/eval-enum.rs b/src/test/ui/consts/eval-enum.rs similarity index 100% rename from src/test/ui/eval-enum.rs rename to src/test/ui/consts/eval-enum.rs diff --git a/src/test/ui/eval-enum.stderr b/src/test/ui/consts/eval-enum.stderr similarity index 100% rename from src/test/ui/eval-enum.stderr rename to src/test/ui/consts/eval-enum.stderr diff --git a/src/test/ui/auxiliary/inline_dtor.rs b/src/test/ui/drop/auxiliary/inline_dtor.rs similarity index 100% rename from src/test/ui/auxiliary/inline_dtor.rs rename to src/test/ui/drop/auxiliary/inline_dtor.rs diff --git a/src/test/ui/use_inline_dtor.rs b/src/test/ui/drop/use_inline_dtor.rs similarity index 100% rename from src/test/ui/use_inline_dtor.rs rename to src/test/ui/drop/use_inline_dtor.rs diff --git a/src/test/ui/edition-keywords-2015-2015.rs b/src/test/ui/editions/edition-keywords-2015-2015.rs similarity index 100% rename from src/test/ui/edition-keywords-2015-2015.rs rename to src/test/ui/editions/edition-keywords-2015-2015.rs diff --git a/src/test/ui/edition-keywords-2018-2015.rs b/src/test/ui/editions/edition-keywords-2018-2015.rs similarity index 100% rename from src/test/ui/edition-keywords-2018-2015.rs rename to src/test/ui/editions/edition-keywords-2018-2015.rs diff --git a/src/test/ui/estr-uniq.rs b/src/test/ui/estr-uniq.rs deleted file mode 100644 index 1d0a4273953..00000000000 --- a/src/test/ui/estr-uniq.rs +++ /dev/null @@ -1,15 +0,0 @@ -// run-pass - -#![allow(unused_assignments)] -#![allow(unknown_lints)] - -#![allow(dead_assignment)] - -pub fn main() { - let x : String = "hello".to_string(); - let _y : String = "there".to_string(); - let mut z = "thing".to_string(); - z = x; - assert_eq!(z.as_bytes()[0], ('h' as u8)); - assert_eq!(z.as_bytes()[4], ('o' as u8)); -} diff --git a/src/test/ui/export-import.rs b/src/test/ui/export-import.rs deleted file mode 100644 index 3f543636064..00000000000 --- a/src/test/ui/export-import.rs +++ /dev/null @@ -1,11 +0,0 @@ -use m::unexported; -//~^ ERROR: is private - -mod m { - pub fn exported() { } - - fn unexported() { } -} - - -fn main() { unexported(); } diff --git a/src/test/ui/export-import.stderr b/src/test/ui/export-import.stderr deleted file mode 100644 index 753424c7f88..00000000000 --- a/src/test/ui/export-import.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0603]: function `unexported` is private - --> $DIR/export-import.rs:1:8 - | -LL | use m::unexported; - | ^^^^^^^^^^ private function - | -note: the function `unexported` is defined here - --> $DIR/export-import.rs:7:5 - | -LL | fn unexported() { } - | ^^^^^^^^^^^^^^^ - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0603`. diff --git a/src/test/ui/export-non-interference2.rs b/src/test/ui/export-non-interference2.rs deleted file mode 100644 index 6d18b03891a..00000000000 --- a/src/test/ui/export-non-interference2.rs +++ /dev/null @@ -1,11 +0,0 @@ -// run-pass - -mod foo { - pub mod bar { - pub fn y() { super::super::foo::x(); } - } - - pub fn x() { println!("x"); } -} - -pub fn main() { self::foo::bar::y(); } diff --git a/src/test/ui/export-non-interference3.rs b/src/test/ui/export-non-interference3.rs deleted file mode 100644 index 0d6b6369f94..00000000000 --- a/src/test/ui/export-non-interference3.rs +++ /dev/null @@ -1,11 +0,0 @@ -// run-pass - -pub mod foo { - pub fn x() { ::bar::x(); } -} - -pub mod bar { - pub fn x() { println!("x"); } -} - -pub fn main() { foo::x(); } diff --git a/src/test/ui/export2.rs b/src/test/ui/export2.rs deleted file mode 100644 index 64ebeddffa8..00000000000 --- a/src/test/ui/export2.rs +++ /dev/null @@ -1,11 +0,0 @@ -mod foo { - pub fn x() { bar::x(); } //~ ERROR failed to resolve: use of undeclared crate or module `bar` -} - -mod bar { - fn x() { println!("x"); } - - pub fn y() { } -} - -fn main() { foo::x(); } diff --git a/src/test/ui/export2.stderr b/src/test/ui/export2.stderr deleted file mode 100644 index 7cf47d0764b..00000000000 --- a/src/test/ui/export2.stderr +++ /dev/null @@ -1,9 +0,0 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `bar` - --> $DIR/export2.rs:2:18 - | -LL | pub fn x() { bar::x(); } - | ^^^ use of undeclared crate or module `bar` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0433`. diff --git a/src/test/ui/expr-block-unique.rs b/src/test/ui/expr-block-unique.rs deleted file mode 100644 index 5fa11ad1283..00000000000 --- a/src/test/ui/expr-block-unique.rs +++ /dev/null @@ -1,4 +0,0 @@ -// run-pass -#![allow(unused_braces)] - -pub fn main() { let x: Box<_> = { Box::new(100) }; assert_eq!(*x, 100); } diff --git a/src/test/ui/expr-if.rs b/src/test/ui/expr/if/expr-if.rs similarity index 100% rename from src/test/ui/expr-if.rs rename to src/test/ui/expr/if/expr-if.rs diff --git a/src/test/ui/auxiliary/reexport-should-still-link.rs b/src/test/ui/extern/auxiliary/reexport-should-still-link.rs similarity index 100% rename from src/test/ui/auxiliary/reexport-should-still-link.rs rename to src/test/ui/extern/auxiliary/reexport-should-still-link.rs diff --git a/src/test/ui/gated-bad-feature.rs b/src/test/ui/feature-gates/gated-bad-feature.rs similarity index 100% rename from src/test/ui/gated-bad-feature.rs rename to src/test/ui/feature-gates/gated-bad-feature.rs diff --git a/src/test/ui/gated-bad-feature.stderr b/src/test/ui/feature-gates/gated-bad-feature.stderr similarity index 100% rename from src/test/ui/gated-bad-feature.stderr rename to src/test/ui/feature-gates/gated-bad-feature.stderr diff --git a/src/test/ui/stable-features.rs b/src/test/ui/feature-gates/stable-features.rs similarity index 100% rename from src/test/ui/stable-features.rs rename to src/test/ui/feature-gates/stable-features.rs diff --git a/src/test/ui/stable-features.stderr b/src/test/ui/feature-gates/stable-features.stderr similarity index 100% rename from src/test/ui/stable-features.stderr rename to src/test/ui/feature-gates/stable-features.stderr diff --git a/src/test/ui/expr-fn.rs b/src/test/ui/fn/expr-fn.rs similarity index 100% rename from src/test/ui/expr-fn.rs rename to src/test/ui/fn/expr-fn.rs diff --git a/src/test/ui/nested-function-names-issue-8587.rs b/src/test/ui/fn/nested-function-names-issue-8587.rs similarity index 100% rename from src/test/ui/nested-function-names-issue-8587.rs rename to src/test/ui/fn/nested-function-names-issue-8587.rs diff --git a/src/test/ui/while-let.rs b/src/test/ui/for-loop-while/while-let-2.rs similarity index 100% rename from src/test/ui/while-let.rs rename to src/test/ui/for-loop-while/while-let-2.rs diff --git a/src/test/ui/while-let.stderr b/src/test/ui/for-loop-while/while-let-2.stderr similarity index 93% rename from src/test/ui/while-let.stderr rename to src/test/ui/for-loop-while/while-let-2.stderr index c5e2fd92f04..cb1abd43571 100644 --- a/src/test/ui/while-let.stderr +++ b/src/test/ui/for-loop-while/while-let-2.stderr @@ -1,5 +1,5 @@ warning: irrefutable `while let` pattern - --> $DIR/while-let.rs:7:19 + --> $DIR/while-let-2.rs:7:19 | LL | while let $p = $e $b | ^^^ @@ -15,7 +15,7 @@ LL | | }); = note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) warning: irrefutable `while let` pattern - --> $DIR/while-let.rs:7:19 + --> $DIR/while-let-2.rs:7:19 | LL | while let $p = $e $b | ^^^ @@ -30,7 +30,7 @@ LL | | }); = note: this warning originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info) warning: irrefutable `while let` pattern - --> $DIR/while-let.rs:27:11 + --> $DIR/while-let-2.rs:27:11 | LL | while let _a = 1 { | ^^^^^^^^^^ diff --git a/src/test/ui/autobind.rs b/src/test/ui/generics/autobind.rs similarity index 100% rename from src/test/ui/autobind.rs rename to src/test/ui/generics/autobind.rs diff --git a/src/test/ui/lifetime-before-type-params.rs b/src/test/ui/generics/lifetime-before-type-params.rs similarity index 100% rename from src/test/ui/lifetime-before-type-params.rs rename to src/test/ui/generics/lifetime-before-type-params.rs diff --git a/src/test/ui/lifetime-before-type-params.stderr b/src/test/ui/generics/lifetime-before-type-params.stderr similarity index 100% rename from src/test/ui/lifetime-before-type-params.stderr rename to src/test/ui/generics/lifetime-before-type-params.stderr diff --git a/src/test/ui/type-params-in-for-each.rs b/src/test/ui/generics/type-params-in-for-each.rs similarity index 100% rename from src/test/ui/type-params-in-for-each.rs rename to src/test/ui/generics/type-params-in-for-each.rs diff --git a/src/test/ui/export-multi.rs b/src/test/ui/imports/export-multi.rs similarity index 100% rename from src/test/ui/export-multi.rs rename to src/test/ui/imports/export-multi.rs diff --git a/src/test/ui/glob-cycles.rs b/src/test/ui/imports/glob-cycles.rs similarity index 100% rename from src/test/ui/glob-cycles.rs rename to src/test/ui/imports/glob-cycles.rs diff --git a/src/test/ui/no-std-inject.rs b/src/test/ui/imports/no-std-inject.rs similarity index 100% rename from src/test/ui/no-std-inject.rs rename to src/test/ui/imports/no-std-inject.rs diff --git a/src/test/ui/no-std-inject.stderr b/src/test/ui/imports/no-std-inject.stderr similarity index 100% rename from src/test/ui/no-std-inject.stderr rename to src/test/ui/imports/no-std-inject.stderr diff --git a/src/test/ui/use-mod.rs b/src/test/ui/imports/use-mod.rs similarity index 100% rename from src/test/ui/use-mod.rs rename to src/test/ui/imports/use-mod.rs diff --git a/src/test/ui/question-mark-type-infer.rs b/src/test/ui/inference/question-mark-type-infer.rs similarity index 100% rename from src/test/ui/question-mark-type-infer.rs rename to src/test/ui/inference/question-mark-type-infer.rs diff --git a/src/test/ui/question-mark-type-infer.stderr b/src/test/ui/inference/question-mark-type-infer.stderr similarity index 100% rename from src/test/ui/question-mark-type-infer.stderr rename to src/test/ui/inference/question-mark-type-infer.stderr diff --git a/src/test/ui/simple-infer.rs b/src/test/ui/inference/simple-infer.rs similarity index 100% rename from src/test/ui/simple-infer.rs rename to src/test/ui/inference/simple-infer.rs diff --git a/src/test/ui/keyword-changes-2012-07-31.rs b/src/test/ui/keyword-changes-2012-07-31.rs deleted file mode 100644 index 1b38527ec29..00000000000 --- a/src/test/ui/keyword-changes-2012-07-31.rs +++ /dev/null @@ -1,20 +0,0 @@ -// run-pass - -#![allow(dead_code)] -// return -> return -// mod -> module -// match -> match - -// pretty-expanded FIXME #23616 - -pub fn main() { -} - -mod foo { -} - -fn bar() -> isize { - match 0 { - _ => { 0 } - } -} diff --git a/src/test/ui/no_owned_box_lang_item.rs b/src/test/ui/lang-items/no_owned_box_lang_item.rs similarity index 100% rename from src/test/ui/no_owned_box_lang_item.rs rename to src/test/ui/lang-items/no_owned_box_lang_item.rs diff --git a/src/test/ui/no_owned_box_lang_item.stderr b/src/test/ui/lang-items/no_owned_box_lang_item.stderr similarity index 100% rename from src/test/ui/no_owned_box_lang_item.stderr rename to src/test/ui/lang-items/no_owned_box_lang_item.stderr diff --git a/src/test/ui/auxiliary/linkage1.rs b/src/test/ui/linkage-attr/auxiliary/linkage1.rs similarity index 100% rename from src/test/ui/auxiliary/linkage1.rs rename to src/test/ui/linkage-attr/auxiliary/linkage1.rs diff --git a/src/test/ui/linkage1.rs b/src/test/ui/linkage-attr/linkage1.rs similarity index 100% rename from src/test/ui/linkage1.rs rename to src/test/ui/linkage-attr/linkage1.rs diff --git a/src/test/ui/test-allow-dead-extern-static-no-warning.rs b/src/test/ui/lint/test-allow-dead-extern-static-no-warning.rs similarity index 100% rename from src/test/ui/test-allow-dead-extern-static-no-warning.rs rename to src/test/ui/lint/test-allow-dead-extern-static-no-warning.rs diff --git a/src/test/ui/warn-path-statement.rs b/src/test/ui/lint/warn-path-statement.rs similarity index 100% rename from src/test/ui/warn-path-statement.rs rename to src/test/ui/lint/warn-path-statement.rs diff --git a/src/test/ui/warn-path-statement.stderr b/src/test/ui/lint/warn-path-statement.stderr similarity index 100% rename from src/test/ui/warn-path-statement.stderr rename to src/test/ui/lint/warn-path-statement.stderr diff --git a/src/test/ui/auxiliary/debuginfo-lto-aux.rs b/src/test/ui/lto/auxiliary/debuginfo-lto-aux.rs similarity index 100% rename from src/test/ui/auxiliary/debuginfo-lto-aux.rs rename to src/test/ui/lto/auxiliary/debuginfo-lto-aux.rs diff --git a/src/test/ui/debuginfo-lto.rs b/src/test/ui/lto/debuginfo-lto.rs similarity index 100% rename from src/test/ui/debuginfo-lto.rs rename to src/test/ui/lto/debuginfo-lto.rs diff --git a/src/test/ui/fat-lto.rs b/src/test/ui/lto/fat-lto.rs similarity index 100% rename from src/test/ui/fat-lto.rs rename to src/test/ui/lto/fat-lto.rs diff --git a/src/test/ui/auxiliary/proc_macro_def.rs b/src/test/ui/macros/auxiliary/proc_macro_def.rs similarity index 100% rename from src/test/ui/auxiliary/proc_macro_def.rs rename to src/test/ui/macros/auxiliary/proc_macro_def.rs diff --git a/src/test/ui/concat.rs b/src/test/ui/macros/concat.rs similarity index 100% rename from src/test/ui/concat.rs rename to src/test/ui/macros/concat.rs diff --git a/src/test/ui/concat.stderr b/src/test/ui/macros/concat.stderr similarity index 100% rename from src/test/ui/concat.stderr rename to src/test/ui/macros/concat.stderr diff --git a/src/test/ui/include-single-expr-helper-1.rs b/src/test/ui/macros/include-single-expr-helper-1.rs similarity index 100% rename from src/test/ui/include-single-expr-helper-1.rs rename to src/test/ui/macros/include-single-expr-helper-1.rs diff --git a/src/test/ui/include-single-expr-helper.rs b/src/test/ui/macros/include-single-expr-helper.rs similarity index 100% rename from src/test/ui/include-single-expr-helper.rs rename to src/test/ui/macros/include-single-expr-helper.rs diff --git a/src/test/ui/include-single-expr.rs b/src/test/ui/macros/include-single-expr.rs similarity index 100% rename from src/test/ui/include-single-expr.rs rename to src/test/ui/macros/include-single-expr.rs diff --git a/src/test/ui/include-single-expr.stderr b/src/test/ui/macros/include-single-expr.stderr similarity index 100% rename from src/test/ui/include-single-expr.stderr rename to src/test/ui/macros/include-single-expr.stderr diff --git a/src/test/ui/malformed_macro_lhs.rs b/src/test/ui/macros/malformed_macro_lhs.rs similarity index 100% rename from src/test/ui/malformed_macro_lhs.rs rename to src/test/ui/macros/malformed_macro_lhs.rs diff --git a/src/test/ui/malformed_macro_lhs.stderr b/src/test/ui/macros/malformed_macro_lhs.stderr similarity index 100% rename from src/test/ui/malformed_macro_lhs.stderr rename to src/test/ui/macros/malformed_macro_lhs.stderr diff --git a/src/test/ui/no-std-macros.rs b/src/test/ui/macros/no-std-macros.rs similarity index 100% rename from src/test/ui/no-std-macros.rs rename to src/test/ui/macros/no-std-macros.rs diff --git a/src/test/ui/proc_macro.rs b/src/test/ui/macros/proc_macro.rs similarity index 100% rename from src/test/ui/proc_macro.rs rename to src/test/ui/macros/proc_macro.rs diff --git a/src/test/ui/lub-match.nll.stderr b/src/test/ui/nll/lub-match.nll.stderr similarity index 100% rename from src/test/ui/lub-match.nll.stderr rename to src/test/ui/nll/lub-match.nll.stderr diff --git a/src/test/ui/lub-match.rs b/src/test/ui/nll/lub-match.rs similarity index 100% rename from src/test/ui/lub-match.rs rename to src/test/ui/nll/lub-match.rs diff --git a/src/test/ui/lub-match.stderr b/src/test/ui/nll/lub-match.stderr similarity index 100% rename from src/test/ui/lub-match.stderr rename to src/test/ui/nll/lub-match.stderr diff --git a/src/test/ui/ref-suggestion.rs b/src/test/ui/nll/ref-suggestion.rs similarity index 100% rename from src/test/ui/ref-suggestion.rs rename to src/test/ui/nll/ref-suggestion.rs diff --git a/src/test/ui/ref-suggestion.stderr b/src/test/ui/nll/ref-suggestion.stderr similarity index 100% rename from src/test/ui/ref-suggestion.stderr rename to src/test/ui/nll/ref-suggestion.stderr diff --git a/src/test/ui/integer-literal-suffix-inference.rs b/src/test/ui/numeric/integer-literal-suffix-inference.rs similarity index 100% rename from src/test/ui/integer-literal-suffix-inference.rs rename to src/test/ui/numeric/integer-literal-suffix-inference.rs diff --git a/src/test/ui/integer-literal-suffix-inference.stderr b/src/test/ui/numeric/integer-literal-suffix-inference.stderr similarity index 100% rename from src/test/ui/integer-literal-suffix-inference.stderr rename to src/test/ui/numeric/integer-literal-suffix-inference.stderr diff --git a/src/test/ui/object-lifetime-default-default-to-static.rs b/src/test/ui/object-lifetime/object-lifetime-default-default-to-static.rs similarity index 100% rename from src/test/ui/object-lifetime-default-default-to-static.rs rename to src/test/ui/object-lifetime/object-lifetime-default-default-to-static.rs diff --git a/src/test/ui/structs-enums/object-lifetime-default-from-ref-struct.rs b/src/test/ui/object-lifetime/object-lifetime-default-from-ref-struct.rs similarity index 100% rename from src/test/ui/structs-enums/object-lifetime-default-from-ref-struct.rs rename to src/test/ui/object-lifetime/object-lifetime-default-from-ref-struct.rs diff --git a/src/test/ui/object-lifetime-default-from-rptr-box.rs b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box.rs similarity index 100% rename from src/test/ui/object-lifetime-default-from-rptr-box.rs rename to src/test/ui/object-lifetime/object-lifetime-default-from-rptr-box.rs diff --git a/src/test/ui/object-lifetime-default-from-rptr-mut.rs b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-mut.rs similarity index 100% rename from src/test/ui/object-lifetime-default-from-rptr-mut.rs rename to src/test/ui/object-lifetime/object-lifetime-default-from-rptr-mut.rs diff --git a/src/test/ui/structs-enums/object-lifetime-default-from-rptr-struct.rs b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct.rs similarity index 100% rename from src/test/ui/structs-enums/object-lifetime-default-from-rptr-struct.rs rename to src/test/ui/object-lifetime/object-lifetime-default-from-rptr-struct.rs diff --git a/src/test/ui/object-lifetime-default-from-rptr.rs b/src/test/ui/object-lifetime/object-lifetime-default-from-rptr.rs similarity index 100% rename from src/test/ui/object-lifetime-default-from-rptr.rs rename to src/test/ui/object-lifetime/object-lifetime-default-from-rptr.rs diff --git a/src/test/ui/object-lifetime-default-inferred.rs b/src/test/ui/object-lifetime/object-lifetime-default-inferred.rs similarity index 100% rename from src/test/ui/object-lifetime-default-inferred.rs rename to src/test/ui/object-lifetime/object-lifetime-default-inferred.rs diff --git a/src/test/ui/fixup-deref-mut.rs b/src/test/ui/overloaded/fixup-deref-mut.rs similarity index 100% rename from src/test/ui/fixup-deref-mut.rs rename to src/test/ui/overloaded/fixup-deref-mut.rs diff --git a/src/test/ui/paren-free.rs b/src/test/ui/paren-free.rs deleted file mode 100644 index 8e8bb8800ec..00000000000 --- a/src/test/ui/paren-free.rs +++ /dev/null @@ -1,7 +0,0 @@ -// run-pass - -pub fn main() { - let x = true; - if x { let mut i = 10; while i > 0 { i -= 1; } } - match x { true => { println!("right"); } false => { println!("wrong"); } } -} diff --git a/src/test/ui/issue-83639.rs b/src/test/ui/parser/issue-83639.rs similarity index 100% rename from src/test/ui/issue-83639.rs rename to src/test/ui/parser/issue-83639.rs diff --git a/src/test/ui/issue-83639.stderr b/src/test/ui/parser/issue-83639.stderr similarity index 100% rename from src/test/ui/issue-83639.stderr rename to src/test/ui/parser/issue-83639.stderr diff --git a/src/test/ui/obsolete-syntax-impl-for-dotdot.rs b/src/test/ui/parser/obsolete-syntax-impl-for-dotdot.rs similarity index 100% rename from src/test/ui/obsolete-syntax-impl-for-dotdot.rs rename to src/test/ui/parser/obsolete-syntax-impl-for-dotdot.rs diff --git a/src/test/ui/obsolete-syntax-impl-for-dotdot.stderr b/src/test/ui/parser/obsolete-syntax-impl-for-dotdot.stderr similarity index 100% rename from src/test/ui/obsolete-syntax-impl-for-dotdot.stderr rename to src/test/ui/parser/obsolete-syntax-impl-for-dotdot.stderr diff --git a/src/test/ui/ranges-precedence.rs b/src/test/ui/parser/ranges-precedence.rs similarity index 100% rename from src/test/ui/ranges-precedence.rs rename to src/test/ui/parser/ranges-precedence.rs diff --git a/src/test/ui/similar-tokens.rs b/src/test/ui/parser/similar-tokens.rs similarity index 100% rename from src/test/ui/similar-tokens.rs rename to src/test/ui/parser/similar-tokens.rs diff --git a/src/test/ui/similar-tokens.stderr b/src/test/ui/parser/similar-tokens.stderr similarity index 100% rename from src/test/ui/similar-tokens.stderr rename to src/test/ui/parser/similar-tokens.stderr diff --git a/src/test/ui/utf8_idents-rpass.rs b/src/test/ui/parser/utf8_idents-rpass.rs similarity index 100% rename from src/test/ui/utf8_idents-rpass.rs rename to src/test/ui/parser/utf8_idents-rpass.rs diff --git a/src/test/ui/useless-pub.rs b/src/test/ui/privacy/useless-pub.rs similarity index 100% rename from src/test/ui/useless-pub.rs rename to src/test/ui/privacy/useless-pub.rs diff --git a/src/test/ui/useless-pub.stderr b/src/test/ui/privacy/useless-pub.stderr similarity index 100% rename from src/test/ui/useless-pub.stderr rename to src/test/ui/privacy/useless-pub.stderr diff --git a/src/test/ui/auxiliary/cond_plugin.rs b/src/test/ui/proc-macro/auxiliary/cond_plugin.rs similarity index 100% rename from src/test/ui/auxiliary/cond_plugin.rs rename to src/test/ui/proc-macro/auxiliary/cond_plugin.rs diff --git a/src/test/ui/macro-quote-cond.rs b/src/test/ui/proc-macro/macro-quote-cond.rs similarity index 100% rename from src/test/ui/macro-quote-cond.rs rename to src/test/ui/proc-macro/macro-quote-cond.rs diff --git a/src/test/ui/fds-are-cloexec.rs b/src/test/ui/process/fds-are-cloexec.rs similarity index 100% rename from src/test/ui/fds-are-cloexec.rs rename to src/test/ui/process/fds-are-cloexec.rs diff --git a/src/test/ui/sigpipe-should-be-ignored.rs b/src/test/ui/process/sigpipe-should-be-ignored.rs similarity index 100% rename from src/test/ui/sigpipe-should-be-ignored.rs rename to src/test/ui/process/sigpipe-should-be-ignored.rs diff --git a/src/test/ui/purity-infer.rs b/src/test/ui/purity-infer.rs deleted file mode 100644 index dc0eb89bfa2..00000000000 --- a/src/test/ui/purity-infer.rs +++ /dev/null @@ -1,6 +0,0 @@ -// run-pass - -fn something(f: F) where F: FnOnce() { f(); } -pub fn main() { - something(|| println!("hi!") ); -} diff --git a/src/test/ui/readalias.rs b/src/test/ui/readalias.rs deleted file mode 100644 index a6bf61803cf..00000000000 --- a/src/test/ui/readalias.rs +++ /dev/null @@ -1,12 +0,0 @@ -// run-pass - -#![allow(dead_code)] - - - - -struct Point {x: isize, y: isize, z: isize} - -fn f(p: Point) { assert_eq!(p.z, 12); } - -pub fn main() { let x: Point = Point {x: 10, y: 11, z: 12}; f(x); } diff --git a/src/test/ui/instantiable.rs b/src/test/ui/recursion/instantiable.rs similarity index 100% rename from src/test/ui/instantiable.rs rename to src/test/ui/recursion/instantiable.rs diff --git a/src/test/ui/reexport-should-still-link.rs b/src/test/ui/reexport-should-still-link.rs deleted file mode 100644 index 913da56a184..00000000000 --- a/src/test/ui/reexport-should-still-link.rs +++ /dev/null @@ -1,10 +0,0 @@ -// run-pass -// aux-build:reexport-should-still-link.rs - -// pretty-expanded FIXME #23616 - -extern crate reexport_should_still_link as foo; - -pub fn main() { - foo::bar(); -} diff --git a/src/test/ui/init-res-into-things.rs b/src/test/ui/regions/init-res-into-things.rs similarity index 100% rename from src/test/ui/init-res-into-things.rs rename to src/test/ui/regions/init-res-into-things.rs diff --git a/src/test/ui/owned-implies-static.rs b/src/test/ui/regions/owned-implies-static.rs similarity index 100% rename from src/test/ui/owned-implies-static.rs rename to src/test/ui/regions/owned-implies-static.rs diff --git a/src/test/ui/rcvr-borrowed-to-region.rs b/src/test/ui/regions/rcvr-borrowed-to-region.rs similarity index 100% rename from src/test/ui/rcvr-borrowed-to-region.rs rename to src/test/ui/regions/rcvr-borrowed-to-region.rs diff --git a/src/test/ui/attr-usage-repr.rs b/src/test/ui/repr/attr-usage-repr.rs similarity index 100% rename from src/test/ui/attr-usage-repr.rs rename to src/test/ui/repr/attr-usage-repr.rs diff --git a/src/test/ui/attr-usage-repr.stderr b/src/test/ui/repr/attr-usage-repr.stderr similarity index 100% rename from src/test/ui/attr-usage-repr.stderr rename to src/test/ui/repr/attr-usage-repr.stderr diff --git a/src/test/ui/repr.rs b/src/test/ui/repr/repr.rs similarity index 100% rename from src/test/ui/repr.rs rename to src/test/ui/repr/repr.rs diff --git a/src/test/ui/repr.stderr b/src/test/ui/repr/repr.stderr similarity index 100% rename from src/test/ui/repr.stderr rename to src/test/ui/repr/repr.stderr diff --git a/src/test/ui/crate-in-paths.rs b/src/test/ui/resolve/crate-in-paths.rs similarity index 100% rename from src/test/ui/crate-in-paths.rs rename to src/test/ui/resolve/crate-in-paths.rs diff --git a/src/test/ui/crate-in-paths.stderr b/src/test/ui/resolve/crate-in-paths.stderr similarity index 100% rename from src/test/ui/crate-in-paths.stderr rename to src/test/ui/resolve/crate-in-paths.stderr diff --git a/src/test/ui/editions-crate-root-2018.rs b/src/test/ui/resolve/editions-crate-root-2018.rs similarity index 100% rename from src/test/ui/editions-crate-root-2018.rs rename to src/test/ui/resolve/editions-crate-root-2018.rs diff --git a/src/test/ui/editions-crate-root-2018.stderr b/src/test/ui/resolve/editions-crate-root-2018.stderr similarity index 100% rename from src/test/ui/editions-crate-root-2018.stderr rename to src/test/ui/resolve/editions-crate-root-2018.stderr diff --git a/src/test/ui/enums-pats-not-idents.rs b/src/test/ui/resolve/enums-pats-not-idents.rs similarity index 100% rename from src/test/ui/enums-pats-not-idents.rs rename to src/test/ui/resolve/enums-pats-not-idents.rs diff --git a/src/test/ui/enums-pats-not-idents.stderr b/src/test/ui/resolve/enums-pats-not-idents.stderr similarity index 100% rename from src/test/ui/enums-pats-not-idents.stderr rename to src/test/ui/resolve/enums-pats-not-idents.stderr diff --git a/src/test/ui/no-implicit-prelude-nested.rs b/src/test/ui/resolve/no-implicit-prelude-nested.rs similarity index 100% rename from src/test/ui/no-implicit-prelude-nested.rs rename to src/test/ui/resolve/no-implicit-prelude-nested.rs diff --git a/src/test/ui/no-implicit-prelude-nested.stderr b/src/test/ui/resolve/no-implicit-prelude-nested.stderr similarity index 100% rename from src/test/ui/no-implicit-prelude-nested.stderr rename to src/test/ui/resolve/no-implicit-prelude-nested.stderr diff --git a/src/test/ui/resolve-issue-2428.rs b/src/test/ui/resolve/resolve-issue-2428.rs similarity index 100% rename from src/test/ui/resolve-issue-2428.rs rename to src/test/ui/resolve/resolve-issue-2428.rs diff --git a/src/test/ui/ret-none.rs b/src/test/ui/ret-none.rs deleted file mode 100644 index d595506e336..00000000000 --- a/src/test/ui/ret-none.rs +++ /dev/null @@ -1,13 +0,0 @@ -// run-pass - -#![allow(non_camel_case_types)] -#![allow(dead_code)] - - -// pretty-expanded FIXME #23616 - -enum option { none, some(T), } - -fn f() -> option { return option::none; } - -pub fn main() { f::(); } diff --git a/src/test/ui/out-of-stack.rs b/src/test/ui/runtime/out-of-stack.rs similarity index 100% rename from src/test/ui/out-of-stack.rs rename to src/test/ui/runtime/out-of-stack.rs diff --git a/src/test/ui/rt-explody-panic-payloads.rs b/src/test/ui/runtime/rt-explody-panic-payloads.rs similarity index 100% rename from src/test/ui/rt-explody-panic-payloads.rs rename to src/test/ui/runtime/rt-explody-panic-payloads.rs diff --git a/src/test/ui/running-with-no-runtime.rs b/src/test/ui/runtime/running-with-no-runtime.rs similarity index 100% rename from src/test/ui/running-with-no-runtime.rs rename to src/test/ui/runtime/running-with-no-runtime.rs diff --git a/src/test/ui/signal-alternate-stack-cleanup.rs b/src/test/ui/runtime/signal-alternate-stack-cleanup.rs similarity index 100% rename from src/test/ui/signal-alternate-stack-cleanup.rs rename to src/test/ui/runtime/signal-alternate-stack-cleanup.rs diff --git a/src/test/ui/stdout-during-shutdown.rs b/src/test/ui/runtime/stdout-during-shutdown.rs similarity index 100% rename from src/test/ui/stdout-during-shutdown.rs rename to src/test/ui/runtime/stdout-during-shutdown.rs diff --git a/src/test/ui/stdout-during-shutdown.run.stdout b/src/test/ui/runtime/stdout-during-shutdown.run.stdout similarity index 100% rename from src/test/ui/stdout-during-shutdown.run.stdout rename to src/test/ui/runtime/stdout-during-shutdown.run.stdout diff --git a/src/test/ui/duplicate_doc_alias.rs b/src/test/ui/rustdoc/duplicate_doc_alias.rs similarity index 100% rename from src/test/ui/duplicate_doc_alias.rs rename to src/test/ui/rustdoc/duplicate_doc_alias.rs diff --git a/src/test/ui/duplicate_doc_alias.stderr b/src/test/ui/rustdoc/duplicate_doc_alias.stderr similarity index 100% rename from src/test/ui/duplicate_doc_alias.stderr rename to src/test/ui/rustdoc/duplicate_doc_alias.stderr diff --git a/src/test/ui/hidden-doc-associated-item.rs b/src/test/ui/rustdoc/hidden-doc-associated-item.rs similarity index 100% rename from src/test/ui/hidden-doc-associated-item.rs rename to src/test/ui/rustdoc/hidden-doc-associated-item.rs diff --git a/src/test/ui/class-missing-self.rs b/src/test/ui/self/class-missing-self.rs similarity index 100% rename from src/test/ui/class-missing-self.rs rename to src/test/ui/self/class-missing-self.rs diff --git a/src/test/ui/class-missing-self.stderr b/src/test/ui/self/class-missing-self.stderr similarity index 100% rename from src/test/ui/class-missing-self.stderr rename to src/test/ui/self/class-missing-self.stderr diff --git a/src/test/ui/objects-owned-object-owned-method.rs b/src/test/ui/self/objects-owned-object-owned-method.rs similarity index 100% rename from src/test/ui/objects-owned-object-owned-method.rs rename to src/test/ui/self/objects-owned-object-owned-method.rs diff --git a/src/test/ui/refer-to-other-statics-by-value.rs b/src/test/ui/static/refer-to-other-statics-by-value.rs similarity index 100% rename from src/test/ui/refer-to-other-statics-by-value.rs rename to src/test/ui/static/refer-to-other-statics-by-value.rs diff --git a/src/test/ui/static_sized_requirement.rs b/src/test/ui/static/static_sized_requirement.rs similarity index 100% rename from src/test/ui/static_sized_requirement.rs rename to src/test/ui/static/static_sized_requirement.rs diff --git a/src/test/ui/builtin-clone.rs b/src/test/ui/stdlib-unit-tests/builtin-clone.rs similarity index 100% rename from src/test/ui/builtin-clone.rs rename to src/test/ui/stdlib-unit-tests/builtin-clone.rs diff --git a/src/test/ui/eq-multidispatch.rs b/src/test/ui/stdlib-unit-tests/eq-multidispatch.rs similarity index 100% rename from src/test/ui/eq-multidispatch.rs rename to src/test/ui/stdlib-unit-tests/eq-multidispatch.rs diff --git a/src/test/ui/istr.rs b/src/test/ui/stdlib-unit-tests/istr.rs similarity index 100% rename from src/test/ui/istr.rs rename to src/test/ui/stdlib-unit-tests/istr.rs diff --git a/src/test/ui/log-knows-the-names-of-variants-in-std.rs b/src/test/ui/stdlib-unit-tests/log-knows-the-names-of-variants-in-std.rs similarity index 100% rename from src/test/ui/log-knows-the-names-of-variants-in-std.rs rename to src/test/ui/stdlib-unit-tests/log-knows-the-names-of-variants-in-std.rs diff --git a/src/test/ui/seq-compare.rs b/src/test/ui/stdlib-unit-tests/seq-compare.rs similarity index 100% rename from src/test/ui/seq-compare.rs rename to src/test/ui/stdlib-unit-tests/seq-compare.rs diff --git a/src/test/ui/large-records.rs b/src/test/ui/structs/large-records.rs similarity index 100% rename from src/test/ui/large-records.rs rename to src/test/ui/structs/large-records.rs diff --git a/src/test/ui/bound-suggestions.fixed b/src/test/ui/suggestions/bound-suggestions.fixed similarity index 100% rename from src/test/ui/bound-suggestions.fixed rename to src/test/ui/suggestions/bound-suggestions.fixed diff --git a/src/test/ui/bound-suggestions.rs b/src/test/ui/suggestions/bound-suggestions.rs similarity index 100% rename from src/test/ui/bound-suggestions.rs rename to src/test/ui/suggestions/bound-suggestions.rs diff --git a/src/test/ui/bound-suggestions.stderr b/src/test/ui/suggestions/bound-suggestions.stderr similarity index 100% rename from src/test/ui/bound-suggestions.stderr rename to src/test/ui/suggestions/bound-suggestions.stderr diff --git a/src/test/ui/child-outlives-parent.rs b/src/test/ui/threads-sendsync/child-outlives-parent.rs similarity index 100% rename from src/test/ui/child-outlives-parent.rs rename to src/test/ui/threads-sendsync/child-outlives-parent.rs diff --git a/src/test/ui/mpsc_stress.rs b/src/test/ui/threads-sendsync/mpsc_stress.rs similarity index 100% rename from src/test/ui/mpsc_stress.rs rename to src/test/ui/threads-sendsync/mpsc_stress.rs diff --git a/src/test/ui/unwind-resource.rs b/src/test/ui/threads-sendsync/unwind-resource.rs similarity index 100% rename from src/test/ui/unwind-resource.rs rename to src/test/ui/threads-sendsync/unwind-resource.rs diff --git a/src/test/ui/yield.rs b/src/test/ui/threads-sendsync/yield.rs similarity index 100% rename from src/test/ui/yield.rs rename to src/test/ui/threads-sendsync/yield.rs diff --git a/src/test/ui/yield1.rs b/src/test/ui/threads-sendsync/yield1.rs similarity index 100% rename from src/test/ui/yield1.rs rename to src/test/ui/threads-sendsync/yield1.rs diff --git a/src/test/ui/bug-7295.rs b/src/test/ui/traits/bug-7295.rs similarity index 100% rename from src/test/ui/bug-7295.rs rename to src/test/ui/traits/bug-7295.rs diff --git a/src/test/ui/monad.rs b/src/test/ui/traits/monad.rs similarity index 100% rename from src/test/ui/monad.rs rename to src/test/ui/traits/monad.rs diff --git a/src/test/ui/monomorphized-callees-with-ty-params-3314.rs b/src/test/ui/traits/monomorphized-callees-with-ty-params-3314.rs similarity index 100% rename from src/test/ui/monomorphized-callees-with-ty-params-3314.rs rename to src/test/ui/traits/monomorphized-callees-with-ty-params-3314.rs diff --git a/src/test/ui/multidispatch-conditional-impl-not-considered.rs b/src/test/ui/traits/multidispatch-conditional-impl-not-considered.rs similarity index 100% rename from src/test/ui/multidispatch-conditional-impl-not-considered.rs rename to src/test/ui/traits/multidispatch-conditional-impl-not-considered.rs diff --git a/src/test/ui/multidispatch1.rs b/src/test/ui/traits/multidispatch1.rs similarity index 100% rename from src/test/ui/multidispatch1.rs rename to src/test/ui/traits/multidispatch1.rs diff --git a/src/test/ui/multidispatch2.rs b/src/test/ui/traits/multidispatch2.rs similarity index 100% rename from src/test/ui/multidispatch2.rs rename to src/test/ui/traits/multidispatch2.rs diff --git a/src/test/ui/objects-owned-object-borrowed-method-headerless.rs b/src/test/ui/traits/objects-owned-object-borrowed-method-headerless.rs similarity index 100% rename from src/test/ui/objects-owned-object-borrowed-method-headerless.rs rename to src/test/ui/traits/objects-owned-object-borrowed-method-headerless.rs diff --git a/src/test/ui/staticness-mismatch.rs b/src/test/ui/traits/staticness-mismatch.rs similarity index 100% rename from src/test/ui/staticness-mismatch.rs rename to src/test/ui/traits/staticness-mismatch.rs diff --git a/src/test/ui/staticness-mismatch.stderr b/src/test/ui/traits/staticness-mismatch.stderr similarity index 100% rename from src/test/ui/staticness-mismatch.stderr rename to src/test/ui/traits/staticness-mismatch.stderr diff --git a/src/test/ui/typeclasses-eq-example-static.rs b/src/test/ui/traits/typeclasses-eq-example-static.rs similarity index 100% rename from src/test/ui/typeclasses-eq-example-static.rs rename to src/test/ui/traits/typeclasses-eq-example-static.rs diff --git a/src/test/ui/typeclasses-eq-example.rs b/src/test/ui/traits/typeclasses-eq-example.rs similarity index 100% rename from src/test/ui/typeclasses-eq-example.rs rename to src/test/ui/traits/typeclasses-eq-example.rs diff --git a/src/test/ui/vtable-res-trait-param.rs b/src/test/ui/traits/vtable-res-trait-param.rs similarity index 100% rename from src/test/ui/vtable-res-trait-param.rs rename to src/test/ui/traits/vtable-res-trait-param.rs diff --git a/src/test/ui/vtable-res-trait-param.stderr b/src/test/ui/traits/vtable-res-trait-param.stderr similarity index 100% rename from src/test/ui/vtable-res-trait-param.stderr rename to src/test/ui/traits/vtable-res-trait-param.stderr diff --git a/src/test/ui/tuple-index-fat-types.rs b/src/test/ui/tuple/tuple-index-fat-types.rs similarity index 100% rename from src/test/ui/tuple-index-fat-types.rs rename to src/test/ui/tuple/tuple-index-fat-types.rs diff --git a/src/test/ui/type-in-nested-module.rs b/src/test/ui/type-in-nested-module.rs deleted file mode 100644 index 8a92f065f1b..00000000000 --- a/src/test/ui/type-in-nested-module.rs +++ /dev/null @@ -1,17 +0,0 @@ -// run-pass - -#![allow(non_camel_case_types)] -#![allow(dead_code)] - - -// pretty-expanded FIXME #23616 - -mod a { - pub mod b { - pub type t = isize; - - pub fn foo() { let _x: t = 10; } - } -} - -pub fn main() { } diff --git a/src/test/ui/prim-with-args.rs b/src/test/ui/typeck/prim-with-args.rs similarity index 100% rename from src/test/ui/prim-with-args.rs rename to src/test/ui/typeck/prim-with-args.rs diff --git a/src/test/ui/prim-with-args.stderr b/src/test/ui/typeck/prim-with-args.stderr similarity index 100% rename from src/test/ui/prim-with-args.stderr rename to src/test/ui/typeck/prim-with-args.stderr diff --git a/src/test/ui/maybe-bounds-where-cpass.rs b/src/test/ui/unsized/maybe-bounds-where-cpass.rs similarity index 69% rename from src/test/ui/maybe-bounds-where-cpass.rs rename to src/test/ui/unsized/maybe-bounds-where-cpass.rs index d4bc05f7cb4..0e018cdabb2 100644 --- a/src/test/ui/maybe-bounds-where-cpass.rs +++ b/src/test/ui/unsized/maybe-bounds-where-cpass.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass struct S(*const T) where T: ?Sized; diff --git a/src/test/ui/use-crate-name-alias.rs b/src/test/ui/use-crate-name-alias.rs deleted file mode 100644 index 0920d968585..00000000000 --- a/src/test/ui/use-crate-name-alias.rs +++ /dev/null @@ -1,7 +0,0 @@ -// run-pass -// Issue #1706 -// pretty-expanded FIXME #23616 - -extern crate std as stdlib; - -pub fn main() {} diff --git a/src/test/ui/writealias.rs b/src/test/ui/writealias.rs deleted file mode 100644 index 8ba4b09ae29..00000000000 --- a/src/test/ui/writealias.rs +++ /dev/null @@ -1,19 +0,0 @@ -// run-pass - -#![allow(dead_code)] - -use std::sync::Mutex; - -struct Point {x: isize, y: isize, z: isize} - -fn f(p: &mut Point) { p.z = 13; } - -pub fn main() { - let x = Some(Mutex::new(true)); - match x { - Some(ref z) if *z.lock().unwrap() => { - assert!(*z.lock().unwrap()); - }, - _ => panic!() - } -} diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 88ede45655c..cc058d538f3 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -7,8 +7,9 @@ use std::path::Path; const ENTRY_LIMIT: usize = 1000; // FIXME: The following limits should be reduced eventually. -const ROOT_ENTRY_LIMIT: usize = 1275; +const ROOT_ENTRY_LIMIT: usize = 1102; const ISSUES_ENTRY_LIMIT: usize = 2310; +const PARSER_LIMIT: usize = 1004; fn check_entries(path: &Path, bad: &mut bool) { let dirs = walkdir::WalkDir::new(&path.join("test/ui")) @@ -21,10 +22,13 @@ fn check_entries(path: &Path, bad: &mut bool) { // Use special values for these dirs. let is_root = path.join("test/ui") == dir_path; let is_issues_dir = path.join("test/ui/issues") == dir_path; + let is_parser = path.join("test/ui/parser") == dir_path; let limit = if is_root { ROOT_ENTRY_LIMIT } else if is_issues_dir { ISSUES_ENTRY_LIMIT + } else if is_parser { + PARSER_LIMIT } else { ENTRY_LIMIT }; From c4884bbec7ae6ba06211a2769271b8db38c8284b Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Thu, 21 Oct 2021 13:18:59 +0200 Subject: [PATCH 11/12] Support having -Z and -C options with the same name Tweak the `options!` macro to allow for -Z and -C options with the same name without generating conflicting internal parsing functions. Split out of the commit stabilizing -Z strip as -C strip. --- compiler/rustc_session/src/options.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index d1d8606a75a..8b9ec5028d1 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -219,7 +219,7 @@ top_level_options!( /// generated code to parse an option into its respective field in the struct. There are a few /// hand-written parsers for parsing specific types of values in this module. macro_rules! options { - ($struct_name:ident, $stat:ident, $prefix:expr, $outputname:expr, + ($struct_name:ident, $stat:ident, $optmod:ident, $prefix:expr, $outputname:expr, $($( #[$attr:meta] )* $opt:ident : $t:ty = ( $init:expr, $parse:ident, @@ -264,13 +264,15 @@ macro_rules! options { } pub const $stat: OptionDescrs<$struct_name> = - &[ $( (stringify!($opt), $opt, desc::$parse, $desc) ),* ]; + &[ $( (stringify!($opt), $optmod::$opt, desc::$parse, $desc) ),* ]; + mod $optmod { $( - fn $opt(cg: &mut $struct_name, v: Option<&str>) -> bool { - parse::$parse(&mut redirect_field!(cg.$opt), v) + pub(super) fn $opt(cg: &mut super::$struct_name, v: Option<&str>) -> bool { + super::parse::$parse(&mut redirect_field!(cg.$opt), v) } )* + } ) } @@ -918,7 +920,7 @@ mod parse { } options! { - CodegenOptions, CG_OPTIONS, "C", "codegen", + CodegenOptions, CG_OPTIONS, cgopts, "C", "codegen", // This list is in alphabetical order. // @@ -1027,7 +1029,7 @@ options! { } options! { - DebuggingOptions, DB_OPTIONS, "Z", "debugging", + DebuggingOptions, DB_OPTIONS, dbopts, "Z", "debugging", // This list is in alphabetical order. // From e35b7bbdf8bf9939be5bcbaef781b95e8c93b6e1 Mon Sep 17 00:00:00 2001 From: Josh Triplett Date: Thu, 21 Oct 2021 13:19:46 +0200 Subject: [PATCH 12/12] Stabilize -Z strip as -C strip Leave -Z strip available temporarily as an alias, to avoid breaking cargo until cargo transitions to using -C strip. (If the user passes both, the -C version wins.) --- compiler/rustc_codegen_ssa/src/back/link.rs | 14 ++++++++++++-- compiler/rustc_interface/src/tests.rs | 2 +- compiler/rustc_session/src/config.rs | 2 +- compiler/rustc_session/src/options.rs | 2 ++ src/doc/rustc/src/codegen-options/index.md | 16 ++++++++++++++++ .../unstable-book/src/compiler-flags/strip.md | 17 ----------------- 6 files changed, 32 insertions(+), 21 deletions(-) delete mode 100644 src/doc/unstable-book/src/compiler-flags/strip.md diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 1ba0c4fa05b..638b2a7b5a9 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -1034,8 +1034,10 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>( SplitDebuginfo::Packed => link_dwarf_object(sess, &out_filename), } + let strip = strip_value(sess); + if sess.target.is_like_osx { - match sess.opts.debugging_opts.strip { + match strip { Strip::Debuginfo => strip_symbols_in_osx(sess, &out_filename, Some("-S")), Strip::Symbols => strip_symbols_in_osx(sess, &out_filename, None), Strip::None => {} @@ -1043,6 +1045,14 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>( } } +// Temporarily support both -Z strip and -C strip +fn strip_value(sess: &Session) -> Strip { + match (sess.opts.debugging_opts.strip, sess.opts.cg.strip) { + (s, Strip::None) => s, + (_, s) => s, + } +} + fn strip_symbols_in_osx<'a>(sess: &'a Session, out_filename: &Path, option: Option<&str>) { let mut cmd = Command::new("strip"); if let Some(option) = option { @@ -2014,7 +2024,7 @@ fn add_order_independent_options( cmd.optimize(); // Pass debuginfo and strip flags down to the linker. - cmd.debuginfo(sess.opts.debugging_opts.strip); + cmd.debuginfo(strip_value(sess)); // We want to prevent the compiler from accidentally leaking in any system libraries, // so by default we tell linkers not to link to any default libraries. diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs index eed2e07e890..6b666d7c292 100644 --- a/compiler/rustc_interface/src/tests.rs +++ b/compiler/rustc_interface/src/tests.rs @@ -551,6 +551,7 @@ fn test_codegen_options_tracking_hash() { untracked!(remark, Passes::Some(vec![String::from("pass1"), String::from("pass2")])); untracked!(rpath, true); untracked!(save_temps, true); + untracked!(strip, Strip::Debuginfo); macro_rules! tracked { ($name: ident, $non_default_value: expr) => { @@ -684,7 +685,6 @@ fn test_debugging_options_tracking_hash() { untracked!(self_profile_events, Some(vec![String::new()])); untracked!(span_debug, true); untracked!(span_free_formats, true); - untracked!(strip, Strip::Debuginfo); untracked!(temps_dir, Some(String::from("abc"))); untracked!(terminal_width, Some(80)); untracked!(threads, 99); diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 3afe0947339..5e6bbe03918 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -37,7 +37,7 @@ use std::iter::{self, FromIterator}; use std::path::{Path, PathBuf}; use std::str::{self, FromStr}; -/// The different settings that the `-Z strip` flag can have. +/// The different settings that the `-C strip` flag can have. #[derive(Clone, Copy, PartialEq, Hash, Debug)] pub enum Strip { /// Do not strip at all. diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index 8b9ec5028d1..3f279a045f1 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -1015,6 +1015,8 @@ options! { "use soft float ABI (*eabihf targets only) (default: no)"), split_debuginfo: Option = (None, parse_split_debuginfo, [TRACKED], "how to handle split-debuginfo, a platform-specific option"), + strip: Strip = (Strip::None, parse_strip, [UNTRACKED], + "tell the linker which information to strip (`none` (default), `debuginfo` or `symbols`)"), target_cpu: Option = (None, parse_opt_string, [TRACKED], "select target processor (`rustc --print target-cpus` for details)"), target_feature: String = (String::new(), parse_target_feature, [TRACKED], diff --git a/src/doc/rustc/src/codegen-options/index.md b/src/doc/rustc/src/codegen-options/index.md index 4f8c4c66f88..0201b88417a 100644 --- a/src/doc/rustc/src/codegen-options/index.md +++ b/src/doc/rustc/src/codegen-options/index.md @@ -525,6 +525,22 @@ platforms. Possible values are: Note that `packed` and `unpacked` are gated behind `-Z unstable-options` on non-macOS platforms at this time. +## strip + +The option `-C strip=val` controls stripping of debuginfo and similar auxiliary +data from binaries during linking. + +Supported values for this option are: + +- `none` - debuginfo and symbols (if they exist) are copied to the produced + binary or separate files depending on the target (e.g. `.pdb` files in case + of MSVC). +- `debuginfo` - debuginfo sections and debuginfo symbols from the symbol table + section are stripped at link time and are not copied to the produced binary + or separate files. +- `symbols` - same as `debuginfo`, but the rest of the symbol table section is + stripped as well if the linker supports it. + ## target-cpu This instructs `rustc` to generate code specifically for a particular processor. diff --git a/src/doc/unstable-book/src/compiler-flags/strip.md b/src/doc/unstable-book/src/compiler-flags/strip.md deleted file mode 100644 index 52cb98113c0..00000000000 --- a/src/doc/unstable-book/src/compiler-flags/strip.md +++ /dev/null @@ -1,17 +0,0 @@ -# `strip` - -The tracking issue for this feature is: [#72110](https://github.com/rust-lang/rust/issues/72110). - ------------------------- - -Option `-Z strip=val` controls stripping of debuginfo and similar auxiliary data from binaries -during linking. - -Supported values for this option are: - -- `none` - debuginfo and symbols (if they exist) are copied to the produced binary or separate files -depending on the target (e.g. `.pdb` files in case of MSVC). -- `debuginfo` - debuginfo sections and debuginfo symbols from the symbol table section -are stripped at link time and are not copied to the produced binary or separate files. -- `symbols` - same as `debuginfo`, but the rest of the symbol table section is stripped as well -if the linker supports it.