diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index 1ba0c4fa05b5b..638b2a7b5a9f2 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_const_eval/src/interpret/memory.rs b/compiler/rustc_const_eval/src/interpret/memory.rs index b8b6ff93753f0..4aa3c83cc0243 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, }; + // 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. - // (`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. - 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 // Destination alloc preparations and access hooks. let (dest_alloc, extra) = self.get_raw_mut(dest_alloc_id)?; diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs index eed2e07e890e7..6b666d7c29222 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 3afe094733928..5e6bbe0391881 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 d1d8606a75a45..3f279a045f159 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. // @@ -1013,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], @@ -1027,7 +1031,7 @@ options! { } options! { - DebuggingOptions, DB_OPTIONS, "Z", "debugging", + DebuggingOptions, DB_OPTIONS, dbopts, "Z", "debugging", // This list is in alphabetical order. // diff --git a/compiler/rustc_target/src/spec/android_base.rs b/compiler/rustc_target/src/spec/android_base.rs index aaf81648c51b3..0f01a78c8c592 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. diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index 584b90d613f6b..e4a566f589582 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/src/num/int_macros.rs b/library/core/src/num/int_macros.rs index 052e1a21b32cb..9a668d34b6278 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 0c00db5fdf37a..a8f2ded46594e 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. diff --git a/library/core/tests/simd.rs b/library/core/tests/simd.rs index 8c11d788c67ae..50c92968c9d82 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] diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs index e13add799bcb9..a14f1e2ecb2c4 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() } diff --git a/library/std/src/fs/tests.rs b/library/std/src/fs/tests.rs index 628de13156c67..1417d860c47f5 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"); diff --git a/library/std/src/os/wasi/fs.rs b/library/std/src/os/wasi/fs.rs index 907368061d7c4..5c62679f552d6 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 { diff --git a/library/std/src/process.rs b/library/std/src/process.rs index b4dab41f06632..4e9fd51f28229 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; @@ -2065,6 +2066,14 @@ impl Termination for Result { } } +#[unstable(feature = "termination_trait_lib", issue = "43301")] +impl Termination for Result { + fn report(self) -> i32 { + let Err(err) = self; + Err::(err).report() + } +} + #[unstable(feature = "termination_trait_lib", issue = "43301")] impl Termination for ExitCode { #[inline] diff --git a/src/doc/rustc/src/codegen-options/index.md b/src/doc/rustc/src/codegen-options/index.md index 4f8c4c66f8891..0201b88417a8b 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 52cb98113c0c1..0000000000000 --- 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. 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 c7f7fbad435ee..0000000000000 --- 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 8e686796fee9b..0000000000000 --- 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/consts/issue-miri-1910.rs b/src/test/ui/consts/issue-miri-1910.rs new file mode 100644 index 0000000000000..20efa145dbe1e --- /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 0000000000000..e2f4ef635887c --- /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 + 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 1d0a427395317..0000000000000 --- 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 3f543636064e4..0000000000000 --- 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 753424c7f88b8..0000000000000 --- 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 6d18b03891a37..0000000000000 --- 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 0d6b6369f9471..0000000000000 --- 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 64ebeddffa8cf..0000000000000 --- 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 7cf47d0764b1e..0000000000000 --- 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 5fa11ad1283b9..0000000000000 --- 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 c5e2fd92f0441..cb1abd435710e 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 1b38527ec2907..0000000000000 --- 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 8e8bb8800ec0d..0000000000000 --- 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 dc0eb89bfa207..0000000000000 --- 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 a6bf61803cf85..0000000000000 --- 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 913da56a184f5..0000000000000 --- 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 d595506e336f6..0000000000000 --- 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 8a92f065f1bb8..0000000000000 --- 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 d4bc05f7cb421..0e018cdabb23f 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 0920d96858539..0000000000000 --- 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 8ba4b09ae2985..0000000000000 --- 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 88ede45655c94..cc058d538f388 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 };