From 8d2beb50c2b228f4bd6f8e2d81d82c9e1f5e5ba2 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Mon, 27 Mar 2023 21:22:36 -0500 Subject: [PATCH 01/16] Allow access to `OsStr` bytes `OsStr` has historically kept its implementation details private out of concern for locking us into a specific encoding on Windows. This is an alternative to #95290 which proposed specifying the encoding on Windows. Instead, this only specifies that for cross-platform code, `OsStr`'s encoding is a superset of UTF-8 and defines rules for safely interacting with it At minimum, this can greatly simplify the `os_str_bytes` crate and every arg parser that interacts with `OsStr` directly (which is most of those that support invalid UTF-8). --- library/std/src/ffi/mod.rs | 8 ++++ library/std/src/ffi/os_str.rs | 56 +++++++++++++++++++++++- library/std/src/sys/unix/os_str.rs | 9 +++- library/std/src/sys/unix/os_str/tests.rs | 9 ++-- library/std/src/sys/windows/os_str.rs | 10 +++++ library/std/src/sys_common/wtf8.rs | 8 +++- 6 files changed, 91 insertions(+), 9 deletions(-) diff --git a/library/std/src/ffi/mod.rs b/library/std/src/ffi/mod.rs index d987bf69b2576..3ddb8748753e4 100644 --- a/library/std/src/ffi/mod.rs +++ b/library/std/src/ffi/mod.rs @@ -127,6 +127,14 @@ //! trait, which provides a [`from_wide`] method to convert a native Windows //! string (without the terminating nul character) to an [`OsString`]. //! +//! ## On all platforms +//! +//! On all platforms, [`OsStr`] consists of a sequence of bytes that is encoded as a superset of +//! UTF-8; see [`OsString`] for more details on its encoding on different platforms. +//! +//! For limited, inexpensive conversions from and to bytes, see [`OsStr::as_os_str_bytes`] and +//! [`OsStr::from_os_str_bytes_unchecked`]. +//! //! [Unicode scalar value]: https://www.unicode.org/glossary/#unicode_scalar_value //! [Unicode code point]: https://www.unicode.org/glossary/#code_point //! [`env::set_var()`]: crate::env::set_var "env::set_var" diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index 5c0541d3caf33..25ab2196688b0 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -667,6 +667,45 @@ impl OsStr { s.as_ref() } + /// Converts a slice of bytes to an OS string slice without checking that the string contains + /// valid `OsStr`-encoded data. + /// + /// See the [module's toplevel documentation about conversions][conversions] for safe, + /// cross-platform [conversions] from/to native representations. + /// + /// # Safety + /// + /// `OsStr`'s encoding is an unspecified superset of UTF-8 and callers must + /// pass in bytes that originated as a mixture of validated UTF-8 and bytes from + /// [`OsStr::as_os_str_bytes`] from within the same rust version built for the same target + /// platform. The bytes from `OsStr::as_os_str_bytes` may be split either + /// immediately before or immediately after some valid non-empty UTF-8 substring + /// + /// # Example + /// + /// ``` + /// #![feature(os_str_bytes)] + /// + /// use std::ffi::OsStr; + /// + /// let os_str = OsStr::new("Mary had a little lamb"); + /// let bytes = os_str.as_os_str_bytes(); + /// let words = bytes.split(|b| *b == b' '); + /// let words: Vec<&OsStr> = words.map(|word| { + /// // SAFETY: + /// // - Each `word` only contains content that originated from `OsStr::as_os_str_bytes` + /// // - Only split with ASCII whitespace which is a non-empty UTF-8 substring + /// unsafe { OsStr::from_os_str_bytes_unchecked(word) } + /// }).collect(); + /// ``` + /// + /// [conversions]: super#conversions + #[inline] + #[unstable(feature = "os_str_bytes", issue = "111544")] + pub fn from_os_str_bytes_unchecked(bytes: &[u8]) -> &Self { + Self::from_inner(Slice::from_os_str_bytes_unchecked(bytes)) + } + #[inline] fn from_inner(inner: &Slice) -> &OsStr { // SAFETY: OsStr is just a wrapper of Slice, @@ -837,13 +876,28 @@ impl OsStr { OsString { inner: Buf::from_box(boxed) } } + /// Converts an OS string slice to a byte slice. To convert the byte slice back into an OS + /// string slice, use the [`OsStr::from_os_str_bytes_unchecked`] function. + /// + /// Note: As the encoding is unspecified, any sub-slice of bytes that is not valid UTF-8 should + /// be treated as opaque and only comparable within the same rust version built for the same + /// target platform. See [`OsString`] for more encoding details and [`std::ffi`] for + /// platform-specific, specified conversions. + /// + /// [`std::ffi`]: crate::ffi + #[inline] + #[unstable(feature = "os_str_bytes", issue = "111544")] + pub fn as_os_str_bytes(&self) -> &[u8] { + self.inner.as_os_str_bytes() + } + /// Gets the underlying byte representation. /// /// Note: it is *crucial* that this API is not externally public, to avoid /// revealing the internal, platform-specific encodings. #[inline] pub(crate) fn bytes(&self) -> &[u8] { - unsafe { &*(&self.inner as *const _ as *const [u8]) } + self.as_os_str_bytes() } /// Converts this string to its ASCII lower case equivalent in-place. diff --git a/library/std/src/sys/unix/os_str.rs b/library/std/src/sys/unix/os_str.rs index 488217f39413f..142fcb9ed0b73 100644 --- a/library/std/src/sys/unix/os_str.rs +++ b/library/std/src/sys/unix/os_str.rs @@ -193,13 +193,18 @@ impl Buf { impl Slice { #[inline] - fn from_u8_slice(s: &[u8]) -> &Slice { + pub fn as_os_str_bytes(&self) -> &[u8] { + &self.inner + } + + #[inline] + pub unsafe fn from_os_str_bytes_unchecked(s: &[u8]) -> &Slice { unsafe { mem::transmute(s) } } #[inline] pub fn from_str(s: &str) -> &Slice { - Slice::from_u8_slice(s.as_bytes()) + unsafe { Slice::from_os_str_bytes_unchecked(s.as_bytes()) } } pub fn to_str(&self) -> Option<&str> { diff --git a/library/std/src/sys/unix/os_str/tests.rs b/library/std/src/sys/unix/os_str/tests.rs index 22ba0c9235041..91bc0e61a4a5b 100644 --- a/library/std/src/sys/unix/os_str/tests.rs +++ b/library/std/src/sys/unix/os_str/tests.rs @@ -2,7 +2,7 @@ use super::*; #[test] fn slice_debug_output() { - let input = Slice::from_u8_slice(b"\xF0hello,\tworld"); + let input = unsafe { Slice::from_os_str_bytes_unchecked(b"\xF0hello,\tworld") }; let expected = r#""\xF0hello,\tworld""#; let output = format!("{input:?}"); @@ -11,8 +11,7 @@ fn slice_debug_output() { #[test] fn display() { - assert_eq!( - "Hello\u{FFFD}\u{FFFD} There\u{FFFD} Goodbye", - Slice::from_u8_slice(b"Hello\xC0\x80 There\xE6\x83 Goodbye").to_string(), - ); + assert_eq!("Hello\u{FFFD}\u{FFFD} There\u{FFFD} Goodbye", unsafe { + Slice::from_os_str_bytes_unchecked(b"Hello\xC0\x80 There\xE6\x83 Goodbye").to_string() + },); } diff --git a/library/std/src/sys/windows/os_str.rs b/library/std/src/sys/windows/os_str.rs index 2f2b0e56e0889..611f0d040f0eb 100644 --- a/library/std/src/sys/windows/os_str.rs +++ b/library/std/src/sys/windows/os_str.rs @@ -151,6 +151,16 @@ impl Buf { } impl Slice { + #[inline] + pub fn as_os_str_bytes(&self) -> &[u8] { + self.inner.as_bytes() + } + + #[inline] + pub unsafe fn from_os_str_bytes_unchecked(s: &[u8]) -> &Slice { + mem::transmute(Wtf8::from_bytes_unchecked(s)) + } + #[inline] pub fn from_str(s: &str) -> &Slice { unsafe { mem::transmute(Wtf8::from_str(s)) } diff --git a/library/std/src/sys_common/wtf8.rs b/library/std/src/sys_common/wtf8.rs index ff96c35fb0ba6..31bb0ad25a656 100644 --- a/library/std/src/sys_common/wtf8.rs +++ b/library/std/src/sys_common/wtf8.rs @@ -570,7 +570,7 @@ impl Wtf8 { /// Since the byte slice is not checked for valid WTF-8, this functions is /// marked unsafe. #[inline] - unsafe fn from_bytes_unchecked(value: &[u8]) -> &Wtf8 { + pub unsafe fn from_bytes_unchecked(value: &[u8]) -> &Wtf8 { mem::transmute(value) } @@ -614,6 +614,12 @@ impl Wtf8 { Wtf8CodePoints { bytes: self.bytes.iter() } } + /// Access raw bytes of WTF-8 data + #[inline] + pub fn as_bytes(&self) -> &[u8] { + &self.bytes + } + /// Tries to convert the string to UTF-8 and return a `&str` slice. /// /// Returns `None` if the string contains surrogates. From 7f1a6cd421d699aa249a282d7b5b7a8f486e3b01 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Sat, 13 May 2023 18:47:14 +0200 Subject: [PATCH 02/16] refactor: Remove redundant, private OsStr::bytes --- library/std/src/ffi/os_str.rs | 27 +++++++------------ library/std/src/path.rs | 16 +++++------ library/std/src/sys/common/small_c_string.rs | 2 +- library/std/src/sys/common/tests.rs | 4 +-- library/std/src/sys/unix/path.rs | 2 +- .../src/sys/unix/process/process_common.rs | 4 +-- library/std/src/sys/windows/args.rs | 6 +++-- library/std/src/sys/windows/path.rs | 24 ++++++++--------- library/std/src/sys/windows/process.rs | 4 +-- 9 files changed, 41 insertions(+), 48 deletions(-) diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index 25ab2196688b0..90cbd57a9298f 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -702,7 +702,7 @@ impl OsStr { /// [conversions]: super#conversions #[inline] #[unstable(feature = "os_str_bytes", issue = "111544")] - pub fn from_os_str_bytes_unchecked(bytes: &[u8]) -> &Self { + pub unsafe fn from_os_str_bytes_unchecked(bytes: &[u8]) -> &Self { Self::from_inner(Slice::from_os_str_bytes_unchecked(bytes)) } @@ -891,15 +891,6 @@ impl OsStr { self.inner.as_os_str_bytes() } - /// Gets the underlying byte representation. - /// - /// Note: it is *crucial* that this API is not externally public, to avoid - /// revealing the internal, platform-specific encodings. - #[inline] - pub(crate) fn bytes(&self) -> &[u8] { - self.as_os_str_bytes() - } - /// Converts this string to its ASCII lower case equivalent in-place. /// /// ASCII letters 'A' to 'Z' are mapped to 'a' to 'z', @@ -1185,7 +1176,7 @@ impl Default for &OsStr { impl PartialEq for OsStr { #[inline] fn eq(&self, other: &OsStr) -> bool { - self.bytes().eq(other.bytes()) + self.as_os_str_bytes().eq(other.as_os_str_bytes()) } } @@ -1212,23 +1203,23 @@ impl Eq for OsStr {} impl PartialOrd for OsStr { #[inline] fn partial_cmp(&self, other: &OsStr) -> Option { - self.bytes().partial_cmp(other.bytes()) + self.as_os_str_bytes().partial_cmp(other.as_os_str_bytes()) } #[inline] fn lt(&self, other: &OsStr) -> bool { - self.bytes().lt(other.bytes()) + self.as_os_str_bytes().lt(other.as_os_str_bytes()) } #[inline] fn le(&self, other: &OsStr) -> bool { - self.bytes().le(other.bytes()) + self.as_os_str_bytes().le(other.as_os_str_bytes()) } #[inline] fn gt(&self, other: &OsStr) -> bool { - self.bytes().gt(other.bytes()) + self.as_os_str_bytes().gt(other.as_os_str_bytes()) } #[inline] fn ge(&self, other: &OsStr) -> bool { - self.bytes().ge(other.bytes()) + self.as_os_str_bytes().ge(other.as_os_str_bytes()) } } @@ -1247,7 +1238,7 @@ impl PartialOrd for OsStr { impl Ord for OsStr { #[inline] fn cmp(&self, other: &OsStr) -> cmp::Ordering { - self.bytes().cmp(other.bytes()) + self.as_os_str_bytes().cmp(other.as_os_str_bytes()) } } @@ -1297,7 +1288,7 @@ impl_cmp!(Cow<'a, OsStr>, OsString); impl Hash for OsStr { #[inline] fn hash(&self, state: &mut H) { - self.bytes().hash(state) + self.as_os_str_bytes().hash(state) } } diff --git a/library/std/src/path.rs b/library/std/src/path.rs index febdeb514634c..6f770d4c91b19 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -193,7 +193,7 @@ impl<'a> Prefix<'a> { fn len(&self) -> usize { use self::Prefix::*; fn os_str_len(s: &OsStr) -> usize { - s.bytes().len() + s.as_os_str_bytes().len() } match *self { Verbatim(x) => 4 + os_str_len(x), @@ -330,7 +330,7 @@ fn has_physical_root(s: &[u8], prefix: Option>) -> bool { // basic workhorse for splitting stem and extension fn rsplit_file_at_dot(file: &OsStr) -> (Option<&OsStr>, Option<&OsStr>) { - if file.bytes() == b".." { + if file.as_os_str_bytes() == b".." { return (Some(file), None); } @@ -338,7 +338,7 @@ fn rsplit_file_at_dot(file: &OsStr) -> (Option<&OsStr>, Option<&OsStr>) { // and back. This is safe to do because (1) we only look at ASCII // contents of the encoding and (2) new &OsStr values are produced // only from ASCII-bounded slices of existing &OsStr values. - let mut iter = file.bytes().rsplitn(2, |b| *b == b'.'); + let mut iter = file.as_os_str_bytes().rsplitn(2, |b| *b == b'.'); let after = iter.next(); let before = iter.next(); if before == Some(b"") { @@ -349,7 +349,7 @@ fn rsplit_file_at_dot(file: &OsStr) -> (Option<&OsStr>, Option<&OsStr>) { } fn split_file_at_dot(file: &OsStr) -> (&OsStr, Option<&OsStr>) { - let slice = file.bytes(); + let slice = file.as_os_str_bytes(); if slice == b".." { return (file, None); } @@ -1481,17 +1481,17 @@ impl PathBuf { fn _set_extension(&mut self, extension: &OsStr) -> bool { let file_stem = match self.file_stem() { None => return false, - Some(f) => f.bytes(), + Some(f) => f.as_os_str_bytes(), }; // truncate until right after the file stem let end_file_stem = file_stem[file_stem.len()..].as_ptr().addr(); - let start = self.inner.bytes().as_ptr().addr(); + let start = self.inner.as_os_str_bytes().as_ptr().addr(); let v = self.as_mut_vec(); v.truncate(end_file_stem.wrapping_sub(start)); // add the new extension, if any - let new = extension.bytes(); + let new = extension.as_os_str_bytes(); if !new.is_empty() { v.reserve_exact(new.len() + 1); v.push(b'.'); @@ -2015,7 +2015,7 @@ impl Path { } // The following (private!) function reveals the byte encoding used for OsStr. fn as_u8_slice(&self) -> &[u8] { - self.inner.bytes() + self.inner.as_os_str_bytes() } /// Directly wraps a string slice as a `Path` slice. diff --git a/library/std/src/sys/common/small_c_string.rs b/library/std/src/sys/common/small_c_string.rs index 01acd5191351c..963d17a47e4c0 100644 --- a/library/std/src/sys/common/small_c_string.rs +++ b/library/std/src/sys/common/small_c_string.rs @@ -19,7 +19,7 @@ pub fn run_path_with_cstr(path: &Path, f: F) -> io::Result where F: FnOnce(&CStr) -> io::Result, { - run_with_cstr(path.as_os_str().bytes(), f) + run_with_cstr(path.as_os_str().as_os_str_bytes(), f) } #[inline] diff --git a/library/std/src/sys/common/tests.rs b/library/std/src/sys/common/tests.rs index fb6f5d6af8371..0a1cbcbe8ef37 100644 --- a/library/std/src/sys/common/tests.rs +++ b/library/std/src/sys/common/tests.rs @@ -8,7 +8,7 @@ use core::iter::repeat; fn stack_allocation_works() { let path = Path::new("abc"); let result = run_path_with_cstr(path, |p| { - assert_eq!(p, &*CString::new(path.as_os_str().bytes()).unwrap()); + assert_eq!(p, &*CString::new(path.as_os_str().as_os_str_bytes()).unwrap()); Ok(42) }); assert_eq!(result.unwrap(), 42); @@ -25,7 +25,7 @@ fn heap_allocation_works() { let path = repeat("a").take(384).collect::(); let path = Path::new(&path); let result = run_path_with_cstr(path, |p| { - assert_eq!(p, &*CString::new(path.as_os_str().bytes()).unwrap()); + assert_eq!(p, &*CString::new(path.as_os_str().as_os_str_bytes()).unwrap()); Ok(42) }); assert_eq!(result.unwrap(), 42); diff --git a/library/std/src/sys/unix/path.rs b/library/std/src/sys/unix/path.rs index a98a69e2db8e1..935245f637b86 100644 --- a/library/std/src/sys/unix/path.rs +++ b/library/std/src/sys/unix/path.rs @@ -30,7 +30,7 @@ pub(crate) fn absolute(path: &Path) -> io::Result { // Get the components, skipping the redundant leading "." component if it exists. let mut components = path.strip_prefix(".").unwrap_or(path).components(); - let path_os = path.as_os_str().bytes(); + let path_os = path.as_os_str().as_os_str_bytes(); let mut normalized = if path.is_absolute() { // "If a pathname begins with two successive characters, the diff --git a/library/std/src/sys/unix/process/process_common.rs b/library/std/src/sys/unix/process/process_common.rs index afd03d79c0ba6..640648e870748 100644 --- a/library/std/src/sys/unix/process/process_common.rs +++ b/library/std/src/sys/unix/process/process_common.rs @@ -164,9 +164,9 @@ pub enum ProgramKind { impl ProgramKind { fn new(program: &OsStr) -> Self { - if program.bytes().starts_with(b"/") { + if program.as_os_str_bytes().starts_with(b"/") { Self::Absolute - } else if program.bytes().contains(&b'/') { + } else if program.as_os_str_bytes().contains(&b'/') { // If the program has more than one component in it, it is a relative path. Self::Relative } else { diff --git a/library/std/src/sys/windows/args.rs b/library/std/src/sys/windows/args.rs index 5bfd8b52ed08d..6b597f499bcdc 100644 --- a/library/std/src/sys/windows/args.rs +++ b/library/std/src/sys/windows/args.rs @@ -226,7 +226,7 @@ pub(crate) fn append_arg(cmd: &mut Vec, arg: &Arg, force_quotes: bool) -> i // that it actually gets passed through on the command line or otherwise // it will be dropped entirely when parsed on the other end. ensure_no_nuls(arg)?; - let arg_bytes = arg.bytes(); + let arg_bytes = arg.as_os_str_bytes(); let (quote, escape) = match quote { Quote::Always => (true, true), Quote::Auto => { @@ -297,7 +297,9 @@ pub(crate) fn make_bat_command_line( // * `|<>` pipe/redirect characters. const SPECIAL: &[u8] = b"\t &()[]{}^=;!'+,`~%|<>"; let force_quotes = match arg { - Arg::Regular(arg) if !force_quotes => arg.bytes().iter().any(|c| SPECIAL.contains(c)), + Arg::Regular(arg) if !force_quotes => { + arg.as_os_str_bytes().iter().any(|c| SPECIAL.contains(c)) + } _ => force_quotes, }; append_arg(&mut cmd, arg, force_quotes)?; diff --git a/library/std/src/sys/windows/path.rs b/library/std/src/sys/windows/path.rs index c3573d14c7f92..7a65d901ad2e1 100644 --- a/library/std/src/sys/windows/path.rs +++ b/library/std/src/sys/windows/path.rs @@ -33,12 +33,12 @@ pub fn is_verbatim_sep(b: u8) -> bool { /// Returns true if `path` looks like a lone filename. pub(crate) fn is_file_name(path: &OsStr) -> bool { - !path.bytes().iter().copied().any(is_sep_byte) + !path.as_os_str_bytes().iter().copied().any(is_sep_byte) } pub(crate) fn has_trailing_slash(path: &OsStr) -> bool { - let is_verbatim = path.bytes().starts_with(br"\\?\"); + let is_verbatim = path.as_os_str_bytes().starts_with(br"\\?\"); let is_separator = if is_verbatim { is_verbatim_sep } else { is_sep_byte }; - if let Some(&c) = path.bytes().last() { is_separator(c) } else { false } + if let Some(&c) = path.as_os_str_bytes().last() { is_separator(c) } else { false } } /// Appends a suffix to a path. @@ -60,7 +60,7 @@ impl<'a, const LEN: usize> PrefixParser<'a, LEN> { fn get_prefix(path: &OsStr) -> [u8; LEN] { let mut prefix = [0; LEN]; // SAFETY: Only ASCII characters are modified. - for (i, &ch) in path.bytes().iter().take(LEN).enumerate() { + for (i, &ch) in path.as_os_str_bytes().iter().take(LEN).enumerate() { prefix[i] = if ch == b'/' { b'\\' } else { ch }; } prefix @@ -93,7 +93,7 @@ impl<'a> PrefixParserSlice<'a, '_> { } fn prefix_bytes(&self) -> &'a [u8] { - &self.path.bytes()[..self.index] + &self.path.as_os_str_bytes()[..self.index] } fn finish(self) -> &'a OsStr { @@ -101,7 +101,7 @@ impl<'a> PrefixParserSlice<'a, '_> { // &[u8] and back. This is safe to do because (1) we only look at ASCII // contents of the encoding and (2) new &OsStr values are produced only // from ASCII-bounded slices of existing &OsStr values. - unsafe { bytes_as_os_str(&self.path.bytes()[self.index..]) } + unsafe { bytes_as_os_str(&self.path.as_os_str_bytes()[self.index..]) } } } @@ -173,7 +173,7 @@ fn parse_drive(path: &OsStr) -> Option { drive.is_ascii_alphabetic() } - match path.bytes() { + match path.as_os_str_bytes() { [drive, b':', ..] if is_valid_drive_letter(drive) => Some(drive.to_ascii_uppercase()), _ => None, } @@ -182,7 +182,7 @@ fn parse_drive(path: &OsStr) -> Option { // Parses a drive prefix exactly, e.g. "C:" fn parse_drive_exact(path: &OsStr) -> Option { // only parse two bytes: the drive letter and the drive separator - if path.bytes().get(2).map(|&x| is_sep_byte(x)).unwrap_or(true) { + if path.as_os_str_bytes().get(2).map(|&x| is_sep_byte(x)).unwrap_or(true) { parse_drive(path) } else { None @@ -196,15 +196,15 @@ fn parse_drive_exact(path: &OsStr) -> Option { fn parse_next_component(path: &OsStr, verbatim: bool) -> (&OsStr, &OsStr) { let separator = if verbatim { is_verbatim_sep } else { is_sep_byte }; - match path.bytes().iter().position(|&x| separator(x)) { + match path.as_os_str_bytes().iter().position(|&x| separator(x)) { Some(separator_start) => { let separator_end = separator_start + 1; - let component = &path.bytes()[..separator_start]; + let component = &path.as_os_str_bytes()[..separator_start]; // Panic safe // The max `separator_end` is `bytes.len()` and `bytes[bytes.len()..]` is a valid index. - let path = &path.bytes()[separator_end..]; + let path = &path.as_os_str_bytes()[separator_end..]; // SAFETY: `path` is a valid wtf8 encoded slice and each of the separators ('/', '\') // is encoded in a single byte, therefore `bytes[separator_start]` and @@ -329,7 +329,7 @@ pub(crate) fn absolute(path: &Path) -> io::Result { // Verbatim paths should not be modified. if prefix.map(|x| x.is_verbatim()).unwrap_or(false) { // NULs in verbatim paths are rejected for consistency. - if path.bytes().contains(&0) { + if path.as_os_str_bytes().contains(&0) { return Err(io::const_io_error!( io::ErrorKind::InvalidInput, "strings passed to WinAPI cannot contain NULs", diff --git a/library/std/src/sys/windows/process.rs b/library/std/src/sys/windows/process.rs index df3667c0fd788..a573a05c39cd9 100644 --- a/library/std/src/sys/windows/process.rs +++ b/library/std/src/sys/windows/process.rs @@ -395,7 +395,7 @@ fn resolve_exe<'a>( // Test if the file name has the `exe` extension. // This does a case-insensitive `ends_with`. let has_exe_suffix = if exe_path.len() >= EXE_SUFFIX.len() { - exe_path.bytes()[exe_path.len() - EXE_SUFFIX.len()..] + exe_path.as_os_str_bytes()[exe_path.len() - EXE_SUFFIX.len()..] .eq_ignore_ascii_case(EXE_SUFFIX.as_bytes()) } else { false @@ -425,7 +425,7 @@ fn resolve_exe<'a>( // From the `CreateProcessW` docs: // > If the file name does not contain an extension, .exe is appended. // Note that this rule only applies when searching paths. - let has_extension = exe_path.bytes().contains(&b'.'); + let has_extension = exe_path.as_os_str_bytes().contains(&b'.'); // Search the directories given by `search_paths`. let result = search_paths(parent_paths, child_paths, |mut path| { From 7b9290384e88e6960bc574e83219df50df5fe4e1 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Sat, 13 May 2023 19:09:00 +0200 Subject: [PATCH 03/16] refactor: Remove bespoke from_os_str_bytes_unchecked --- library/std/src/path.rs | 36 +++++++++++++---------------- library/std/src/sys/windows/path.rs | 20 ++++++---------- 2 files changed, 23 insertions(+), 33 deletions(-) diff --git a/library/std/src/path.rs b/library/std/src/path.rs index 6f770d4c91b19..28cd3c4e4dbd2 100644 --- a/library/std/src/path.rs +++ b/library/std/src/path.rs @@ -299,20 +299,6 @@ where } } -unsafe fn u8_slice_as_os_str(s: &[u8]) -> &OsStr { - // SAFETY: See note at the top of this module to understand why this and - // `OsStr::bytes` are used: - // - // This casts are safe as OsStr is internally a wrapper around [u8] on all - // platforms. - // - // Note that currently this relies on the special knowledge that std has; - // these types are single-element structs but are not marked - // repr(transparent) or repr(C) which would make these casts not allowable - // outside std. - unsafe { &*(s as *const [u8] as *const OsStr) } -} - // Detect scheme on Redox fn has_redox_scheme(s: &[u8]) -> bool { cfg!(target_os = "redox") && s.contains(&b':') @@ -344,7 +330,12 @@ fn rsplit_file_at_dot(file: &OsStr) -> (Option<&OsStr>, Option<&OsStr>) { if before == Some(b"") { (Some(file), None) } else { - unsafe { (before.map(|s| u8_slice_as_os_str(s)), after.map(|s| u8_slice_as_os_str(s))) } + unsafe { + ( + before.map(|s| OsStr::from_os_str_bytes_unchecked(s)), + after.map(|s| OsStr::from_os_str_bytes_unchecked(s)), + ) + } } } @@ -364,7 +355,12 @@ fn split_file_at_dot(file: &OsStr) -> (&OsStr, Option<&OsStr>) { }; let before = &slice[..i]; let after = &slice[i + 1..]; - unsafe { (u8_slice_as_os_str(before), Some(u8_slice_as_os_str(after))) } + unsafe { + ( + OsStr::from_os_str_bytes_unchecked(before), + Some(OsStr::from_os_str_bytes_unchecked(after)), + ) + } } //////////////////////////////////////////////////////////////////////////////// @@ -743,7 +739,7 @@ impl<'a> Components<'a> { // separately via `include_cur_dir` b".." => Some(Component::ParentDir), b"" => None, - _ => Some(Component::Normal(unsafe { u8_slice_as_os_str(comp) })), + _ => Some(Component::Normal(unsafe { OsStr::from_os_str_bytes_unchecked(comp) })), } } @@ -900,7 +896,7 @@ impl<'a> Iterator for Components<'a> { let raw = &self.path[..self.prefix_len()]; self.path = &self.path[self.prefix_len()..]; return Some(Component::Prefix(PrefixComponent { - raw: unsafe { u8_slice_as_os_str(raw) }, + raw: unsafe { OsStr::from_os_str_bytes_unchecked(raw) }, parsed: self.prefix.unwrap(), })); } @@ -972,7 +968,7 @@ impl<'a> DoubleEndedIterator for Components<'a> { State::Prefix if self.prefix_len() > 0 => { self.back = State::Done; return Some(Component::Prefix(PrefixComponent { - raw: unsafe { u8_slice_as_os_str(self.path) }, + raw: unsafe { OsStr::from_os_str_bytes_unchecked(self.path) }, parsed: self.prefix.unwrap(), })); } @@ -2011,7 +2007,7 @@ impl Path { // The following (private!) function allows construction of a path from a u8 // slice, which is only safe when it is known to follow the OsStr encoding. unsafe fn from_u8_slice(s: &[u8]) -> &Path { - unsafe { Path::new(u8_slice_as_os_str(s)) } + unsafe { Path::new(OsStr::from_os_str_bytes_unchecked(s)) } } // The following (private!) function reveals the byte encoding used for OsStr. fn as_u8_slice(&self) -> &[u8] { diff --git a/library/std/src/sys/windows/path.rs b/library/std/src/sys/windows/path.rs index 7a65d901ad2e1..c9c2d10e6c444 100644 --- a/library/std/src/sys/windows/path.rs +++ b/library/std/src/sys/windows/path.rs @@ -1,7 +1,6 @@ use super::{c, fill_utf16_buf, to_u16s}; use crate::ffi::{OsStr, OsString}; use crate::io; -use crate::mem; use crate::path::{Path, PathBuf, Prefix}; use crate::ptr; @@ -11,16 +10,6 @@ mod tests; pub const MAIN_SEP_STR: &str = "\\"; pub const MAIN_SEP: char = '\\'; -/// # Safety -/// -/// `bytes` must be a valid wtf8 encoded slice -#[inline] -unsafe fn bytes_as_os_str(bytes: &[u8]) -> &OsStr { - // &OsStr is layout compatible with &Slice, which is compatible with &Wtf8, - // which is compatible with &[u8]. - mem::transmute(bytes) -} - #[inline] pub fn is_sep_byte(b: u8) -> bool { b == b'/' || b == b'\\' @@ -101,7 +90,7 @@ impl<'a> PrefixParserSlice<'a, '_> { // &[u8] and back. This is safe to do because (1) we only look at ASCII // contents of the encoding and (2) new &OsStr values are produced only // from ASCII-bounded slices of existing &OsStr values. - unsafe { bytes_as_os_str(&self.path.as_os_str_bytes()[self.index..]) } + unsafe { OsStr::from_os_str_bytes_unchecked(&self.path.as_os_str_bytes()[self.index..]) } } } @@ -210,7 +199,12 @@ fn parse_next_component(path: &OsStr, verbatim: bool) -> (&OsStr, &OsStr) { // is encoded in a single byte, therefore `bytes[separator_start]` and // `bytes[separator_end]` must be code point boundaries and thus // `bytes[..separator_start]` and `bytes[separator_end..]` are valid wtf8 slices. - unsafe { (bytes_as_os_str(component), bytes_as_os_str(path)) } + unsafe { + ( + OsStr::from_os_str_bytes_unchecked(component), + OsStr::from_os_str_bytes_unchecked(path), + ) + } } None => (path, OsStr::new("")), } From f9aaad0939e1507990f02676e7f70b88a85a9aea Mon Sep 17 00:00:00 2001 From: Ed Page Date: Tue, 16 May 2023 21:03:29 -0500 Subject: [PATCH 04/16] docs: Add examples of OsStr safety violation --- library/std/src/ffi/os_str.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index 90cbd57a9298f..d40c6d3174927 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -678,8 +678,10 @@ impl OsStr { /// `OsStr`'s encoding is an unspecified superset of UTF-8 and callers must /// pass in bytes that originated as a mixture of validated UTF-8 and bytes from /// [`OsStr::as_os_str_bytes`] from within the same rust version built for the same target - /// platform. The bytes from `OsStr::as_os_str_bytes` may be split either - /// immediately before or immediately after some valid non-empty UTF-8 substring + /// platform. For example, reconstructing an `OsStr` from bytes sent over the network or stored + /// in a file will likely violate these safety rules. The bytes from `OsStr::as_os_str_bytes` + /// may be split either immediately before or immediately after some valid non-empty UTF-8 + /// substring /// /// # Example /// @@ -881,8 +883,9 @@ impl OsStr { /// /// Note: As the encoding is unspecified, any sub-slice of bytes that is not valid UTF-8 should /// be treated as opaque and only comparable within the same rust version built for the same - /// target platform. See [`OsString`] for more encoding details and [`std::ffi`] for - /// platform-specific, specified conversions. + /// target platform. For example, sending the slice over the network or storing it in a file + /// will likely result in incompatible byte slices See [`OsString`] for more encoding details + /// and [`std::ffi`] for platform-specific, specified conversions. /// /// [`std::ffi`]: crate::ffi #[inline] From 5d177afe9591afc0e04b0d9cdfffa79c27c8af64 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Wed, 17 May 2023 09:34:25 -0500 Subject: [PATCH 05/16] docs: Clarify OsStr is self-synchronizing --- library/std/src/ffi/os_str.rs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index d40c6d3174927..dd92b9cf76a4e 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -670,18 +670,22 @@ impl OsStr { /// Converts a slice of bytes to an OS string slice without checking that the string contains /// valid `OsStr`-encoded data. /// + /// The byte encoding is an unspecified, platform-specific, self-synchronizing superset of UTF-8. + /// By being a self-synchronizing superset of UTF-8, this encoding is also a superset of 7-bit + /// ASCII. + /// /// See the [module's toplevel documentation about conversions][conversions] for safe, /// cross-platform [conversions] from/to native representations. /// /// # Safety /// - /// `OsStr`'s encoding is an unspecified superset of UTF-8 and callers must - /// pass in bytes that originated as a mixture of validated UTF-8 and bytes from - /// [`OsStr::as_os_str_bytes`] from within the same rust version built for the same target - /// platform. For example, reconstructing an `OsStr` from bytes sent over the network or stored - /// in a file will likely violate these safety rules. The bytes from `OsStr::as_os_str_bytes` - /// may be split either immediately before or immediately after some valid non-empty UTF-8 - /// substring + /// As the encoding is unspecified, callers must pass in bytes that originated as a mixture of + /// validated UTF-8 and bytes from [`OsStr::as_os_str_bytes`] from within the same rust version + /// built for the same target platform. For example, reconstructing an `OsStr` from bytes sent + /// over the network or stored in a file will likely violate these safety rules. + /// + /// Due to the encoding being self-synchronizing, the bytes from [`OsStr::as_os_str_bytes`] can be + /// split either immediately before or immediately after any valid non-empty UTF-8 substring. /// /// # Example /// @@ -881,6 +885,10 @@ impl OsStr { /// Converts an OS string slice to a byte slice. To convert the byte slice back into an OS /// string slice, use the [`OsStr::from_os_str_bytes_unchecked`] function. /// + /// The byte encoding is an unspecified, platform-specific, self-synchronizing superset of UTF-8. + /// By being a self-synchronizing superset of UTF-8, this encoding is also a superset of 7-bit + /// ASCII. + /// /// Note: As the encoding is unspecified, any sub-slice of bytes that is not valid UTF-8 should /// be treated as opaque and only comparable within the same rust version built for the same /// target platform. For example, sending the slice over the network or storing it in a file From e6a35c49533dd734f178b04677404df0da518737 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Fri, 19 May 2023 19:41:41 -0500 Subject: [PATCH 06/16] docs: Add missing period --- library/std/src/ffi/os_str.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/ffi/os_str.rs b/library/std/src/ffi/os_str.rs index dd92b9cf76a4e..bb577acf769d4 100644 --- a/library/std/src/ffi/os_str.rs +++ b/library/std/src/ffi/os_str.rs @@ -892,7 +892,7 @@ impl OsStr { /// Note: As the encoding is unspecified, any sub-slice of bytes that is not valid UTF-8 should /// be treated as opaque and only comparable within the same rust version built for the same /// target platform. For example, sending the slice over the network or storing it in a file - /// will likely result in incompatible byte slices See [`OsString`] for more encoding details + /// will likely result in incompatible byte slices. See [`OsString`] for more encoding details /// and [`std::ffi`] for platform-specific, specified conversions. /// /// [`std::ffi`]: crate::ffi From 5c780d9926a34422f649a678d437950c0672781e Mon Sep 17 00:00:00 2001 From: sladynnunes Date: Sun, 28 May 2023 01:37:25 -0700 Subject: [PATCH 07/16] Migrate to Askama --- src/librustdoc/html/render/print_item.rs | 26 +++++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index 62027a3fa1941..9fb7d9e64d81f 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -1420,30 +1420,36 @@ fn item_macro(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean: write!(w, "{}", document(cx, it, None, HeadingOffset::H2)) } -fn item_proc_macro(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, m: &clean::ProcMacro) { - wrap_item(w, |w| { +fn item_proc_macro( + w: &mut impl fmt::Write, + cx: &mut Context<'_>, + it: &clean::Item, + m: &clean::ProcMacro, +) { + let mut buffer = Buffer::new(); + wrap_item(&mut buffer, |buffer| { let name = it.name.expect("proc-macros always have names"); match m.kind { MacroKind::Bang => { - write!(w, "{}!() {{ /* proc-macro */ }}", name); + write!(buffer, "{}!() {{ /* proc-macro */ }}", name); } MacroKind::Attr => { - write!(w, "#[{}]", name); + write!(buffer, "#[{}]", name); } MacroKind::Derive => { - write!(w, "#[derive({})]", name); + write!(buffer, "#[derive({})]", name); if !m.helpers.is_empty() { - w.push_str("\n{\n"); - w.push_str(" // Attributes available to this derive:\n"); + buffer.push_str("\n{\n"); + buffer.push_str(" // Attributes available to this derive:\n"); for attr in &m.helpers { - writeln!(w, " #[{}]", attr); + writeln!(buffer, " #[{}]", attr); } - w.push_str("}\n"); + buffer.push_str("}\n"); } } } }); - write!(w, "{}", document(cx, it, None, HeadingOffset::H2)) + write!(w, "{}{}", buffer.into_inner(), document(cx, it, None, HeadingOffset::H2)).unwrap(); } fn item_primitive(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item) { From cfd062341125ae3abbf2e7a7e30cfb1e8ac0c6e3 Mon Sep 17 00:00:00 2001 From: lcnr Date: Mon, 29 May 2023 17:15:48 +0200 Subject: [PATCH 08/16] unique borrows are mutating uses --- compiler/rustc_borrowck/src/def_use.rs | 1 - compiler/rustc_borrowck/src/type_check/mod.rs | 4 ++-- compiler/rustc_codegen_ssa/src/mir/analyze.rs | 1 - .../src/transform/check_consts/check.rs | 4 +--- compiler/rustc_middle/src/mir/visit.rs | 10 +++------- compiler/rustc_mir_dataflow/src/impls/liveness.rs | 3 +-- compiler/rustc_mir_transform/src/const_prop.rs | 1 - compiler/rustc_mir_transform/src/copy_prop.rs | 1 - compiler/rustc_mir_transform/src/ssa.rs | 1 - 9 files changed, 7 insertions(+), 19 deletions(-) diff --git a/compiler/rustc_borrowck/src/def_use.rs b/compiler/rustc_borrowck/src/def_use.rs index b775739fed2ae..b719a610e07c7 100644 --- a/compiler/rustc_borrowck/src/def_use.rs +++ b/compiler/rustc_borrowck/src/def_use.rs @@ -50,7 +50,6 @@ pub fn categorize(context: PlaceContext) -> Option { PlaceContext::MutatingUse(MutatingUseContext::Borrow) | PlaceContext::NonMutatingUse(NonMutatingUseContext::SharedBorrow) | PlaceContext::NonMutatingUse(NonMutatingUseContext::ShallowBorrow) | - PlaceContext::NonMutatingUse(NonMutatingUseContext::UniqueBorrow) | // `PlaceMention` and `AscribeUserType` both evaluate the place, which must not // contain dangling references. diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs index 51a84ce6cadea..dc5121e1a2ae3 100644 --- a/compiler/rustc_borrowck/src/type_check/mod.rs +++ b/compiler/rustc_borrowck/src/type_check/mod.rs @@ -766,8 +766,8 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> { PlaceContext::MutatingUse(_) => ty::Invariant, PlaceContext::NonUse(StorageDead | StorageLive | VarDebugInfo) => ty::Invariant, PlaceContext::NonMutatingUse( - Inspect | Copy | Move | PlaceMention | SharedBorrow | ShallowBorrow | UniqueBorrow - | AddressOf | Projection, + Inspect | Copy | Move | PlaceMention | SharedBorrow | ShallowBorrow | AddressOf + | Projection, ) => ty::Covariant, PlaceContext::NonUse(AscribeUserTy(variance)) => variance, } diff --git a/compiler/rustc_codegen_ssa/src/mir/analyze.rs b/compiler/rustc_codegen_ssa/src/mir/analyze.rs index 835074806e90f..22c1f05974ddd 100644 --- a/compiler/rustc_codegen_ssa/src/mir/analyze.rs +++ b/compiler/rustc_codegen_ssa/src/mir/analyze.rs @@ -234,7 +234,6 @@ impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx> | PlaceContext::NonMutatingUse( NonMutatingUseContext::Inspect | NonMutatingUseContext::SharedBorrow - | NonMutatingUseContext::UniqueBorrow | NonMutatingUseContext::ShallowBorrow | NonMutatingUseContext::AddressOf | NonMutatingUseContext::Projection, diff --git a/compiler/rustc_const_eval/src/transform/check_consts/check.rs b/compiler/rustc_const_eval/src/transform/check_consts/check.rs index 138bc3eb74a4f..57d939747aab3 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/check.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/check.rs @@ -412,9 +412,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> { BorrowKind::Shallow => { PlaceContext::NonMutatingUse(NonMutatingUseContext::ShallowBorrow) } - BorrowKind::Unique => { - PlaceContext::NonMutatingUse(NonMutatingUseContext::UniqueBorrow) - } + BorrowKind::Unique => PlaceContext::MutatingUse(MutatingUseContext::Borrow), BorrowKind::Mut { .. } => { PlaceContext::MutatingUse(MutatingUseContext::Borrow) } diff --git a/compiler/rustc_middle/src/mir/visit.rs b/compiler/rustc_middle/src/mir/visit.rs index 942654b30749c..8d44e929afde3 100644 --- a/compiler/rustc_middle/src/mir/visit.rs +++ b/compiler/rustc_middle/src/mir/visit.rs @@ -650,8 +650,8 @@ macro_rules! make_mir_visitor { BorrowKind::Shallow => PlaceContext::NonMutatingUse( NonMutatingUseContext::ShallowBorrow ), - BorrowKind::Unique => PlaceContext::NonMutatingUse( - NonMutatingUseContext::UniqueBorrow + BorrowKind::Unique => PlaceContext::MutatingUse( + MutatingUseContext::Borrow ), BorrowKind::Mut { .. } => PlaceContext::MutatingUse(MutatingUseContext::Borrow), @@ -1265,8 +1265,6 @@ pub enum NonMutatingUseContext { SharedBorrow, /// Shallow borrow. ShallowBorrow, - /// Unique borrow. - UniqueBorrow, /// AddressOf for *const pointer. AddressOf, /// PlaceMention statement. @@ -1345,9 +1343,7 @@ impl PlaceContext { matches!( self, PlaceContext::NonMutatingUse( - NonMutatingUseContext::SharedBorrow - | NonMutatingUseContext::ShallowBorrow - | NonMutatingUseContext::UniqueBorrow + NonMutatingUseContext::SharedBorrow | NonMutatingUseContext::ShallowBorrow ) | PlaceContext::MutatingUse(MutatingUseContext::Borrow) ) } diff --git a/compiler/rustc_mir_dataflow/src/impls/liveness.rs b/compiler/rustc_mir_dataflow/src/impls/liveness.rs index aeca0073304ea..6ae6bdc17d501 100644 --- a/compiler/rustc_mir_dataflow/src/impls/liveness.rs +++ b/compiler/rustc_mir_dataflow/src/impls/liveness.rs @@ -199,8 +199,7 @@ impl DefUse { | NonMutatingUseContext::Move | NonMutatingUseContext::PlaceMention | NonMutatingUseContext::ShallowBorrow - | NonMutatingUseContext::SharedBorrow - | NonMutatingUseContext::UniqueBorrow, + | NonMutatingUseContext::SharedBorrow, ) => Some(DefUse::Use), PlaceContext::MutatingUse(MutatingUseContext::Projection) diff --git a/compiler/rustc_mir_transform/src/const_prop.rs b/compiler/rustc_mir_transform/src/const_prop.rs index a5d18fff89bd7..1ba1951afdef5 100644 --- a/compiler/rustc_mir_transform/src/const_prop.rs +++ b/compiler/rustc_mir_transform/src/const_prop.rs @@ -772,7 +772,6 @@ impl<'tcx> Visitor<'tcx> for CanConstProp { // mutation. | NonMutatingUse(NonMutatingUseContext::SharedBorrow) | NonMutatingUse(NonMutatingUseContext::ShallowBorrow) - | NonMutatingUse(NonMutatingUseContext::UniqueBorrow) | NonMutatingUse(NonMutatingUseContext::AddressOf) | MutatingUse(MutatingUseContext::Borrow) | MutatingUse(MutatingUseContext::AddressOf) => { diff --git a/compiler/rustc_mir_transform/src/copy_prop.rs b/compiler/rustc_mir_transform/src/copy_prop.rs index 319f3a7970512..3df459dfa79bd 100644 --- a/compiler/rustc_mir_transform/src/copy_prop.rs +++ b/compiler/rustc_mir_transform/src/copy_prop.rs @@ -130,7 +130,6 @@ impl<'tcx> MutVisitor<'tcx> for Replacer<'_, 'tcx> { PlaceContext::NonMutatingUse( NonMutatingUseContext::SharedBorrow | NonMutatingUseContext::ShallowBorrow - | NonMutatingUseContext::UniqueBorrow | NonMutatingUseContext::AddressOf, ) => true, // For debuginfo, merging locals is ok. diff --git a/compiler/rustc_mir_transform/src/ssa.rs b/compiler/rustc_mir_transform/src/ssa.rs index e8e4246b7970f..7a0d3a025f365 100644 --- a/compiler/rustc_mir_transform/src/ssa.rs +++ b/compiler/rustc_mir_transform/src/ssa.rs @@ -216,7 +216,6 @@ impl<'tcx> Visitor<'tcx> for SsaVisitor<'_> { PlaceContext::NonMutatingUse( NonMutatingUseContext::SharedBorrow | NonMutatingUseContext::ShallowBorrow - | NonMutatingUseContext::UniqueBorrow | NonMutatingUseContext::AddressOf, ) | PlaceContext::MutatingUse(_) => { From b5732508dd4b2a855a61cab77d75c1fa612324eb Mon Sep 17 00:00:00 2001 From: lcnr Date: Mon, 29 May 2023 17:20:42 +0200 Subject: [PATCH 09/16] add tests --- .../unique-borrows-are-invariant-1.rs | 18 +++++++++++ .../unique-borrows-are-invariant-1.stderr | 14 +++++++++ .../unique-borrows-are-invariant-2.rs | 31 +++++++++++++++++++ .../unique-borrows-are-invariant-2.stderr | 15 +++++++++ 4 files changed, 78 insertions(+) create mode 100644 tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.rs create mode 100644 tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.stderr create mode 100644 tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.rs create mode 100644 tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.stderr diff --git a/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.rs b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.rs new file mode 100644 index 0000000000000..f21ef43fb7ccb --- /dev/null +++ b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.rs @@ -0,0 +1,18 @@ +// edition:2021 + +// regression test for #112056 + +fn extend_lifetime<'a, 'b>(x: &mut (&'a str,), y: &'b str) { + let mut closure = |input| x.0 = input; + //~^ ERROR: lifetime may not live long enough + closure(y); +} + +fn main() { + let mut tuple = ("static",); + { + let x = String::from("temporary"); + extend_lifetime(&mut tuple, &x); + } + println!("{}", tuple.0); +} diff --git a/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.stderr b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.stderr new file mode 100644 index 0000000000000..730823281abc9 --- /dev/null +++ b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-1.stderr @@ -0,0 +1,14 @@ +error: lifetime may not live long enough + --> $DIR/unique-borrows-are-invariant-1.rs:6:31 + | +LL | fn extend_lifetime<'a, 'b>(x: &mut (&'a str,), y: &'b str) { + | -- -- lifetime `'b` defined here + | | + | lifetime `'a` defined here +LL | let mut closure = |input| x.0 = input; + | ^^^^^^^^^^^ assignment requires that `'b` must outlive `'a` + | + = help: consider adding the following bound: `'b: 'a` + +error: aborting due to previous error + diff --git a/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.rs b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.rs new file mode 100644 index 0000000000000..dd9d986c2089b --- /dev/null +++ b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.rs @@ -0,0 +1,31 @@ +// edition:2021 + +// regression test for #112056 + +struct Spooky<'b> { + owned: Option<&'static u32>, + borrowed: &'b &'static u32, +} + +impl<'b> Spooky<'b> { + fn create_self_reference<'a>(&'a mut self) { + let mut closure = || { + if let Some(owned) = &self.owned { + let borrow: &'a &'static u32 = owned; + self.borrowed = borrow; + //~^ ERROR: lifetime may not live long enough + } + }; + closure(); + } +} + +fn main() { + let mut spooky: Spooky<'static> = Spooky { + owned: Some(&1), + borrowed: &&1, + }; + spooky.create_self_reference(); + spooky.owned = None; + println!("{}", **spooky.borrowed); +} diff --git a/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.stderr b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.stderr new file mode 100644 index 0000000000000..66ba0fe3547a6 --- /dev/null +++ b/tests/ui/closures/2229_closure_analysis/unique-borrows-are-invariant-2.stderr @@ -0,0 +1,15 @@ +error: lifetime may not live long enough + --> $DIR/unique-borrows-are-invariant-2.rs:15:17 + | +LL | impl<'b> Spooky<'b> { + | -- lifetime `'b` defined here +LL | fn create_self_reference<'a>(&'a mut self) { + | -- lifetime `'a` defined here +... +LL | self.borrowed = borrow; + | ^^^^^^^^^^^^^^^^^^^^^^ assignment requires that `'a` must outlive `'b` + | + = help: consider adding the following bound: `'a: 'b` + +error: aborting due to previous error + From 25f8f4cf953975dba37051ac1565e4999418c996 Mon Sep 17 00:00:00 2001 From: lcnr Date: Mon, 29 May 2023 17:49:19 +0200 Subject: [PATCH 10/16] add FIXME --- compiler/rustc_middle/src/mir/syntax.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/rustc_middle/src/mir/syntax.rs b/compiler/rustc_middle/src/mir/syntax.rs index 6d6d71bc87b14..3e474c1d377e6 100644 --- a/compiler/rustc_middle/src/mir/syntax.rs +++ b/compiler/rustc_middle/src/mir/syntax.rs @@ -220,6 +220,11 @@ pub enum BorrowKind { /// immutable, but not aliasable. This solves the problem. For /// simplicity, we don't give users the way to express this /// borrow, it's just used when translating closures. + /// + // FIXME(#112072): This is wrong. Unique borrows are mutable borrows except + // that they do not require their pointee to be marked as a mutable. + // They should still be treated as mutable borrows in every other way, + // e.g. for variance or overlap checking. Unique, /// Data is mutable and not aliasable. From 6c18d1eceff68ede8b0692985fd9b704c7942530 Mon Sep 17 00:00:00 2001 From: clubby789 Date: Mon, 29 May 2023 21:55:40 +0000 Subject: [PATCH 11/16] offset_of: Don't require type to be sized --- compiler/rustc_codegen_ssa/src/mir/rvalue.rs | 11 ++++++++--- tests/ui/offset-of/offset-of-unsized.rs | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 tests/ui/offset-of/offset-of-unsized.rs diff --git a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs index 6e7065713b817..0255b6603805d 100644 --- a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs +++ b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs @@ -668,11 +668,16 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { mir::Rvalue::NullaryOp(ref null_op, ty) => { let ty = self.monomorphize(ty); - assert!(bx.cx().type_is_sized(ty)); let layout = bx.cx().layout_of(ty); let val = match null_op { - mir::NullOp::SizeOf => layout.size.bytes(), - mir::NullOp::AlignOf => layout.align.abi.bytes(), + mir::NullOp::SizeOf => { + assert!(bx.cx().type_is_sized(ty)); + layout.size.bytes() + } + mir::NullOp::AlignOf => { + assert!(bx.cx().type_is_sized(ty)); + layout.align.abi.bytes() + } mir::NullOp::OffsetOf(fields) => { layout.offset_of_subfield(bx.cx(), fields.iter().map(|f| f.index())).bytes() } diff --git a/tests/ui/offset-of/offset-of-unsized.rs b/tests/ui/offset-of/offset-of-unsized.rs new file mode 100644 index 0000000000000..666387e615ef2 --- /dev/null +++ b/tests/ui/offset-of/offset-of-unsized.rs @@ -0,0 +1,15 @@ +// build-pass +// regression test for #112051 + +#![feature(offset_of)] + +struct S { + a: u64, + b: T, +} +trait Tr {} + +fn main() { + let _a = core::mem::offset_of!(S, a); + let _b = core::mem::offset_of!((u64, dyn Tr), 0); +} From 97d4a38de9fd6efb4588a7262cd9c66c2093e29f Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 29 May 2023 09:56:37 +1000 Subject: [PATCH 12/16] Remove `-Zcgu-partitioning-strategy`. This option was introduced three years ago, but it's never been meaningfully used, and `default` is the only acceptable value. Also, I think the `Partition` trait presents an interface that is too closely tied to the existing strategy and would probably be wrong for other strategies. (My rule of thumb is to not make something generic until there are at least two instances of it, to avoid this kind of problem.) Also, I don't think providing multiple partitioning strategies to the user is a good idea, because the compiler already has enough obscure knobs. This commit removes the option, along with the `Partition` trait, and the `Partitioner` and `DefaultPartitioning` types. I left the existing code in `compiler/rustc_monomorphize/src/partitioning/default.rs`, though I could be persuaded that moving it into `compiler/rustc_monomorphize/src/partitioning/mod.rs` is better. --- .../src/partitioning/default.rs | 549 +++++++++--------- .../src/partitioning/mod.rs | 121 +--- compiler/rustc_session/src/options.rs | 2 - 3 files changed, 276 insertions(+), 396 deletions(-) diff --git a/compiler/rustc_monomorphize/src/partitioning/default.rs b/compiler/rustc_monomorphize/src/partitioning/default.rs index 603b3ddc106e9..71cbee3b16695 100644 --- a/compiler/rustc_monomorphize/src/partitioning/default.rs +++ b/compiler/rustc_monomorphize/src/partitioning/default.rs @@ -15,326 +15,319 @@ use rustc_span::symbol::Symbol; use super::PartitioningCx; use crate::collector::InliningMap; -use crate::partitioning::{MonoItemPlacement, Partition, PlacedRootMonoItems}; - -pub struct DefaultPartitioning; - -impl<'tcx> Partition<'tcx> for DefaultPartitioning { - fn place_root_mono_items( - &mut self, - cx: &PartitioningCx<'_, 'tcx>, - mono_items: &mut I, - ) -> PlacedRootMonoItems<'tcx> - where - I: Iterator>, - { - let mut roots = FxHashSet::default(); - let mut codegen_units = FxHashMap::default(); - let is_incremental_build = cx.tcx.sess.opts.incremental.is_some(); - let mut internalization_candidates = FxHashSet::default(); - - // Determine if monomorphizations instantiated in this crate will be made - // available to downstream crates. This depends on whether we are in - // share-generics mode and whether the current crate can even have - // downstream crates. - let export_generics = - cx.tcx.sess.opts.share_generics() && cx.tcx.local_crate_exports_generics(); - - let cgu_name_builder = &mut CodegenUnitNameBuilder::new(cx.tcx); - let cgu_name_cache = &mut FxHashMap::default(); - - for mono_item in mono_items { - match mono_item.instantiation_mode(cx.tcx) { - InstantiationMode::GloballyShared { .. } => {} - InstantiationMode::LocalCopy => continue, - } +use crate::partitioning::{MonoItemPlacement, PlacedRootMonoItems}; + +// This modules implements the default (and only) partitioning strategy. + +pub(super) fn place_root_mono_items<'tcx, I>( + cx: &PartitioningCx<'_, 'tcx>, + mono_items: &mut I, +) -> PlacedRootMonoItems<'tcx> +where + I: Iterator>, +{ + let mut roots = FxHashSet::default(); + let mut codegen_units = FxHashMap::default(); + let is_incremental_build = cx.tcx.sess.opts.incremental.is_some(); + let mut internalization_candidates = FxHashSet::default(); + + // Determine if monomorphizations instantiated in this crate will be made + // available to downstream crates. This depends on whether we are in + // share-generics mode and whether the current crate can even have + // downstream crates. + let export_generics = + cx.tcx.sess.opts.share_generics() && cx.tcx.local_crate_exports_generics(); - let characteristic_def_id = characteristic_def_id_of_mono_item(cx.tcx, mono_item); - let is_volatile = is_incremental_build && mono_item.is_generic_fn(); - - let codegen_unit_name = match characteristic_def_id { - Some(def_id) => compute_codegen_unit_name( - cx.tcx, - cgu_name_builder, - def_id, - is_volatile, - cgu_name_cache, - ), - None => fallback_cgu_name(cgu_name_builder), - }; + let cgu_name_builder = &mut CodegenUnitNameBuilder::new(cx.tcx); + let cgu_name_cache = &mut FxHashMap::default(); + + for mono_item in mono_items { + match mono_item.instantiation_mode(cx.tcx) { + InstantiationMode::GloballyShared { .. } => {} + InstantiationMode::LocalCopy => continue, + } - let codegen_unit = codegen_units - .entry(codegen_unit_name) - .or_insert_with(|| CodegenUnit::new(codegen_unit_name)); + let characteristic_def_id = characteristic_def_id_of_mono_item(cx.tcx, mono_item); + let is_volatile = is_incremental_build && mono_item.is_generic_fn(); - let mut can_be_internalized = true; - let (linkage, visibility) = mono_item_linkage_and_visibility( + let codegen_unit_name = match characteristic_def_id { + Some(def_id) => compute_codegen_unit_name( cx.tcx, - &mono_item, - &mut can_be_internalized, - export_generics, - ); - if visibility == Visibility::Hidden && can_be_internalized { - internalization_candidates.insert(mono_item); - } - - codegen_unit.items_mut().insert(mono_item, (linkage, visibility)); - roots.insert(mono_item); - } + cgu_name_builder, + def_id, + is_volatile, + cgu_name_cache, + ), + None => fallback_cgu_name(cgu_name_builder), + }; - // Always ensure we have at least one CGU; otherwise, if we have a - // crate with just types (for example), we could wind up with no CGU. - if codegen_units.is_empty() { - let codegen_unit_name = fallback_cgu_name(cgu_name_builder); - codegen_units.insert(codegen_unit_name, CodegenUnit::new(codegen_unit_name)); + let codegen_unit = codegen_units + .entry(codegen_unit_name) + .or_insert_with(|| CodegenUnit::new(codegen_unit_name)); + + let mut can_be_internalized = true; + let (linkage, visibility) = mono_item_linkage_and_visibility( + cx.tcx, + &mono_item, + &mut can_be_internalized, + export_generics, + ); + if visibility == Visibility::Hidden && can_be_internalized { + internalization_candidates.insert(mono_item); } - let codegen_units = codegen_units.into_values().collect(); - PlacedRootMonoItems { codegen_units, roots, internalization_candidates } + codegen_unit.items_mut().insert(mono_item, (linkage, visibility)); + roots.insert(mono_item); } - fn merge_codegen_units( - &mut self, - cx: &PartitioningCx<'_, 'tcx>, - codegen_units: &mut Vec>, - ) { - assert!(cx.target_cgu_count >= 1); + // Always ensure we have at least one CGU; otherwise, if we have a + // crate with just types (for example), we could wind up with no CGU. + if codegen_units.is_empty() { + let codegen_unit_name = fallback_cgu_name(cgu_name_builder); + codegen_units.insert(codegen_unit_name, CodegenUnit::new(codegen_unit_name)); + } - // Note that at this point in time the `codegen_units` here may not be - // in a deterministic order (but we know they're deterministically the - // same set). We want this merging to produce a deterministic ordering - // of codegen units from the input. - // - // Due to basically how we've implemented the merging below (merge the - // two smallest into each other) we're sure to start off with a - // deterministic order (sorted by name). This'll mean that if two cgus - // have the same size the stable sort below will keep everything nice - // and deterministic. - codegen_units.sort_by(|a, b| a.name().as_str().cmp(b.name().as_str())); - - // This map keeps track of what got merged into what. - let mut cgu_contents: FxHashMap> = - codegen_units.iter().map(|cgu| (cgu.name(), vec![cgu.name()])).collect(); - - // Merge the two smallest codegen units until the target size is - // reached. - while codegen_units.len() > cx.target_cgu_count { - // Sort small cgus to the back - codegen_units.sort_by_cached_key(|cgu| cmp::Reverse(cgu.size_estimate())); - let mut smallest = codegen_units.pop().unwrap(); - let second_smallest = codegen_units.last_mut().unwrap(); - - // Move the mono-items from `smallest` to `second_smallest` - second_smallest.modify_size_estimate(smallest.size_estimate()); - for (k, v) in smallest.items_mut().drain() { - second_smallest.items_mut().insert(k, v); - } + let codegen_units = codegen_units.into_values().collect(); + PlacedRootMonoItems { codegen_units, roots, internalization_candidates } +} - // Record that `second_smallest` now contains all the stuff that was - // in `smallest` before. - let mut consumed_cgu_names = cgu_contents.remove(&smallest.name()).unwrap(); - cgu_contents.get_mut(&second_smallest.name()).unwrap().append(&mut consumed_cgu_names); +pub(super) fn merge_codegen_units<'tcx>( + cx: &PartitioningCx<'_, 'tcx>, + codegen_units: &mut Vec>, +) { + assert!(cx.target_cgu_count >= 1); - debug!( - "CodegenUnit {} merged into CodegenUnit {}", - smallest.name(), - second_smallest.name() - ); + // Note that at this point in time the `codegen_units` here may not be + // in a deterministic order (but we know they're deterministically the + // same set). We want this merging to produce a deterministic ordering + // of codegen units from the input. + // + // Due to basically how we've implemented the merging below (merge the + // two smallest into each other) we're sure to start off with a + // deterministic order (sorted by name). This'll mean that if two cgus + // have the same size the stable sort below will keep everything nice + // and deterministic. + codegen_units.sort_by(|a, b| a.name().as_str().cmp(b.name().as_str())); + + // This map keeps track of what got merged into what. + let mut cgu_contents: FxHashMap> = + codegen_units.iter().map(|cgu| (cgu.name(), vec![cgu.name()])).collect(); + + // Merge the two smallest codegen units until the target size is + // reached. + while codegen_units.len() > cx.target_cgu_count { + // Sort small cgus to the back + codegen_units.sort_by_cached_key(|cgu| cmp::Reverse(cgu.size_estimate())); + let mut smallest = codegen_units.pop().unwrap(); + let second_smallest = codegen_units.last_mut().unwrap(); + + // Move the mono-items from `smallest` to `second_smallest` + second_smallest.modify_size_estimate(smallest.size_estimate()); + for (k, v) in smallest.items_mut().drain() { + second_smallest.items_mut().insert(k, v); } - let cgu_name_builder = &mut CodegenUnitNameBuilder::new(cx.tcx); - - if cx.tcx.sess.opts.incremental.is_some() { - // If we are doing incremental compilation, we want CGU names to - // reflect the path of the source level module they correspond to. - // For CGUs that contain the code of multiple modules because of the - // merging done above, we use a concatenation of the names of all - // contained CGUs. - let new_cgu_names: FxHashMap = cgu_contents - .into_iter() - // This `filter` makes sure we only update the name of CGUs that - // were actually modified by merging. - .filter(|(_, cgu_contents)| cgu_contents.len() > 1) - .map(|(current_cgu_name, cgu_contents)| { - let mut cgu_contents: Vec<&str> = - cgu_contents.iter().map(|s| s.as_str()).collect(); - - // Sort the names, so things are deterministic and easy to - // predict. We are sorting primitive `&str`s here so we can - // use unstable sort. - cgu_contents.sort_unstable(); - - (current_cgu_name, cgu_contents.join("--")) - }) - .collect(); - - for cgu in codegen_units.iter_mut() { - if let Some(new_cgu_name) = new_cgu_names.get(&cgu.name()) { - if cx.tcx.sess.opts.unstable_opts.human_readable_cgu_names { - cgu.set_name(Symbol::intern(&new_cgu_name)); - } else { - // If we don't require CGU names to be human-readable, - // we use a fixed length hash of the composite CGU name - // instead. - let new_cgu_name = CodegenUnit::mangle_name(&new_cgu_name); - cgu.set_name(Symbol::intern(&new_cgu_name)); - } + // Record that `second_smallest` now contains all the stuff that was + // in `smallest` before. + let mut consumed_cgu_names = cgu_contents.remove(&smallest.name()).unwrap(); + cgu_contents.get_mut(&second_smallest.name()).unwrap().append(&mut consumed_cgu_names); + + debug!( + "CodegenUnit {} merged into CodegenUnit {}", + smallest.name(), + second_smallest.name() + ); + } + + let cgu_name_builder = &mut CodegenUnitNameBuilder::new(cx.tcx); + + if cx.tcx.sess.opts.incremental.is_some() { + // If we are doing incremental compilation, we want CGU names to + // reflect the path of the source level module they correspond to. + // For CGUs that contain the code of multiple modules because of the + // merging done above, we use a concatenation of the names of all + // contained CGUs. + let new_cgu_names: FxHashMap = cgu_contents + .into_iter() + // This `filter` makes sure we only update the name of CGUs that + // were actually modified by merging. + .filter(|(_, cgu_contents)| cgu_contents.len() > 1) + .map(|(current_cgu_name, cgu_contents)| { + let mut cgu_contents: Vec<&str> = cgu_contents.iter().map(|s| s.as_str()).collect(); + + // Sort the names, so things are deterministic and easy to + // predict. We are sorting primitive `&str`s here so we can + // use unstable sort. + cgu_contents.sort_unstable(); + + (current_cgu_name, cgu_contents.join("--")) + }) + .collect(); + + for cgu in codegen_units.iter_mut() { + if let Some(new_cgu_name) = new_cgu_names.get(&cgu.name()) { + if cx.tcx.sess.opts.unstable_opts.human_readable_cgu_names { + cgu.set_name(Symbol::intern(&new_cgu_name)); + } else { + // If we don't require CGU names to be human-readable, + // we use a fixed length hash of the composite CGU name + // instead. + let new_cgu_name = CodegenUnit::mangle_name(&new_cgu_name); + cgu.set_name(Symbol::intern(&new_cgu_name)); } } - } else { - // If we are compiling non-incrementally we just generate simple CGU - // names containing an index. - for (index, cgu) in codegen_units.iter_mut().enumerate() { - let numbered_codegen_unit_name = - cgu_name_builder.build_cgu_name_no_mangle(LOCAL_CRATE, &["cgu"], Some(index)); - cgu.set_name(numbered_codegen_unit_name); - } + } + } else { + // If we are compiling non-incrementally we just generate simple CGU + // names containing an index. + for (index, cgu) in codegen_units.iter_mut().enumerate() { + let numbered_codegen_unit_name = + cgu_name_builder.build_cgu_name_no_mangle(LOCAL_CRATE, &["cgu"], Some(index)); + cgu.set_name(numbered_codegen_unit_name); } } +} - fn place_inlined_mono_items( - &mut self, - cx: &PartitioningCx<'_, 'tcx>, - codegen_units: &mut [CodegenUnit<'tcx>], - roots: FxHashSet>, - ) -> FxHashMap, MonoItemPlacement> { - let mut mono_item_placements = FxHashMap::default(); - - let single_codegen_unit = codegen_units.len() == 1; - - for old_codegen_unit in codegen_units.iter_mut() { - // Collect all items that need to be available in this codegen unit. - let mut reachable = FxHashSet::default(); - for root in old_codegen_unit.items().keys() { - follow_inlining(*root, cx.inlining_map, &mut reachable); - } +pub(super) fn place_inlined_mono_items<'tcx>( + cx: &PartitioningCx<'_, 'tcx>, + codegen_units: &mut [CodegenUnit<'tcx>], + roots: FxHashSet>, +) -> FxHashMap, MonoItemPlacement> { + let mut mono_item_placements = FxHashMap::default(); - let mut new_codegen_unit = CodegenUnit::new(old_codegen_unit.name()); + let single_codegen_unit = codegen_units.len() == 1; - // Add all monomorphizations that are not already there. - for mono_item in reachable { - if let Some(linkage) = old_codegen_unit.items().get(&mono_item) { - // This is a root, just copy it over. - new_codegen_unit.items_mut().insert(mono_item, *linkage); - } else { - if roots.contains(&mono_item) { - bug!( - "GloballyShared mono-item inlined into other CGU: \ - {:?}", - mono_item - ); - } + for old_codegen_unit in codegen_units.iter_mut() { + // Collect all items that need to be available in this codegen unit. + let mut reachable = FxHashSet::default(); + for root in old_codegen_unit.items().keys() { + follow_inlining(*root, cx.inlining_map, &mut reachable); + } + + let mut new_codegen_unit = CodegenUnit::new(old_codegen_unit.name()); - // This is a CGU-private copy. - new_codegen_unit - .items_mut() - .insert(mono_item, (Linkage::Internal, Visibility::Default)); + // Add all monomorphizations that are not already there. + for mono_item in reachable { + if let Some(linkage) = old_codegen_unit.items().get(&mono_item) { + // This is a root, just copy it over. + new_codegen_unit.items_mut().insert(mono_item, *linkage); + } else { + if roots.contains(&mono_item) { + bug!( + "GloballyShared mono-item inlined into other CGU: \ + {:?}", + mono_item + ); } - if !single_codegen_unit { - // If there is more than one codegen unit, we need to keep track - // in which codegen units each monomorphization is placed. - match mono_item_placements.entry(mono_item) { - Entry::Occupied(e) => { - let placement = e.into_mut(); - debug_assert!(match *placement { - MonoItemPlacement::SingleCgu { cgu_name } => { - cgu_name != new_codegen_unit.name() - } - MonoItemPlacement::MultipleCgus => true, - }); - *placement = MonoItemPlacement::MultipleCgus; - } - Entry::Vacant(e) => { - e.insert(MonoItemPlacement::SingleCgu { - cgu_name: new_codegen_unit.name(), - }); - } + // This is a CGU-private copy. + new_codegen_unit + .items_mut() + .insert(mono_item, (Linkage::Internal, Visibility::Default)); + } + + if !single_codegen_unit { + // If there is more than one codegen unit, we need to keep track + // in which codegen units each monomorphization is placed. + match mono_item_placements.entry(mono_item) { + Entry::Occupied(e) => { + let placement = e.into_mut(); + debug_assert!(match *placement { + MonoItemPlacement::SingleCgu { cgu_name } => { + cgu_name != new_codegen_unit.name() + } + MonoItemPlacement::MultipleCgus => true, + }); + *placement = MonoItemPlacement::MultipleCgus; + } + Entry::Vacant(e) => { + e.insert(MonoItemPlacement::SingleCgu { + cgu_name: new_codegen_unit.name(), + }); } } } - - *old_codegen_unit = new_codegen_unit; } - return mono_item_placements; - - fn follow_inlining<'tcx>( - mono_item: MonoItem<'tcx>, - inlining_map: &InliningMap<'tcx>, - visited: &mut FxHashSet>, - ) { - if !visited.insert(mono_item) { - return; - } - - inlining_map.with_inlining_candidates(mono_item, |target| { - follow_inlining(target, inlining_map, visited); - }); - } + *old_codegen_unit = new_codegen_unit; } - fn internalize_symbols( - &mut self, - cx: &PartitioningCx<'_, 'tcx>, - codegen_units: &mut [CodegenUnit<'tcx>], - mono_item_placements: FxHashMap, MonoItemPlacement>, - internalization_candidates: FxHashSet>, - ) { - if codegen_units.len() == 1 { - // Fast path for when there is only one codegen unit. In this case we - // can internalize all candidates, since there is nowhere else they - // could be accessed from. - for cgu in codegen_units { - for candidate in &internalization_candidates { - cgu.items_mut().insert(*candidate, (Linkage::Internal, Visibility::Default)); - } - } + return mono_item_placements; + fn follow_inlining<'tcx>( + mono_item: MonoItem<'tcx>, + inlining_map: &InliningMap<'tcx>, + visited: &mut FxHashSet>, + ) { + if !visited.insert(mono_item) { return; } - // Build a map from every monomorphization to all the monomorphizations that - // reference it. - let mut accessor_map: FxHashMap, Vec>> = Default::default(); - cx.inlining_map.iter_accesses(|accessor, accessees| { - for accessee in accessees { - accessor_map.entry(*accessee).or_default().push(accessor); - } + inlining_map.with_inlining_candidates(mono_item, |target| { + follow_inlining(target, inlining_map, visited); }); + } +} - // For each internalization candidates in each codegen unit, check if it is - // accessed from outside its defining codegen unit. +pub(super) fn internalize_symbols<'tcx>( + cx: &PartitioningCx<'_, 'tcx>, + codegen_units: &mut [CodegenUnit<'tcx>], + mono_item_placements: FxHashMap, MonoItemPlacement>, + internalization_candidates: FxHashSet>, +) { + if codegen_units.len() == 1 { + // Fast path for when there is only one codegen unit. In this case we + // can internalize all candidates, since there is nowhere else they + // could be accessed from. for cgu in codegen_units { - let home_cgu = MonoItemPlacement::SingleCgu { cgu_name: cgu.name() }; + for candidate in &internalization_candidates { + cgu.items_mut().insert(*candidate, (Linkage::Internal, Visibility::Default)); + } + } + + return; + } + + // Build a map from every monomorphization to all the monomorphizations that + // reference it. + let mut accessor_map: FxHashMap, Vec>> = Default::default(); + cx.inlining_map.iter_accesses(|accessor, accessees| { + for accessee in accessees { + accessor_map.entry(*accessee).or_default().push(accessor); + } + }); - for (accessee, linkage_and_visibility) in cgu.items_mut() { - if !internalization_candidates.contains(accessee) { - // This item is no candidate for internalizing, so skip it. + // For each internalization candidates in each codegen unit, check if it is + // accessed from outside its defining codegen unit. + for cgu in codegen_units { + let home_cgu = MonoItemPlacement::SingleCgu { cgu_name: cgu.name() }; + + for (accessee, linkage_and_visibility) in cgu.items_mut() { + if !internalization_candidates.contains(accessee) { + // This item is no candidate for internalizing, so skip it. + continue; + } + debug_assert_eq!(mono_item_placements[accessee], home_cgu); + + if let Some(accessors) = accessor_map.get(accessee) { + if accessors + .iter() + .filter_map(|accessor| { + // Some accessors might not have been + // instantiated. We can safely ignore those. + mono_item_placements.get(accessor) + }) + .any(|placement| *placement != home_cgu) + { + // Found an accessor from another CGU, so skip to the next + // item without marking this one as internal. continue; } - debug_assert_eq!(mono_item_placements[accessee], home_cgu); - - if let Some(accessors) = accessor_map.get(accessee) { - if accessors - .iter() - .filter_map(|accessor| { - // Some accessors might not have been - // instantiated. We can safely ignore those. - mono_item_placements.get(accessor) - }) - .any(|placement| *placement != home_cgu) - { - // Found an accessor from another CGU, so skip to the next - // item without marking this one as internal. - continue; - } - } - - // If we got here, we did not find any accesses from other CGUs, - // so it's fine to make this monomorphization internal. - *linkage_and_visibility = (Linkage::Internal, Visibility::Default); } + + // If we got here, we did not find any accesses from other CGUs, + // so it's fine to make this monomorphization internal. + *linkage_and_visibility = (Linkage::Internal, Visibility::Default); } } } diff --git a/compiler/rustc_monomorphize/src/partitioning/mod.rs b/compiler/rustc_monomorphize/src/partitioning/mod.rs index d0b23ca9ea444..2843c361e0ac3 100644 --- a/compiler/rustc_monomorphize/src/partitioning/mod.rs +++ b/compiler/rustc_monomorphize/src/partitioning/mod.rs @@ -113,74 +113,7 @@ use rustc_span::symbol::Symbol; use crate::collector::InliningMap; use crate::collector::{self, MonoItemCollectionMode}; -use crate::errors::{ - CouldntDumpMonoStats, SymbolAlreadyDefined, UnknownCguCollectionMode, UnknownPartitionStrategy, -}; - -enum Partitioner { - Default(default::DefaultPartitioning), - // Other partitioning strategies can go here. - Unknown, -} - -impl<'tcx> Partition<'tcx> for Partitioner { - fn place_root_mono_items( - &mut self, - cx: &PartitioningCx<'_, 'tcx>, - mono_items: &mut I, - ) -> PlacedRootMonoItems<'tcx> - where - I: Iterator>, - { - match self { - Partitioner::Default(partitioner) => partitioner.place_root_mono_items(cx, mono_items), - Partitioner::Unknown => cx.tcx.sess.emit_fatal(UnknownPartitionStrategy), - } - } - - fn merge_codegen_units( - &mut self, - cx: &PartitioningCx<'_, 'tcx>, - codegen_units: &mut Vec>, - ) { - match self { - Partitioner::Default(partitioner) => partitioner.merge_codegen_units(cx, codegen_units), - Partitioner::Unknown => cx.tcx.sess.emit_fatal(UnknownPartitionStrategy), - } - } - - fn place_inlined_mono_items( - &mut self, - cx: &PartitioningCx<'_, 'tcx>, - codegen_units: &mut [CodegenUnit<'tcx>], - roots: FxHashSet>, - ) -> FxHashMap, MonoItemPlacement> { - match self { - Partitioner::Default(partitioner) => { - partitioner.place_inlined_mono_items(cx, codegen_units, roots) - } - Partitioner::Unknown => cx.tcx.sess.emit_fatal(UnknownPartitionStrategy), - } - } - - fn internalize_symbols( - &mut self, - cx: &PartitioningCx<'_, 'tcx>, - codegen_units: &mut [CodegenUnit<'tcx>], - mono_item_placements: FxHashMap, MonoItemPlacement>, - internalization_candidates: FxHashSet>, - ) { - match self { - Partitioner::Default(partitioner) => partitioner.internalize_symbols( - cx, - codegen_units, - mono_item_placements, - internalization_candidates, - ), - Partitioner::Unknown => cx.tcx.sess.emit_fatal(UnknownPartitionStrategy), - } - } -} +use crate::errors::{CouldntDumpMonoStats, SymbolAlreadyDefined, UnknownCguCollectionMode}; struct PartitioningCx<'a, 'tcx> { tcx: TyCtxt<'tcx>, @@ -194,49 +127,6 @@ pub struct PlacedRootMonoItems<'tcx> { internalization_candidates: FxHashSet>, } -trait Partition<'tcx> { - fn place_root_mono_items( - &mut self, - cx: &PartitioningCx<'_, 'tcx>, - mono_items: &mut I, - ) -> PlacedRootMonoItems<'tcx> - where - I: Iterator>; - - fn merge_codegen_units( - &mut self, - cx: &PartitioningCx<'_, 'tcx>, - codegen_units: &mut Vec>, - ); - - fn place_inlined_mono_items( - &mut self, - cx: &PartitioningCx<'_, 'tcx>, - codegen_units: &mut [CodegenUnit<'tcx>], - roots: FxHashSet>, - ) -> FxHashMap, MonoItemPlacement>; - - fn internalize_symbols( - &mut self, - cx: &PartitioningCx<'_, 'tcx>, - codegen_units: &mut [CodegenUnit<'tcx>], - mono_item_placements: FxHashMap, MonoItemPlacement>, - internalization_candidates: FxHashSet>, - ); -} - -fn get_partitioner(tcx: TyCtxt<'_>) -> Partitioner { - let strategy = match &tcx.sess.opts.unstable_opts.cgu_partitioning_strategy { - None => "default", - Some(s) => &s[..], - }; - - match strategy { - "default" => Partitioner::Default(default::DefaultPartitioning), - _ => Partitioner::Unknown, - } -} - fn partition<'tcx, I>( tcx: TyCtxt<'tcx>, mono_items: &mut I, @@ -248,14 +138,13 @@ where { let _prof_timer = tcx.prof.generic_activity("cgu_partitioning"); - let mut partitioner = get_partitioner(tcx); let cx = &PartitioningCx { tcx, target_cgu_count: max_cgu_count, inlining_map }; // In the first step, we place all regular monomorphizations into their // respective 'home' codegen unit. Regular monomorphizations are all // functions and statics defined in the local crate. let PlacedRootMonoItems { mut codegen_units, roots, internalization_candidates } = { let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_place_roots"); - partitioner.place_root_mono_items(cx, mono_items) + default::place_root_mono_items(cx, mono_items) }; for cgu in &mut codegen_units { @@ -269,7 +158,7 @@ where // estimates. { let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_merge_cgus"); - partitioner.merge_codegen_units(cx, &mut codegen_units); + default::merge_codegen_units(cx, &mut codegen_units); debug_dump(tcx, "POST MERGING", &codegen_units); } @@ -279,7 +168,7 @@ where // local functions the definition of which is marked with `#[inline]`. let mono_item_placements = { let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_place_inline_items"); - partitioner.place_inlined_mono_items(cx, &mut codegen_units, roots) + default::place_inlined_mono_items(cx, &mut codegen_units, roots) }; for cgu in &mut codegen_units { @@ -292,7 +181,7 @@ where // more freedom to optimize. if !tcx.sess.link_dead_code() { let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_internalize_symbols"); - partitioner.internalize_symbols( + default::internalize_symbols( cx, &mut codegen_units, mono_item_placements, diff --git a/compiler/rustc_session/src/options.rs b/compiler/rustc_session/src/options.rs index 007e720823bfa..7cc2b2c880c60 100644 --- a/compiler/rustc_session/src/options.rs +++ b/compiler/rustc_session/src/options.rs @@ -1372,8 +1372,6 @@ options! { "set options for branch target identification and pointer authentication on AArch64"), cf_protection: CFProtection = (CFProtection::None, parse_cfprotection, [TRACKED], "instrument control-flow architecture protection"), - cgu_partitioning_strategy: Option = (None, parse_opt_string, [TRACKED], - "the codegen unit partitioning strategy to use"), codegen_backend: Option = (None, parse_opt_string, [TRACKED], "the backend to use"), combine_cgu: bool = (false, parse_bool, [TRACKED], From 66cf072ac8fa10648d5eccbacb75c7423204af1e Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 30 May 2023 17:39:44 +1000 Subject: [PATCH 13/16] Merge `default.rs` into `mod.rs`. Within `compiler/rustc_monomorphize/src/partitioning/`, because the previous commit removed the need for `default.rs` to be a separate file. --- .../src/partitioning/default.rs | 637 ----------------- .../src/partitioning/mod.rs | 644 +++++++++++++++++- 2 files changed, 632 insertions(+), 649 deletions(-) delete mode 100644 compiler/rustc_monomorphize/src/partitioning/default.rs diff --git a/compiler/rustc_monomorphize/src/partitioning/default.rs b/compiler/rustc_monomorphize/src/partitioning/default.rs deleted file mode 100644 index 71cbee3b16695..0000000000000 --- a/compiler/rustc_monomorphize/src/partitioning/default.rs +++ /dev/null @@ -1,637 +0,0 @@ -use std::cmp; -use std::collections::hash_map::Entry; - -use rustc_data_structures::fx::{FxHashMap, FxHashSet}; -use rustc_hir::def::DefKind; -use rustc_hir::def_id::{DefId, LOCAL_CRATE}; -use rustc_hir::definitions::DefPathDataName; -use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; -use rustc_middle::middle::exported_symbols::{SymbolExportInfo, SymbolExportLevel}; -use rustc_middle::mir::mono::{CodegenUnit, CodegenUnitNameBuilder, Linkage, Visibility}; -use rustc_middle::mir::mono::{InstantiationMode, MonoItem}; -use rustc_middle::ty::print::characteristic_def_id_of_type; -use rustc_middle::ty::{self, visit::TypeVisitableExt, InstanceDef, TyCtxt}; -use rustc_span::symbol::Symbol; - -use super::PartitioningCx; -use crate::collector::InliningMap; -use crate::partitioning::{MonoItemPlacement, PlacedRootMonoItems}; - -// This modules implements the default (and only) partitioning strategy. - -pub(super) fn place_root_mono_items<'tcx, I>( - cx: &PartitioningCx<'_, 'tcx>, - mono_items: &mut I, -) -> PlacedRootMonoItems<'tcx> -where - I: Iterator>, -{ - let mut roots = FxHashSet::default(); - let mut codegen_units = FxHashMap::default(); - let is_incremental_build = cx.tcx.sess.opts.incremental.is_some(); - let mut internalization_candidates = FxHashSet::default(); - - // Determine if monomorphizations instantiated in this crate will be made - // available to downstream crates. This depends on whether we are in - // share-generics mode and whether the current crate can even have - // downstream crates. - let export_generics = - cx.tcx.sess.opts.share_generics() && cx.tcx.local_crate_exports_generics(); - - let cgu_name_builder = &mut CodegenUnitNameBuilder::new(cx.tcx); - let cgu_name_cache = &mut FxHashMap::default(); - - for mono_item in mono_items { - match mono_item.instantiation_mode(cx.tcx) { - InstantiationMode::GloballyShared { .. } => {} - InstantiationMode::LocalCopy => continue, - } - - let characteristic_def_id = characteristic_def_id_of_mono_item(cx.tcx, mono_item); - let is_volatile = is_incremental_build && mono_item.is_generic_fn(); - - let codegen_unit_name = match characteristic_def_id { - Some(def_id) => compute_codegen_unit_name( - cx.tcx, - cgu_name_builder, - def_id, - is_volatile, - cgu_name_cache, - ), - None => fallback_cgu_name(cgu_name_builder), - }; - - let codegen_unit = codegen_units - .entry(codegen_unit_name) - .or_insert_with(|| CodegenUnit::new(codegen_unit_name)); - - let mut can_be_internalized = true; - let (linkage, visibility) = mono_item_linkage_and_visibility( - cx.tcx, - &mono_item, - &mut can_be_internalized, - export_generics, - ); - if visibility == Visibility::Hidden && can_be_internalized { - internalization_candidates.insert(mono_item); - } - - codegen_unit.items_mut().insert(mono_item, (linkage, visibility)); - roots.insert(mono_item); - } - - // Always ensure we have at least one CGU; otherwise, if we have a - // crate with just types (for example), we could wind up with no CGU. - if codegen_units.is_empty() { - let codegen_unit_name = fallback_cgu_name(cgu_name_builder); - codegen_units.insert(codegen_unit_name, CodegenUnit::new(codegen_unit_name)); - } - - let codegen_units = codegen_units.into_values().collect(); - PlacedRootMonoItems { codegen_units, roots, internalization_candidates } -} - -pub(super) fn merge_codegen_units<'tcx>( - cx: &PartitioningCx<'_, 'tcx>, - codegen_units: &mut Vec>, -) { - assert!(cx.target_cgu_count >= 1); - - // Note that at this point in time the `codegen_units` here may not be - // in a deterministic order (but we know they're deterministically the - // same set). We want this merging to produce a deterministic ordering - // of codegen units from the input. - // - // Due to basically how we've implemented the merging below (merge the - // two smallest into each other) we're sure to start off with a - // deterministic order (sorted by name). This'll mean that if two cgus - // have the same size the stable sort below will keep everything nice - // and deterministic. - codegen_units.sort_by(|a, b| a.name().as_str().cmp(b.name().as_str())); - - // This map keeps track of what got merged into what. - let mut cgu_contents: FxHashMap> = - codegen_units.iter().map(|cgu| (cgu.name(), vec![cgu.name()])).collect(); - - // Merge the two smallest codegen units until the target size is - // reached. - while codegen_units.len() > cx.target_cgu_count { - // Sort small cgus to the back - codegen_units.sort_by_cached_key(|cgu| cmp::Reverse(cgu.size_estimate())); - let mut smallest = codegen_units.pop().unwrap(); - let second_smallest = codegen_units.last_mut().unwrap(); - - // Move the mono-items from `smallest` to `second_smallest` - second_smallest.modify_size_estimate(smallest.size_estimate()); - for (k, v) in smallest.items_mut().drain() { - second_smallest.items_mut().insert(k, v); - } - - // Record that `second_smallest` now contains all the stuff that was - // in `smallest` before. - let mut consumed_cgu_names = cgu_contents.remove(&smallest.name()).unwrap(); - cgu_contents.get_mut(&second_smallest.name()).unwrap().append(&mut consumed_cgu_names); - - debug!( - "CodegenUnit {} merged into CodegenUnit {}", - smallest.name(), - second_smallest.name() - ); - } - - let cgu_name_builder = &mut CodegenUnitNameBuilder::new(cx.tcx); - - if cx.tcx.sess.opts.incremental.is_some() { - // If we are doing incremental compilation, we want CGU names to - // reflect the path of the source level module they correspond to. - // For CGUs that contain the code of multiple modules because of the - // merging done above, we use a concatenation of the names of all - // contained CGUs. - let new_cgu_names: FxHashMap = cgu_contents - .into_iter() - // This `filter` makes sure we only update the name of CGUs that - // were actually modified by merging. - .filter(|(_, cgu_contents)| cgu_contents.len() > 1) - .map(|(current_cgu_name, cgu_contents)| { - let mut cgu_contents: Vec<&str> = cgu_contents.iter().map(|s| s.as_str()).collect(); - - // Sort the names, so things are deterministic and easy to - // predict. We are sorting primitive `&str`s here so we can - // use unstable sort. - cgu_contents.sort_unstable(); - - (current_cgu_name, cgu_contents.join("--")) - }) - .collect(); - - for cgu in codegen_units.iter_mut() { - if let Some(new_cgu_name) = new_cgu_names.get(&cgu.name()) { - if cx.tcx.sess.opts.unstable_opts.human_readable_cgu_names { - cgu.set_name(Symbol::intern(&new_cgu_name)); - } else { - // If we don't require CGU names to be human-readable, - // we use a fixed length hash of the composite CGU name - // instead. - let new_cgu_name = CodegenUnit::mangle_name(&new_cgu_name); - cgu.set_name(Symbol::intern(&new_cgu_name)); - } - } - } - } else { - // If we are compiling non-incrementally we just generate simple CGU - // names containing an index. - for (index, cgu) in codegen_units.iter_mut().enumerate() { - let numbered_codegen_unit_name = - cgu_name_builder.build_cgu_name_no_mangle(LOCAL_CRATE, &["cgu"], Some(index)); - cgu.set_name(numbered_codegen_unit_name); - } - } -} - -pub(super) fn place_inlined_mono_items<'tcx>( - cx: &PartitioningCx<'_, 'tcx>, - codegen_units: &mut [CodegenUnit<'tcx>], - roots: FxHashSet>, -) -> FxHashMap, MonoItemPlacement> { - let mut mono_item_placements = FxHashMap::default(); - - let single_codegen_unit = codegen_units.len() == 1; - - for old_codegen_unit in codegen_units.iter_mut() { - // Collect all items that need to be available in this codegen unit. - let mut reachable = FxHashSet::default(); - for root in old_codegen_unit.items().keys() { - follow_inlining(*root, cx.inlining_map, &mut reachable); - } - - let mut new_codegen_unit = CodegenUnit::new(old_codegen_unit.name()); - - // Add all monomorphizations that are not already there. - for mono_item in reachable { - if let Some(linkage) = old_codegen_unit.items().get(&mono_item) { - // This is a root, just copy it over. - new_codegen_unit.items_mut().insert(mono_item, *linkage); - } else { - if roots.contains(&mono_item) { - bug!( - "GloballyShared mono-item inlined into other CGU: \ - {:?}", - mono_item - ); - } - - // This is a CGU-private copy. - new_codegen_unit - .items_mut() - .insert(mono_item, (Linkage::Internal, Visibility::Default)); - } - - if !single_codegen_unit { - // If there is more than one codegen unit, we need to keep track - // in which codegen units each monomorphization is placed. - match mono_item_placements.entry(mono_item) { - Entry::Occupied(e) => { - let placement = e.into_mut(); - debug_assert!(match *placement { - MonoItemPlacement::SingleCgu { cgu_name } => { - cgu_name != new_codegen_unit.name() - } - MonoItemPlacement::MultipleCgus => true, - }); - *placement = MonoItemPlacement::MultipleCgus; - } - Entry::Vacant(e) => { - e.insert(MonoItemPlacement::SingleCgu { - cgu_name: new_codegen_unit.name(), - }); - } - } - } - } - - *old_codegen_unit = new_codegen_unit; - } - - return mono_item_placements; - - fn follow_inlining<'tcx>( - mono_item: MonoItem<'tcx>, - inlining_map: &InliningMap<'tcx>, - visited: &mut FxHashSet>, - ) { - if !visited.insert(mono_item) { - return; - } - - inlining_map.with_inlining_candidates(mono_item, |target| { - follow_inlining(target, inlining_map, visited); - }); - } -} - -pub(super) fn internalize_symbols<'tcx>( - cx: &PartitioningCx<'_, 'tcx>, - codegen_units: &mut [CodegenUnit<'tcx>], - mono_item_placements: FxHashMap, MonoItemPlacement>, - internalization_candidates: FxHashSet>, -) { - if codegen_units.len() == 1 { - // Fast path for when there is only one codegen unit. In this case we - // can internalize all candidates, since there is nowhere else they - // could be accessed from. - for cgu in codegen_units { - for candidate in &internalization_candidates { - cgu.items_mut().insert(*candidate, (Linkage::Internal, Visibility::Default)); - } - } - - return; - } - - // Build a map from every monomorphization to all the monomorphizations that - // reference it. - let mut accessor_map: FxHashMap, Vec>> = Default::default(); - cx.inlining_map.iter_accesses(|accessor, accessees| { - for accessee in accessees { - accessor_map.entry(*accessee).or_default().push(accessor); - } - }); - - // For each internalization candidates in each codegen unit, check if it is - // accessed from outside its defining codegen unit. - for cgu in codegen_units { - let home_cgu = MonoItemPlacement::SingleCgu { cgu_name: cgu.name() }; - - for (accessee, linkage_and_visibility) in cgu.items_mut() { - if !internalization_candidates.contains(accessee) { - // This item is no candidate for internalizing, so skip it. - continue; - } - debug_assert_eq!(mono_item_placements[accessee], home_cgu); - - if let Some(accessors) = accessor_map.get(accessee) { - if accessors - .iter() - .filter_map(|accessor| { - // Some accessors might not have been - // instantiated. We can safely ignore those. - mono_item_placements.get(accessor) - }) - .any(|placement| *placement != home_cgu) - { - // Found an accessor from another CGU, so skip to the next - // item without marking this one as internal. - continue; - } - } - - // If we got here, we did not find any accesses from other CGUs, - // so it's fine to make this monomorphization internal. - *linkage_and_visibility = (Linkage::Internal, Visibility::Default); - } - } -} - -fn characteristic_def_id_of_mono_item<'tcx>( - tcx: TyCtxt<'tcx>, - mono_item: MonoItem<'tcx>, -) -> Option { - match mono_item { - MonoItem::Fn(instance) => { - let def_id = match instance.def { - ty::InstanceDef::Item(def) => def, - ty::InstanceDef::VTableShim(..) - | ty::InstanceDef::ReifyShim(..) - | ty::InstanceDef::FnPtrShim(..) - | ty::InstanceDef::ClosureOnceShim { .. } - | ty::InstanceDef::Intrinsic(..) - | ty::InstanceDef::DropGlue(..) - | ty::InstanceDef::Virtual(..) - | ty::InstanceDef::CloneShim(..) - | ty::InstanceDef::ThreadLocalShim(..) - | ty::InstanceDef::FnPtrAddrShim(..) => return None, - }; - - // If this is a method, we want to put it into the same module as - // its self-type. If the self-type does not provide a characteristic - // DefId, we use the location of the impl after all. - - if tcx.trait_of_item(def_id).is_some() { - let self_ty = instance.substs.type_at(0); - // This is a default implementation of a trait method. - return characteristic_def_id_of_type(self_ty).or(Some(def_id)); - } - - if let Some(impl_def_id) = tcx.impl_of_method(def_id) { - if tcx.sess.opts.incremental.is_some() - && tcx.trait_id_of_impl(impl_def_id) == tcx.lang_items().drop_trait() - { - // Put `Drop::drop` into the same cgu as `drop_in_place` - // since `drop_in_place` is the only thing that can - // call it. - return None; - } - - // When polymorphization is enabled, methods which do not depend on their generic - // parameters, but the self-type of their impl block do will fail to normalize. - if !tcx.sess.opts.unstable_opts.polymorphize || !instance.has_param() { - // This is a method within an impl, find out what the self-type is: - let impl_self_ty = tcx.subst_and_normalize_erasing_regions( - instance.substs, - ty::ParamEnv::reveal_all(), - tcx.type_of(impl_def_id), - ); - if let Some(def_id) = characteristic_def_id_of_type(impl_self_ty) { - return Some(def_id); - } - } - } - - Some(def_id) - } - MonoItem::Static(def_id) => Some(def_id), - MonoItem::GlobalAsm(item_id) => Some(item_id.owner_id.to_def_id()), - } -} - -fn compute_codegen_unit_name( - tcx: TyCtxt<'_>, - name_builder: &mut CodegenUnitNameBuilder<'_>, - def_id: DefId, - volatile: bool, - cache: &mut CguNameCache, -) -> Symbol { - // Find the innermost module that is not nested within a function. - let mut current_def_id = def_id; - let mut cgu_def_id = None; - // Walk backwards from the item we want to find the module for. - loop { - if current_def_id.is_crate_root() { - if cgu_def_id.is_none() { - // If we have not found a module yet, take the crate root. - cgu_def_id = Some(def_id.krate.as_def_id()); - } - break; - } else if tcx.def_kind(current_def_id) == DefKind::Mod { - if cgu_def_id.is_none() { - cgu_def_id = Some(current_def_id); - } - } else { - // If we encounter something that is not a module, throw away - // any module that we've found so far because we now know that - // it is nested within something else. - cgu_def_id = None; - } - - current_def_id = tcx.parent(current_def_id); - } - - let cgu_def_id = cgu_def_id.unwrap(); - - *cache.entry((cgu_def_id, volatile)).or_insert_with(|| { - let def_path = tcx.def_path(cgu_def_id); - - let components = def_path.data.iter().map(|part| match part.data.name() { - DefPathDataName::Named(name) => name, - DefPathDataName::Anon { .. } => unreachable!(), - }); - - let volatile_suffix = volatile.then_some("volatile"); - - name_builder.build_cgu_name(def_path.krate, components, volatile_suffix) - }) -} - -// Anything we can't find a proper codegen unit for goes into this. -fn fallback_cgu_name(name_builder: &mut CodegenUnitNameBuilder<'_>) -> Symbol { - name_builder.build_cgu_name(LOCAL_CRATE, &["fallback"], Some("cgu")) -} - -fn mono_item_linkage_and_visibility<'tcx>( - tcx: TyCtxt<'tcx>, - mono_item: &MonoItem<'tcx>, - can_be_internalized: &mut bool, - export_generics: bool, -) -> (Linkage, Visibility) { - if let Some(explicit_linkage) = mono_item.explicit_linkage(tcx) { - return (explicit_linkage, Visibility::Default); - } - let vis = mono_item_visibility(tcx, mono_item, can_be_internalized, export_generics); - (Linkage::External, vis) -} - -type CguNameCache = FxHashMap<(DefId, bool), Symbol>; - -fn static_visibility<'tcx>( - tcx: TyCtxt<'tcx>, - can_be_internalized: &mut bool, - def_id: DefId, -) -> Visibility { - if tcx.is_reachable_non_generic(def_id) { - *can_be_internalized = false; - default_visibility(tcx, def_id, false) - } else { - Visibility::Hidden - } -} - -fn mono_item_visibility<'tcx>( - tcx: TyCtxt<'tcx>, - mono_item: &MonoItem<'tcx>, - can_be_internalized: &mut bool, - export_generics: bool, -) -> Visibility { - let instance = match mono_item { - // This is pretty complicated; see below. - MonoItem::Fn(instance) => instance, - - // Misc handling for generics and such, but otherwise: - MonoItem::Static(def_id) => return static_visibility(tcx, can_be_internalized, *def_id), - MonoItem::GlobalAsm(item_id) => { - return static_visibility(tcx, can_be_internalized, item_id.owner_id.to_def_id()); - } - }; - - let def_id = match instance.def { - InstanceDef::Item(def_id) | InstanceDef::DropGlue(def_id, Some(_)) => def_id, - - // We match the visibility of statics here - InstanceDef::ThreadLocalShim(def_id) => { - return static_visibility(tcx, can_be_internalized, def_id); - } - - // These are all compiler glue and such, never exported, always hidden. - InstanceDef::VTableShim(..) - | InstanceDef::ReifyShim(..) - | InstanceDef::FnPtrShim(..) - | InstanceDef::Virtual(..) - | InstanceDef::Intrinsic(..) - | InstanceDef::ClosureOnceShim { .. } - | InstanceDef::DropGlue(..) - | InstanceDef::CloneShim(..) - | InstanceDef::FnPtrAddrShim(..) => return Visibility::Hidden, - }; - - // The `start_fn` lang item is actually a monomorphized instance of a - // function in the standard library, used for the `main` function. We don't - // want to export it so we tag it with `Hidden` visibility but this symbol - // is only referenced from the actual `main` symbol which we unfortunately - // don't know anything about during partitioning/collection. As a result we - // forcibly keep this symbol out of the `internalization_candidates` set. - // - // FIXME: eventually we don't want to always force this symbol to have - // hidden visibility, it should indeed be a candidate for - // internalization, but we have to understand that it's referenced - // from the `main` symbol we'll generate later. - // - // This may be fixable with a new `InstanceDef` perhaps? Unsure! - if tcx.lang_items().start_fn() == Some(def_id) { - *can_be_internalized = false; - return Visibility::Hidden; - } - - let is_generic = instance.substs.non_erasable_generics().next().is_some(); - - // Upstream `DefId` instances get different handling than local ones. - let Some(def_id) = def_id.as_local() else { - return if export_generics && is_generic { - // If it is an upstream monomorphization and we export generics, we must make - // it available to downstream crates. - *can_be_internalized = false; - default_visibility(tcx, def_id, true) - } else { - Visibility::Hidden - }; - }; - - if is_generic { - if export_generics { - if tcx.is_unreachable_local_definition(def_id) { - // This instance cannot be used from another crate. - Visibility::Hidden - } else { - // This instance might be useful in a downstream crate. - *can_be_internalized = false; - default_visibility(tcx, def_id.to_def_id(), true) - } - } else { - // We are not exporting generics or the definition is not reachable - // for downstream crates, we can internalize its instantiations. - Visibility::Hidden - } - } else { - // If this isn't a generic function then we mark this a `Default` if - // this is a reachable item, meaning that it's a symbol other crates may - // access when they link to us. - if tcx.is_reachable_non_generic(def_id.to_def_id()) { - *can_be_internalized = false; - debug_assert!(!is_generic); - return default_visibility(tcx, def_id.to_def_id(), false); - } - - // If this isn't reachable then we're gonna tag this with `Hidden` - // visibility. In some situations though we'll want to prevent this - // symbol from being internalized. - // - // There's two categories of items here: - // - // * First is weak lang items. These are basically mechanisms for - // libcore to forward-reference symbols defined later in crates like - // the standard library or `#[panic_handler]` definitions. The - // definition of these weak lang items needs to be referencable by - // libcore, so we're no longer a candidate for internalization. - // Removal of these functions can't be done by LLVM but rather must be - // done by the linker as it's a non-local decision. - // - // * Second is "std internal symbols". Currently this is primarily used - // for allocator symbols. Allocators are a little weird in their - // implementation, but the idea is that the compiler, at the last - // minute, defines an allocator with an injected object file. The - // `alloc` crate references these symbols (`__rust_alloc`) and the - // definition doesn't get hooked up until a linked crate artifact is - // generated. - // - // The symbols synthesized by the compiler (`__rust_alloc`) are thin - // veneers around the actual implementation, some other symbol which - // implements the same ABI. These symbols (things like `__rg_alloc`, - // `__rdl_alloc`, `__rde_alloc`, etc), are all tagged with "std - // internal symbols". - // - // The std-internal symbols here **should not show up in a dll as an - // exported interface**, so they return `false` from - // `is_reachable_non_generic` above and we'll give them `Hidden` - // visibility below. Like the weak lang items, though, we can't let - // LLVM internalize them as this decision is left up to the linker to - // omit them, so prevent them from being internalized. - let attrs = tcx.codegen_fn_attrs(def_id); - if attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL) { - *can_be_internalized = false; - } - - Visibility::Hidden - } -} - -fn default_visibility(tcx: TyCtxt<'_>, id: DefId, is_generic: bool) -> Visibility { - if !tcx.sess.target.default_hidden_visibility { - return Visibility::Default; - } - - // Generic functions never have export-level C. - if is_generic { - return Visibility::Hidden; - } - - // Things with export level C don't get instantiated in - // downstream crates. - if !id.is_local() { - return Visibility::Hidden; - } - - // C-export level items remain at `Default`, all other internal - // items become `Hidden`. - match tcx.reachable_non_generics(id.krate).get(&id) { - Some(SymbolExportInfo { level: SymbolExportLevel::C, .. }) => Visibility::Default, - _ => Visibility::Hidden, - } -} diff --git a/compiler/rustc_monomorphize/src/partitioning/mod.rs b/compiler/rustc_monomorphize/src/partitioning/mod.rs index 2843c361e0ac3..be9c349c38416 100644 --- a/compiler/rustc_monomorphize/src/partitioning/mod.rs +++ b/compiler/rustc_monomorphize/src/partitioning/mod.rs @@ -92,22 +92,26 @@ //! source-level module, functions from the same module will be available for //! inlining, even when they are not marked `#[inline]`. -mod default; - use std::cmp; +use std::collections::hash_map::Entry; use std::fs::{self, File}; use std::io::{BufWriter, Write}; use std::path::{Path, PathBuf}; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::sync; -use rustc_hir::def_id::{DefIdSet, LOCAL_CRATE}; +use rustc_hir::def::DefKind; +use rustc_hir::def_id::{DefId, DefIdSet, LOCAL_CRATE}; +use rustc_hir::definitions::DefPathDataName; +use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; +use rustc_middle::middle::exported_symbols::{SymbolExportInfo, SymbolExportLevel}; use rustc_middle::mir; -use rustc_middle::mir::mono::MonoItem; -use rustc_middle::mir::mono::{CodegenUnit, Linkage}; +use rustc_middle::mir::mono::{ + CodegenUnit, CodegenUnitNameBuilder, InstantiationMode, Linkage, MonoItem, Visibility, +}; use rustc_middle::query::Providers; -use rustc_middle::ty::print::with_no_trimmed_paths; -use rustc_middle::ty::TyCtxt; +use rustc_middle::ty::print::{characteristic_def_id_of_type, with_no_trimmed_paths}; +use rustc_middle::ty::{self, visit::TypeVisitableExt, InstanceDef, TyCtxt}; use rustc_session::config::{DumpMonoStatsFormat, SwitchWithOptPath}; use rustc_span::symbol::Symbol; @@ -121,7 +125,7 @@ struct PartitioningCx<'a, 'tcx> { inlining_map: &'a InliningMap<'tcx>, } -pub struct PlacedRootMonoItems<'tcx> { +struct PlacedRootMonoItems<'tcx> { codegen_units: Vec>, roots: FxHashSet>, internalization_candidates: FxHashSet>, @@ -144,7 +148,7 @@ where // functions and statics defined in the local crate. let PlacedRootMonoItems { mut codegen_units, roots, internalization_candidates } = { let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_place_roots"); - default::place_root_mono_items(cx, mono_items) + place_root_mono_items(cx, mono_items) }; for cgu in &mut codegen_units { @@ -158,7 +162,7 @@ where // estimates. { let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_merge_cgus"); - default::merge_codegen_units(cx, &mut codegen_units); + merge_codegen_units(cx, &mut codegen_units); debug_dump(tcx, "POST MERGING", &codegen_units); } @@ -168,7 +172,7 @@ where // local functions the definition of which is marked with `#[inline]`. let mono_item_placements = { let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_place_inline_items"); - default::place_inlined_mono_items(cx, &mut codegen_units, roots) + place_inlined_mono_items(cx, &mut codegen_units, roots) }; for cgu in &mut codegen_units { @@ -181,7 +185,7 @@ where // more freedom to optimize. if !tcx.sess.link_dead_code() { let _prof_timer = tcx.prof.generic_activity("cgu_partitioning_internalize_symbols"); - default::internalize_symbols( + internalize_symbols( cx, &mut codegen_units, mono_item_placements, @@ -229,6 +233,175 @@ where codegen_units } +fn place_root_mono_items<'tcx, I>( + cx: &PartitioningCx<'_, 'tcx>, + mono_items: &mut I, +) -> PlacedRootMonoItems<'tcx> +where + I: Iterator>, +{ + let mut roots = FxHashSet::default(); + let mut codegen_units = FxHashMap::default(); + let is_incremental_build = cx.tcx.sess.opts.incremental.is_some(); + let mut internalization_candidates = FxHashSet::default(); + + // Determine if monomorphizations instantiated in this crate will be made + // available to downstream crates. This depends on whether we are in + // share-generics mode and whether the current crate can even have + // downstream crates. + let export_generics = + cx.tcx.sess.opts.share_generics() && cx.tcx.local_crate_exports_generics(); + + let cgu_name_builder = &mut CodegenUnitNameBuilder::new(cx.tcx); + let cgu_name_cache = &mut FxHashMap::default(); + + for mono_item in mono_items { + match mono_item.instantiation_mode(cx.tcx) { + InstantiationMode::GloballyShared { .. } => {} + InstantiationMode::LocalCopy => continue, + } + + let characteristic_def_id = characteristic_def_id_of_mono_item(cx.tcx, mono_item); + let is_volatile = is_incremental_build && mono_item.is_generic_fn(); + + let codegen_unit_name = match characteristic_def_id { + Some(def_id) => compute_codegen_unit_name( + cx.tcx, + cgu_name_builder, + def_id, + is_volatile, + cgu_name_cache, + ), + None => fallback_cgu_name(cgu_name_builder), + }; + + let codegen_unit = codegen_units + .entry(codegen_unit_name) + .or_insert_with(|| CodegenUnit::new(codegen_unit_name)); + + let mut can_be_internalized = true; + let (linkage, visibility) = mono_item_linkage_and_visibility( + cx.tcx, + &mono_item, + &mut can_be_internalized, + export_generics, + ); + if visibility == Visibility::Hidden && can_be_internalized { + internalization_candidates.insert(mono_item); + } + + codegen_unit.items_mut().insert(mono_item, (linkage, visibility)); + roots.insert(mono_item); + } + + // Always ensure we have at least one CGU; otherwise, if we have a + // crate with just types (for example), we could wind up with no CGU. + if codegen_units.is_empty() { + let codegen_unit_name = fallback_cgu_name(cgu_name_builder); + codegen_units.insert(codegen_unit_name, CodegenUnit::new(codegen_unit_name)); + } + + let codegen_units = codegen_units.into_values().collect(); + PlacedRootMonoItems { codegen_units, roots, internalization_candidates } +} + +fn merge_codegen_units<'tcx>( + cx: &PartitioningCx<'_, 'tcx>, + codegen_units: &mut Vec>, +) { + assert!(cx.target_cgu_count >= 1); + + // Note that at this point in time the `codegen_units` here may not be + // in a deterministic order (but we know they're deterministically the + // same set). We want this merging to produce a deterministic ordering + // of codegen units from the input. + // + // Due to basically how we've implemented the merging below (merge the + // two smallest into each other) we're sure to start off with a + // deterministic order (sorted by name). This'll mean that if two cgus + // have the same size the stable sort below will keep everything nice + // and deterministic. + codegen_units.sort_by(|a, b| a.name().as_str().cmp(b.name().as_str())); + + // This map keeps track of what got merged into what. + let mut cgu_contents: FxHashMap> = + codegen_units.iter().map(|cgu| (cgu.name(), vec![cgu.name()])).collect(); + + // Merge the two smallest codegen units until the target size is + // reached. + while codegen_units.len() > cx.target_cgu_count { + // Sort small cgus to the back + codegen_units.sort_by_cached_key(|cgu| cmp::Reverse(cgu.size_estimate())); + let mut smallest = codegen_units.pop().unwrap(); + let second_smallest = codegen_units.last_mut().unwrap(); + + // Move the mono-items from `smallest` to `second_smallest` + second_smallest.modify_size_estimate(smallest.size_estimate()); + for (k, v) in smallest.items_mut().drain() { + second_smallest.items_mut().insert(k, v); + } + + // Record that `second_smallest` now contains all the stuff that was + // in `smallest` before. + let mut consumed_cgu_names = cgu_contents.remove(&smallest.name()).unwrap(); + cgu_contents.get_mut(&second_smallest.name()).unwrap().append(&mut consumed_cgu_names); + + debug!( + "CodegenUnit {} merged into CodegenUnit {}", + smallest.name(), + second_smallest.name() + ); + } + + let cgu_name_builder = &mut CodegenUnitNameBuilder::new(cx.tcx); + + if cx.tcx.sess.opts.incremental.is_some() { + // If we are doing incremental compilation, we want CGU names to + // reflect the path of the source level module they correspond to. + // For CGUs that contain the code of multiple modules because of the + // merging done above, we use a concatenation of the names of all + // contained CGUs. + let new_cgu_names: FxHashMap = cgu_contents + .into_iter() + // This `filter` makes sure we only update the name of CGUs that + // were actually modified by merging. + .filter(|(_, cgu_contents)| cgu_contents.len() > 1) + .map(|(current_cgu_name, cgu_contents)| { + let mut cgu_contents: Vec<&str> = cgu_contents.iter().map(|s| s.as_str()).collect(); + + // Sort the names, so things are deterministic and easy to + // predict. We are sorting primitive `&str`s here so we can + // use unstable sort. + cgu_contents.sort_unstable(); + + (current_cgu_name, cgu_contents.join("--")) + }) + .collect(); + + for cgu in codegen_units.iter_mut() { + if let Some(new_cgu_name) = new_cgu_names.get(&cgu.name()) { + if cx.tcx.sess.opts.unstable_opts.human_readable_cgu_names { + cgu.set_name(Symbol::intern(&new_cgu_name)); + } else { + // If we don't require CGU names to be human-readable, + // we use a fixed length hash of the composite CGU name + // instead. + let new_cgu_name = CodegenUnit::mangle_name(&new_cgu_name); + cgu.set_name(Symbol::intern(&new_cgu_name)); + } + } + } + } else { + // If we are compiling non-incrementally we just generate simple CGU + // names containing an index. + for (index, cgu) in codegen_units.iter_mut().enumerate() { + let numbered_codegen_unit_name = + cgu_name_builder.build_cgu_name_no_mangle(LOCAL_CRATE, &["cgu"], Some(index)); + cgu.set_name(numbered_codegen_unit_name); + } + } +} + /// For symbol internalization, we need to know whether a symbol/mono-item is /// accessed from outside the codegen unit it is defined in. This type is used /// to keep track of that. @@ -238,6 +411,453 @@ enum MonoItemPlacement { MultipleCgus, } +fn place_inlined_mono_items<'tcx>( + cx: &PartitioningCx<'_, 'tcx>, + codegen_units: &mut [CodegenUnit<'tcx>], + roots: FxHashSet>, +) -> FxHashMap, MonoItemPlacement> { + let mut mono_item_placements = FxHashMap::default(); + + let single_codegen_unit = codegen_units.len() == 1; + + for old_codegen_unit in codegen_units.iter_mut() { + // Collect all items that need to be available in this codegen unit. + let mut reachable = FxHashSet::default(); + for root in old_codegen_unit.items().keys() { + follow_inlining(*root, cx.inlining_map, &mut reachable); + } + + let mut new_codegen_unit = CodegenUnit::new(old_codegen_unit.name()); + + // Add all monomorphizations that are not already there. + for mono_item in reachable { + if let Some(linkage) = old_codegen_unit.items().get(&mono_item) { + // This is a root, just copy it over. + new_codegen_unit.items_mut().insert(mono_item, *linkage); + } else { + if roots.contains(&mono_item) { + bug!( + "GloballyShared mono-item inlined into other CGU: \ + {:?}", + mono_item + ); + } + + // This is a CGU-private copy. + new_codegen_unit + .items_mut() + .insert(mono_item, (Linkage::Internal, Visibility::Default)); + } + + if !single_codegen_unit { + // If there is more than one codegen unit, we need to keep track + // in which codegen units each monomorphization is placed. + match mono_item_placements.entry(mono_item) { + Entry::Occupied(e) => { + let placement = e.into_mut(); + debug_assert!(match *placement { + MonoItemPlacement::SingleCgu { cgu_name } => { + cgu_name != new_codegen_unit.name() + } + MonoItemPlacement::MultipleCgus => true, + }); + *placement = MonoItemPlacement::MultipleCgus; + } + Entry::Vacant(e) => { + e.insert(MonoItemPlacement::SingleCgu { + cgu_name: new_codegen_unit.name(), + }); + } + } + } + } + + *old_codegen_unit = new_codegen_unit; + } + + return mono_item_placements; + + fn follow_inlining<'tcx>( + mono_item: MonoItem<'tcx>, + inlining_map: &InliningMap<'tcx>, + visited: &mut FxHashSet>, + ) { + if !visited.insert(mono_item) { + return; + } + + inlining_map.with_inlining_candidates(mono_item, |target| { + follow_inlining(target, inlining_map, visited); + }); + } +} + +fn internalize_symbols<'tcx>( + cx: &PartitioningCx<'_, 'tcx>, + codegen_units: &mut [CodegenUnit<'tcx>], + mono_item_placements: FxHashMap, MonoItemPlacement>, + internalization_candidates: FxHashSet>, +) { + if codegen_units.len() == 1 { + // Fast path for when there is only one codegen unit. In this case we + // can internalize all candidates, since there is nowhere else they + // could be accessed from. + for cgu in codegen_units { + for candidate in &internalization_candidates { + cgu.items_mut().insert(*candidate, (Linkage::Internal, Visibility::Default)); + } + } + + return; + } + + // Build a map from every monomorphization to all the monomorphizations that + // reference it. + let mut accessor_map: FxHashMap, Vec>> = Default::default(); + cx.inlining_map.iter_accesses(|accessor, accessees| { + for accessee in accessees { + accessor_map.entry(*accessee).or_default().push(accessor); + } + }); + + // For each internalization candidates in each codegen unit, check if it is + // accessed from outside its defining codegen unit. + for cgu in codegen_units { + let home_cgu = MonoItemPlacement::SingleCgu { cgu_name: cgu.name() }; + + for (accessee, linkage_and_visibility) in cgu.items_mut() { + if !internalization_candidates.contains(accessee) { + // This item is no candidate for internalizing, so skip it. + continue; + } + debug_assert_eq!(mono_item_placements[accessee], home_cgu); + + if let Some(accessors) = accessor_map.get(accessee) { + if accessors + .iter() + .filter_map(|accessor| { + // Some accessors might not have been + // instantiated. We can safely ignore those. + mono_item_placements.get(accessor) + }) + .any(|placement| *placement != home_cgu) + { + // Found an accessor from another CGU, so skip to the next + // item without marking this one as internal. + continue; + } + } + + // If we got here, we did not find any accesses from other CGUs, + // so it's fine to make this monomorphization internal. + *linkage_and_visibility = (Linkage::Internal, Visibility::Default); + } + } +} + +fn characteristic_def_id_of_mono_item<'tcx>( + tcx: TyCtxt<'tcx>, + mono_item: MonoItem<'tcx>, +) -> Option { + match mono_item { + MonoItem::Fn(instance) => { + let def_id = match instance.def { + ty::InstanceDef::Item(def) => def, + ty::InstanceDef::VTableShim(..) + | ty::InstanceDef::ReifyShim(..) + | ty::InstanceDef::FnPtrShim(..) + | ty::InstanceDef::ClosureOnceShim { .. } + | ty::InstanceDef::Intrinsic(..) + | ty::InstanceDef::DropGlue(..) + | ty::InstanceDef::Virtual(..) + | ty::InstanceDef::CloneShim(..) + | ty::InstanceDef::ThreadLocalShim(..) + | ty::InstanceDef::FnPtrAddrShim(..) => return None, + }; + + // If this is a method, we want to put it into the same module as + // its self-type. If the self-type does not provide a characteristic + // DefId, we use the location of the impl after all. + + if tcx.trait_of_item(def_id).is_some() { + let self_ty = instance.substs.type_at(0); + // This is a default implementation of a trait method. + return characteristic_def_id_of_type(self_ty).or(Some(def_id)); + } + + if let Some(impl_def_id) = tcx.impl_of_method(def_id) { + if tcx.sess.opts.incremental.is_some() + && tcx.trait_id_of_impl(impl_def_id) == tcx.lang_items().drop_trait() + { + // Put `Drop::drop` into the same cgu as `drop_in_place` + // since `drop_in_place` is the only thing that can + // call it. + return None; + } + + // When polymorphization is enabled, methods which do not depend on their generic + // parameters, but the self-type of their impl block do will fail to normalize. + if !tcx.sess.opts.unstable_opts.polymorphize || !instance.has_param() { + // This is a method within an impl, find out what the self-type is: + let impl_self_ty = tcx.subst_and_normalize_erasing_regions( + instance.substs, + ty::ParamEnv::reveal_all(), + tcx.type_of(impl_def_id), + ); + if let Some(def_id) = characteristic_def_id_of_type(impl_self_ty) { + return Some(def_id); + } + } + } + + Some(def_id) + } + MonoItem::Static(def_id) => Some(def_id), + MonoItem::GlobalAsm(item_id) => Some(item_id.owner_id.to_def_id()), + } +} + +fn compute_codegen_unit_name( + tcx: TyCtxt<'_>, + name_builder: &mut CodegenUnitNameBuilder<'_>, + def_id: DefId, + volatile: bool, + cache: &mut CguNameCache, +) -> Symbol { + // Find the innermost module that is not nested within a function. + let mut current_def_id = def_id; + let mut cgu_def_id = None; + // Walk backwards from the item we want to find the module for. + loop { + if current_def_id.is_crate_root() { + if cgu_def_id.is_none() { + // If we have not found a module yet, take the crate root. + cgu_def_id = Some(def_id.krate.as_def_id()); + } + break; + } else if tcx.def_kind(current_def_id) == DefKind::Mod { + if cgu_def_id.is_none() { + cgu_def_id = Some(current_def_id); + } + } else { + // If we encounter something that is not a module, throw away + // any module that we've found so far because we now know that + // it is nested within something else. + cgu_def_id = None; + } + + current_def_id = tcx.parent(current_def_id); + } + + let cgu_def_id = cgu_def_id.unwrap(); + + *cache.entry((cgu_def_id, volatile)).or_insert_with(|| { + let def_path = tcx.def_path(cgu_def_id); + + let components = def_path.data.iter().map(|part| match part.data.name() { + DefPathDataName::Named(name) => name, + DefPathDataName::Anon { .. } => unreachable!(), + }); + + let volatile_suffix = volatile.then_some("volatile"); + + name_builder.build_cgu_name(def_path.krate, components, volatile_suffix) + }) +} + +// Anything we can't find a proper codegen unit for goes into this. +fn fallback_cgu_name(name_builder: &mut CodegenUnitNameBuilder<'_>) -> Symbol { + name_builder.build_cgu_name(LOCAL_CRATE, &["fallback"], Some("cgu")) +} + +fn mono_item_linkage_and_visibility<'tcx>( + tcx: TyCtxt<'tcx>, + mono_item: &MonoItem<'tcx>, + can_be_internalized: &mut bool, + export_generics: bool, +) -> (Linkage, Visibility) { + if let Some(explicit_linkage) = mono_item.explicit_linkage(tcx) { + return (explicit_linkage, Visibility::Default); + } + let vis = mono_item_visibility(tcx, mono_item, can_be_internalized, export_generics); + (Linkage::External, vis) +} + +type CguNameCache = FxHashMap<(DefId, bool), Symbol>; + +fn static_visibility<'tcx>( + tcx: TyCtxt<'tcx>, + can_be_internalized: &mut bool, + def_id: DefId, +) -> Visibility { + if tcx.is_reachable_non_generic(def_id) { + *can_be_internalized = false; + default_visibility(tcx, def_id, false) + } else { + Visibility::Hidden + } +} + +fn mono_item_visibility<'tcx>( + tcx: TyCtxt<'tcx>, + mono_item: &MonoItem<'tcx>, + can_be_internalized: &mut bool, + export_generics: bool, +) -> Visibility { + let instance = match mono_item { + // This is pretty complicated; see below. + MonoItem::Fn(instance) => instance, + + // Misc handling for generics and such, but otherwise: + MonoItem::Static(def_id) => return static_visibility(tcx, can_be_internalized, *def_id), + MonoItem::GlobalAsm(item_id) => { + return static_visibility(tcx, can_be_internalized, item_id.owner_id.to_def_id()); + } + }; + + let def_id = match instance.def { + InstanceDef::Item(def_id) | InstanceDef::DropGlue(def_id, Some(_)) => def_id, + + // We match the visibility of statics here + InstanceDef::ThreadLocalShim(def_id) => { + return static_visibility(tcx, can_be_internalized, def_id); + } + + // These are all compiler glue and such, never exported, always hidden. + InstanceDef::VTableShim(..) + | InstanceDef::ReifyShim(..) + | InstanceDef::FnPtrShim(..) + | InstanceDef::Virtual(..) + | InstanceDef::Intrinsic(..) + | InstanceDef::ClosureOnceShim { .. } + | InstanceDef::DropGlue(..) + | InstanceDef::CloneShim(..) + | InstanceDef::FnPtrAddrShim(..) => return Visibility::Hidden, + }; + + // The `start_fn` lang item is actually a monomorphized instance of a + // function in the standard library, used for the `main` function. We don't + // want to export it so we tag it with `Hidden` visibility but this symbol + // is only referenced from the actual `main` symbol which we unfortunately + // don't know anything about during partitioning/collection. As a result we + // forcibly keep this symbol out of the `internalization_candidates` set. + // + // FIXME: eventually we don't want to always force this symbol to have + // hidden visibility, it should indeed be a candidate for + // internalization, but we have to understand that it's referenced + // from the `main` symbol we'll generate later. + // + // This may be fixable with a new `InstanceDef` perhaps? Unsure! + if tcx.lang_items().start_fn() == Some(def_id) { + *can_be_internalized = false; + return Visibility::Hidden; + } + + let is_generic = instance.substs.non_erasable_generics().next().is_some(); + + // Upstream `DefId` instances get different handling than local ones. + let Some(def_id) = def_id.as_local() else { + return if export_generics && is_generic { + // If it is an upstream monomorphization and we export generics, we must make + // it available to downstream crates. + *can_be_internalized = false; + default_visibility(tcx, def_id, true) + } else { + Visibility::Hidden + }; + }; + + if is_generic { + if export_generics { + if tcx.is_unreachable_local_definition(def_id) { + // This instance cannot be used from another crate. + Visibility::Hidden + } else { + // This instance might be useful in a downstream crate. + *can_be_internalized = false; + default_visibility(tcx, def_id.to_def_id(), true) + } + } else { + // We are not exporting generics or the definition is not reachable + // for downstream crates, we can internalize its instantiations. + Visibility::Hidden + } + } else { + // If this isn't a generic function then we mark this a `Default` if + // this is a reachable item, meaning that it's a symbol other crates may + // access when they link to us. + if tcx.is_reachable_non_generic(def_id.to_def_id()) { + *can_be_internalized = false; + debug_assert!(!is_generic); + return default_visibility(tcx, def_id.to_def_id(), false); + } + + // If this isn't reachable then we're gonna tag this with `Hidden` + // visibility. In some situations though we'll want to prevent this + // symbol from being internalized. + // + // There's two categories of items here: + // + // * First is weak lang items. These are basically mechanisms for + // libcore to forward-reference symbols defined later in crates like + // the standard library or `#[panic_handler]` definitions. The + // definition of these weak lang items needs to be referencable by + // libcore, so we're no longer a candidate for internalization. + // Removal of these functions can't be done by LLVM but rather must be + // done by the linker as it's a non-local decision. + // + // * Second is "std internal symbols". Currently this is primarily used + // for allocator symbols. Allocators are a little weird in their + // implementation, but the idea is that the compiler, at the last + // minute, defines an allocator with an injected object file. The + // `alloc` crate references these symbols (`__rust_alloc`) and the + // definition doesn't get hooked up until a linked crate artifact is + // generated. + // + // The symbols synthesized by the compiler (`__rust_alloc`) are thin + // veneers around the actual implementation, some other symbol which + // implements the same ABI. These symbols (things like `__rg_alloc`, + // `__rdl_alloc`, `__rde_alloc`, etc), are all tagged with "std + // internal symbols". + // + // The std-internal symbols here **should not show up in a dll as an + // exported interface**, so they return `false` from + // `is_reachable_non_generic` above and we'll give them `Hidden` + // visibility below. Like the weak lang items, though, we can't let + // LLVM internalize them as this decision is left up to the linker to + // omit them, so prevent them from being internalized. + let attrs = tcx.codegen_fn_attrs(def_id); + if attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL) { + *can_be_internalized = false; + } + + Visibility::Hidden + } +} + +fn default_visibility(tcx: TyCtxt<'_>, id: DefId, is_generic: bool) -> Visibility { + if !tcx.sess.target.default_hidden_visibility { + return Visibility::Default; + } + + // Generic functions never have export-level C. + if is_generic { + return Visibility::Hidden; + } + + // Things with export level C don't get instantiated in + // downstream crates. + if !id.is_local() { + return Visibility::Hidden; + } + + // C-export level items remain at `Default`, all other internal + // items become `Hidden`. + match tcx.reachable_non_generics(id.krate).get(&id) { + Some(SymbolExportInfo { level: SymbolExportLevel::C, .. }) => Visibility::Default, + _ => Visibility::Hidden, + } +} fn debug_dump<'a, 'tcx: 'a>(tcx: TyCtxt<'tcx>, label: &str, cgus: &[CodegenUnit<'tcx>]) { let dump = move || { use std::fmt::Write; From 5ed014977e59f886a51844fcae8eab80467e45e6 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 30 May 2023 17:41:35 +1000 Subject: [PATCH 14/16] Rename `partitioning/mod.rs` as `partitioning.rs`. Because it's now the only file within `compiler/rustc_monomorphize/src/partitioning/`. --- .../src/{partitioning/mod.rs => partitioning.rs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename compiler/rustc_monomorphize/src/{partitioning/mod.rs => partitioning.rs} (100%) diff --git a/compiler/rustc_monomorphize/src/partitioning/mod.rs b/compiler/rustc_monomorphize/src/partitioning.rs similarity index 100% rename from compiler/rustc_monomorphize/src/partitioning/mod.rs rename to compiler/rustc_monomorphize/src/partitioning.rs From e3a039d9ad96166bde62b2491ca4eec89ee6c005 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Mon, 29 May 2023 15:43:15 +0000 Subject: [PATCH 15/16] Better group RFC ui tests together --- .../ui/rfc-2005-default-binding-mode/enum.rs | 22 --------- tests/ui/rfc-2005-default-binding-mode/for.rs | 9 ---- tests/ui/rfc-2005-default-binding-mode/lit.rs | 24 ---------- .../ui/rfc-2005-default-binding-mode/slice.rs | 7 --- .../bind-by-move-no-guards.rs | 0 .../former-E0008-now-pass.rs | 0 .../rfc-basic-examples.rs | 0 .../rfc-reject-double-move-across-arms.rs | 0 .../rfc-reject-double-move-across-arms.stderr | 0 .../rfc-reject-double-move-in-first-arm.rs | 0 ...rfc-reject-double-move-in-first-arm.stderr | 0 .../rfc-1014-2.rs | 0 .../rfc-1014.rs | 0 ...-hide-behind-direct-unsafe-ptr-embedded.rs | 0 ...low-hide-behind-direct-unsafe-ptr-param.rs | 0 ...ide-behind-indirect-unsafe-ptr-embedded.rs | 0 ...w-hide-behind-indirect-unsafe-ptr-param.rs | 0 .../allow-use-behind-cousin-variant.rs | 0 ...cant-hide-behind-direct-struct-embedded.rs | 0 ...-hide-behind-direct-struct-embedded.stderr | 0 .../cant-hide-behind-direct-struct-param.rs | 0 ...ant-hide-behind-direct-struct-param.stderr | 0 ...nt-hide-behind-doubly-indirect-embedded.rs | 0 ...ide-behind-doubly-indirect-embedded.stderr | 0 .../cant-hide-behind-doubly-indirect-param.rs | 0 ...t-hide-behind-doubly-indirect-param.stderr | 0 ...nt-hide-behind-indirect-struct-embedded.rs | 0 ...ide-behind-indirect-struct-embedded.stderr | 0 .../cant-hide-behind-indirect-struct-param.rs | 0 ...t-hide-behind-indirect-struct-param.stderr | 0 .../feature-gate.no_gate.stderr | 0 .../feature-gate.rs | 0 .../feature-gate.with_gate.stderr | 0 .../fn-ptr-is-structurally-matchable.rs | 0 ...-61188-match-slice-forbidden-without-eq.rs | 0 ...88-match-slice-forbidden-without-eq.stderr | 0 ...2307-match-ref-ref-forbidden-without-eq.rs | 0 ...-match-ref-ref-forbidden-without-eq.stderr | 0 .../issue-63479-match-fnptr.rs | 0 .../issue-63479-match-fnptr.stderr | 0 .../issue-6804.rs | 0 .../issue-6804.stderr | 0 ...ty-array-allowed-without-eq-issue-62336.rs | 0 .../match-forbidden-without-eq.rs | 0 .../match-forbidden-without-eq.stderr | 0 ...tch-nonempty-array-forbidden-without-eq.rs | 0 ...nonempty-array-forbidden-without-eq.stderr | 0 .../match-requires-both-partialeq-and-eq.rs | 0 ...atch-requires-both-partialeq-and-eq.stderr | 0 .../phantom-data-is-structurally-matchable.rs | 0 .../rfc1445/eq-allows-match-on-ty-in-macro.rs | 0 .../rfc1445/eq-allows-match.rs | 0 .../rfcs/{ => rfc-1623-static}/rfc1623-2.rs | 0 .../{ => rfc-1623-static}/rfc1623-2.stderr | 0 .../rfcs/{ => rfc-1623-static}/rfc1623-3.rs | 0 .../{ => rfc-1623-static}/rfc1623-3.stderr | 0 .../ui/rfcs/{ => rfc-1623-static}/rfc1623.rs | 0 .../1717-dllimport}/library-override.rs | 0 .../rfc-1717-dllimport/missing-link-attr.rs | 0 .../missing-link-attr.stderr | 0 .../rfc-1717-dllimport/multiple-renames.rs | 0 .../multiple-renames.stderr | 0 .../rfc-1717-dllimport/rename-modifiers.rs | 0 .../rename-modifiers.stderr | 0 .../rfc-1717-dllimport/rename-to-empty.rs | 0 .../rfc-1717-dllimport/rename-to-empty.stderr | 0 .../drop-order.rs} | 0 .../issue-103052-1.rs | 0 .../issue-103052-1.stderr | 0 .../issue-103052-2.current.stderr | 0 .../issue-103052-2.next.stderr | 0 .../issue-103052-2.rs | 0 ...ermination-trait-for-box-dyn-error-err.rs} | 0 ...termination-trait-for-box-dyn-error-ok.rs} | 0 .../termination-trait-for-never.rs | 0 ...mination-trait-for-result-box-error_err.rs | 0 .../termination-trait-for-str-err.rs} | 0 ...str.rs => termination-trait-for-str-ok.rs} | 0 .../termination-trait-impl-trait.rs | 0 .../termination-trait-impl-trait.stderr | 0 .../termination-trait-in-test-should-panic.rs | 0 ...mination-trait-in-test-should-panic.stderr | 0 .../termination-trait-in-test.rs | 0 .../termination-trait-main-i32.rs | 0 .../termination-trait-main-i32.stderr | 0 .../termination-trait-main-wrong-type.rs | 0 .../termination-trait-main-wrong-type.stderr | 0 .../termination-trait-not-satisfied.rs | 0 .../termination-trait-not-satisfied.stderr | 0 .../termination-trait-test-wrong-type.rs | 0 .../termination-trait-test-wrong-type.stderr | 0 .../borrowck-issue-49631.rs | 0 .../borrowck-issue-49631.stderr | 0 .../rfc-2005-default-binding-mode/const.rs | 0 .../const.stderr | 0 .../rfc-2005-default-binding-mode/enum-ok.rs | 45 +++++++++++++++++++ .../rfc-2005-default-binding-mode/enum.rs | 29 ++---------- .../rfc-2005-default-binding-mode/enum.stderr | 0 .../explicit-mut.rs | 0 .../explicit-mut.stderr | 0 .../rfc-2005-default-binding-mode/for-ok.rs | 20 +++++++++ .../rfcs/rfc-2005-default-binding-mode/for.rs | 23 +++------- .../rfc-2005-default-binding-mode/for.stderr | 0 .../issue-44912-or.rs | 0 .../issue-44912-or.stderr | 0 .../rfc-2005-default-binding-mode/lit-ok.rs | 34 ++++++++++++++ .../rfcs/rfc-2005-default-binding-mode/lit.rs | 26 ++++------- .../rfc-2005-default-binding-mode/lit.stderr | 0 .../no-double-error.rs | 0 .../no-double-error.stderr | 0 .../rfc-2005-default-binding-mode/slice-ok.rs | 25 +++++++++++ .../rfc-2005-default-binding-mode/slice.rs | 26 ++--------- .../slice.stderr | 0 .../auxiliary/enums.rs | 0 .../auxiliary/monovariants.rs | 0 .../auxiliary/structs.rs | 0 .../auxiliary/unstable.rs | 0 .../auxiliary/variants.rs | 0 .../borrowck-exhaustive.rs | 0 .../borrowck-non-exhaustive.rs | 0 .../borrowck-non-exhaustive.stderr | 0 .../rfc-2008-non-exhaustive/enum-as-cast.rs | 0 .../enum-as-cast.stderr | 0 .../rfc-2008-non-exhaustive/enum.rs | 0 .../rfc-2008-non-exhaustive/enum.stderr | 0 .../enum_same_crate.rs | 0 .../enum_same_crate_empty_match.rs | 0 .../enum_same_crate_empty_match.stderr | 0 .../improper_ctypes/auxiliary/types.rs | 0 .../improper_ctypes/extern_crate_improper.rs | 0 .../extern_crate_improper.stderr | 0 .../improper_ctypes/same_crate_proper.rs | 0 .../invalid-attribute.rs | 0 .../invalid-attribute.stderr | 0 .../omitted-patterns.rs | 0 .../omitted-patterns.stderr | 0 .../stable-omitted-patterns.rs | 0 .../stable-omitted-patterns.stderr | 0 .../rfc-2008-non-exhaustive/struct.rs | 0 .../rfc-2008-non-exhaustive/struct.stderr | 0 .../structs_same_crate.rs | 0 .../uninhabited/auxiliary/uninhabited.rs | 0 .../uninhabited/coercions.rs | 0 .../uninhabited/coercions.stderr | 0 .../uninhabited/coercions_same_crate.rs | 0 .../uninhabited/coercions_same_crate.stderr | 0 .../uninhabited/indirect_match.rs | 0 .../uninhabited/indirect_match.stderr | 0 .../uninhabited/indirect_match_same_crate.rs | 0 .../indirect_match_same_crate.stderr | 0 ...indirect_match_with_exhaustive_patterns.rs | 0 ...rect_match_with_exhaustive_patterns.stderr | 0 ...tch_with_exhaustive_patterns_same_crate.rs | 0 .../issue-65157-repeated-match-arm.rs | 0 .../issue-65157-repeated-match-arm.stderr | 0 .../uninhabited/match.rs | 0 .../uninhabited/match.stderr | 0 .../uninhabited/match_same_crate.rs | 0 .../uninhabited/match_same_crate.stderr | 0 .../match_with_exhaustive_patterns.rs | 0 .../match_with_exhaustive_patterns.stderr | 0 ...tch_with_exhaustive_patterns_same_crate.rs | 0 .../uninhabited/patterns.rs | 0 .../uninhabited/patterns_same_crate.rs | 0 .../uninhabited/patterns_same_crate.stderr | 0 .../rfc-2008-non-exhaustive/variant.rs | 0 .../rfc-2008-non-exhaustive/variant.stderr | 0 .../variants_fictive_visibility.rs | 0 .../variants_same_crate.rs | 0 .../downcast-unsafe-trait-objects.rs | 0 .../manual-self-impl-for-unsafe-obj.rs | 0 .../static-dispatch-unsafe-object.rs | 0 .../rfc-2091-track-caller/call-chain.rs | 0 .../caller-location-fnptr-rt-ctfe-equiv.rs | 0 ...caller-location-fnptr-rt-ctfe-equiv.stderr | 0 .../caller-location-intrinsic.rs | 0 .../const-caller-location.rs | 0 .../diverging-caller-location.rs | 0 .../rfc-2091-track-caller/error-odd-syntax.rs | 0 .../error-odd-syntax.stderr | 0 .../error-with-invalid-abi.rs | 0 .../error-with-invalid-abi.stderr | 0 .../rfc-2091-track-caller/error-with-main.rs | 0 .../error-with-main.stderr | 0 .../rfc-2091-track-caller/error-with-naked.rs | 0 .../error-with-naked.stderr | 0 .../rfc-2091-track-caller/error-with-start.rs | 0 .../error-with-start.stderr | 0 .../intrinsic-wrapper.rs | 0 .../macro-declaration.rs | 0 .../mir-inlined-macro.rs | 0 .../rfc-2091-track-caller/only-for-fns.rs | 0 .../rfc-2091-track-caller/only-for-fns.stderr | 0 .../{ => rfcs}/rfc-2091-track-caller/pass.rs | 0 .../std-panic-locations.rs | 0 .../track-caller-attribute.rs | 0 .../rfc-2091-track-caller/track-caller-ffi.rs | 0 .../rfc-2091-track-caller/tracked-closure.rs | 0 .../tracked-fn-ptr-with-arg.rs | 0 .../rfc-2091-track-caller/tracked-fn-ptr.rs | 0 .../tracked-trait-impls.rs | 0 .../tracked-trait-obj.rs | 0 .../rfc-2093-infer-outlives/cross-crate.rs | 0 .../cross-crate.stderr | 0 .../dont-infer-static.rs | 0 .../dont-infer-static.stderr | 0 .../rfc-2093-infer-outlives/enum.rs | 0 .../rfc-2093-infer-outlives/enum.stderr | 0 .../rfc-2093-infer-outlives/explicit-dyn.rs | 0 .../explicit-dyn.stderr | 0 .../rfc-2093-infer-outlives/explicit-enum.rs | 0 .../explicit-enum.stderr | 0 .../explicit-projection.rs | 0 .../explicit-projection.stderr | 0 .../explicit-struct.rs | 0 .../explicit-struct.stderr | 0 .../rfc-2093-infer-outlives/explicit-union.rs | 0 .../explicit-union.stderr | 0 .../rfc-2093-infer-outlives/issue-54467.rs | 0 .../rfc-2093-infer-outlives/nested-enum.rs | 0 .../nested-enum.stderr | 0 .../rfc-2093-infer-outlives/nested-regions.rs | 0 .../nested-regions.stderr | 0 .../rfc-2093-infer-outlives/nested-structs.rs | 0 .../nested-structs.stderr | 0 .../rfc-2093-infer-outlives/nested-union.rs | 0 .../nested-union.stderr | 0 .../rfc-2093-infer-outlives/privacy.rs | 0 .../rfc-2093-infer-outlives/projection.rs | 0 .../rfc-2093-infer-outlives/projection.stderr | 0 .../rfc-2093-infer-outlives/reference.rs | 0 .../rfc-2093-infer-outlives/reference.stderr | 0 .../regions-enum-not-wf.rs | 0 .../regions-enum-not-wf.stderr | 0 ...egions-outlives-nominal-type-region-rev.rs | 0 ...ns-outlives-nominal-type-region-rev.stderr | 0 .../regions-outlives-nominal-type-region.rs | 0 ...egions-outlives-nominal-type-region.stderr | 0 .../regions-outlives-nominal-type-type-rev.rs | 0 ...ions-outlives-nominal-type-type-rev.stderr | 0 .../regions-outlives-nominal-type-type.rs | 0 .../regions-outlives-nominal-type-type.stderr | 0 .../regions-struct-not-wf.rs | 0 .../regions-struct-not-wf.stderr | 0 .../rfc-2093-infer-outlives/self-dyn.rs | 0 .../rfc-2093-infer-outlives/self-dyn.stderr | 0 .../rfc-2093-infer-outlives/self-structs.rs | 0 .../self-structs.stderr | 0 .../crate-path-non-absolute.rs | 0 .../crate-path-non-absolute.stderr | 0 .../keyword-crate-as-identifier.rs | 0 .../keyword-crate-as-identifier.stderr | 0 .../auxiliary/xcrate.rs | 0 .../non-existent-1.rs | 0 .../non-existent-1.stderr | 0 .../non-existent-2.rs | 0 .../non-existent-2.stderr | 0 .../non-existent-3.rs | 0 .../non-existent-3.stderr | 0 .../not-allowed.rs | 0 .../not-allowed.stderr | 0 .../single-segment.rs | 0 .../single-segment.stderr | 0 .../rfc-2294-if-let-guard/bindings.rs | 0 .../rfc-2294-if-let-guard/bindings.stderr | 0 .../rfc-2294-if-let-guard/feature-gate.rs | 0 .../rfc-2294-if-let-guard/feature-gate.stderr | 0 .../rfc-2294-if-let-guard/run-pass.rs | 0 .../rfc-2294-if-let-guard/typeck.rs | 0 .../rfc-2294-if-let-guard/typeck.stderr | 0 .../{ => rfcs}/rfc-2294-if-let-guard/warns.rs | 0 .../rfc-2294-if-let-guard/warns.stderr | 0 .../rfc-2302-self-struct-ctor.rs | 0 .../convert-id-const-with-gate.rs | 0 .../dbg-macro-expected-behavior.rs | 0 .../dbg-macro-expected-behavior.run.stderr | 0 .../dbg-macro-move-semantics.rs | 0 .../dbg-macro-move-semantics.stderr | 0 .../dbg-macro-requires-debug.rs | 0 .../dbg-macro-requires-debug.stderr | 0 .../feature-gate-do_not_recommend.rs | 0 .../feature-gate-do_not_recommend.stderr | 0 .../incorrect-locations.rs | 0 .../incorrect-locations.stderr | 0 .../unstable-feature.rs | 0 .../unstable-feature.stderr | 0 ...gnof-sizeof-pure-can-be-used-as-idents.rs} | 0 ...mod_file_nonascii_with_path_allowed-aux.rs | 0 .../crate_name_nonascii_forbidden-1.rs | 0 .../crate_name_nonascii_forbidden-1.stderr | 0 .../crate_name_nonascii_forbidden-2.rs | 0 .../crate_name_nonascii_forbidden-2.stderr | 0 .../extern_block_nonascii_forbidden.rs | 0 .../extern_block_nonascii_forbidden.stderr | 0 .../idents-normalized.rs | 0 .../mod_file_nonascii_forbidden.rs | 0 .../mod_file_nonascii_forbidden.stderr | 0 .../mod_file_nonascii_with_path_allowed.rs | 0 .../mod_inline_nonascii_allowed.rs | 0 .../no_mangle_nonascii_forbidden.rs | 0 .../no_mangle_nonascii_forbidden.stderr | 0 .../ast-lowering-does-not-wrap-let-chains.rs | 0 .../ast-pretty-check.rs | 0 .../ast-pretty-check.stdout | 0 .../ast-validate-guards.rs | 0 .../ast-validate-guards.stderr | 0 .../chains-without-let.rs | 0 .../chains-without-let.stderr | 0 .../disallowed-positions.rs | 0 .../disallowed-positions.stderr | 0 ...-else-does-not-interact-with-let-chains.rs | 0 ...e-does-not-interact-with-let-chains.stderr | 0 .../rfc-2497-if-let-chains/feature-gate.rs | 0 .../feature-gate.stderr | 0 .../invalid-let-in-a-valid-let-context.rs | 0 .../invalid-let-in-a-valid-let-context.stderr | 0 .../irrefutable-lets.disallowed.stderr | 0 .../irrefutable-lets.rs | 0 .../rfc-2497-if-let-chains/issue-88498.rs | 0 .../rfc-2497-if-let-chains/issue-90722.rs | 0 .../rfc-2497-if-let-chains/issue-92145.rs | 0 .../rfc-2497-if-let-chains/issue-93150.rs | 0 .../rfc-2497-if-let-chains/issue-93150.stderr | 0 .../rfc-2497-if-let-chains/issue-99938.rs | 0 .../no-double-assigments.rs | 0 .../protect-precedences.rs | 0 .../protect-precedences.stderr | 0 .../then-else-blocks.rs | 0 .../attr-without-param.rs | 0 .../attr-without-param.stderr | 0 .../auxiliary/ident-mac.rs | 0 .../auxiliary/param-attrs.rs | 0 ...-64682-dropping-first-attrs-in-impl-fns.rs | 0 .../rfc-2565-param-attrs/param-attrs-2018.rs | 0 .../param-attrs-2018.stderr | 0 .../param-attrs-allowed.rs | 0 .../param-attrs-builtin-attrs.rs | 0 .../param-attrs-builtin-attrs.stderr | 0 .../rfc-2565-param-attrs/param-attrs-cfg.rs | 0 .../param-attrs-cfg.stderr | 0 .../param-attrs-pretty.rs | 0 .../proc-macro-cannot-be-used.rs | 0 .../proc-macro-cannot-be-used.stderr | 0 .../rfc-2627-raw-dylib/dlltool-failed.rs | 0 .../rfc-2627-raw-dylib/dlltool-failed.stderr | 0 .../import-name-type-invalid-format.rs | 0 .../import-name-type-invalid-format.stderr | 0 .../import-name-type-multiple.rs | 0 .../import-name-type-multiple.stderr | 0 .../import-name-type-unknown-value.rs | 0 .../import-name-type-unknown-value.stderr | 0 .../import-name-type-unsupported-link-kind.rs | 0 ...ort-name-type-unsupported-link-kind.stderr | 0 .../import-name-type-x86-only.rs | 0 .../import-name-type-x86-only.stderr | 0 .../rfc-2627-raw-dylib/invalid-dlltool.rs | 0 .../rfc-2627-raw-dylib/invalid-dlltool.stderr | 0 .../link-ordinal-and-name.rs | 0 .../link-ordinal-and-name.stderr | 0 .../link-ordinal-invalid-format.rs | 0 .../link-ordinal-invalid-format.stderr | 0 .../link-ordinal-missing-argument.rs | 0 .../link-ordinal-missing-argument.stderr | 0 .../link-ordinal-multiple.rs | 0 .../link-ordinal-multiple.stderr | 0 .../link-ordinal-not-foreign-fn.rs | 0 .../link-ordinal-not-foreign-fn.stderr | 0 .../link-ordinal-too-large.rs | 0 .../link-ordinal-too-large.stderr | 0 .../link-ordinal-too-many-arguments.rs | 0 .../link-ordinal-too-many-arguments.stderr | 0 .../link-ordinal-unsupported-link-kind.rs | 0 .../link-ordinal-unsupported-link-kind.stderr | 0 .../multiple-declarations.rs | 0 .../multiple-declarations.stderr | 0 .../raw-dylib-windows-only.rs | 0 .../raw-dylib-windows-only.stderr | 0 .../rfc-2627-raw-dylib/unsupported-abi.rs | 0 .../rfc-2627-raw-dylib/unsupported-abi.stderr | 0 .../assoc-type-const-bound-usage.rs | 0 .../rfc-2632-const-trait-impl/assoc-type.rs | 0 .../assoc-type.stderr | 0 .../rfc-2632-const-trait-impl/attr-misuse.rs | 0 .../attr-misuse.stderr | 0 .../auxiliary/cross-crate.rs | 0 .../auxiliary/staged-api.rs | 0 .../call-const-trait-method-fail.rs | 0 .../call-const-trait-method-fail.stderr | 0 .../call-const-trait-method-pass.rs | 0 .../call-const-trait-method-pass.stderr | 0 .../call-generic-in-impl.rs | 0 .../call-generic-in-impl.stderr | 0 .../call-generic-method-chain.rs | 0 .../call-generic-method-chain.stderr | 0 .../call-generic-method-dup-bound.rs | 0 .../call-generic-method-dup-bound.stderr | 0 .../call-generic-method-fail.rs | 0 .../call-generic-method-fail.stderr | 0 .../call-generic-method-nonconst-bound.rs | 0 .../call-generic-method-nonconst.rs | 0 .../call-generic-method-nonconst.stderr | 0 .../call-generic-method-pass.rs | 0 .../call-generic-method-pass.stderr | 0 .../rfc-2632-const-trait-impl/call.rs | 0 .../const-and-non-const-impl.rs | 0 .../const-and-non-const-impl.stderr | 0 .../const-check-fns-in-const-impl.rs | 0 .../const-check-fns-in-const-impl.stderr | 0 .../const-closure-parse-not-item.rs | 0 .../const-closure-trait-method-fail.rs | 0 .../const-closure-trait-method-fail.stderr | 0 .../const-closure-trait-method.rs | 0 .../const-closures.rs | 0 .../const-default-method-bodies.rs | 0 .../const-default-method-bodies.stderr | 0 .../const-drop-bound.rs | 0 .../const-drop-fail-2.precise.stderr | 0 .../const-drop-fail-2.rs | 0 .../const-drop-fail-2.stderr | 0 .../const-drop-fail-2.stock.stderr | 0 .../const-drop-fail.precise.stderr | 0 .../const-drop-fail.rs | 0 .../const-drop-fail.stock.stderr | 0 .../rfc-2632-const-trait-impl/const-drop.rs | 0 .../const-impl-norecover.rs | 0 .../const-impl-norecover.stderr | 0 .../const-impl-recovery.rs | 0 .../const-impl-recovery.stderr | 0 .../const-impl-requires-const-trait.rs | 0 .../const-impl-requires-const-trait.stderr | 0 .../const-impl-trait.rs | 0 .../const-impl-trait.stderr | 0 .../const_derives/derive-const-gate.rs | 0 .../const_derives/derive-const-gate.stderr | 0 .../derive-const-non-const-type.rs | 0 .../derive-const-non-const-type.stderr | 0 .../const_derives/derive-const-use.rs | 0 .../const_derives/derive-const-use.stderr | 0 .../const_derives/derive-const-with-params.rs | 0 .../derive-const-with-params.stderr | 0 ...ross-crate-default-method-body-is-const.rs | 0 .../cross-crate.gatednc.stderr | 0 .../rfc-2632-const-trait-impl/cross-crate.rs | 0 .../cross-crate.stock.stderr | 0 .../cross-crate.stocknc.stderr | 0 ...ault-method-body-is-const-body-checking.rs | 0 ...-method-body-is-const-body-checking.stderr | 0 ...ault-method-body-is-const-same-trait-ck.rs | 0 ...-method-body-is-const-same-trait-ck.stderr | 0 ...lt-method-body-is-const-with-staged-api.rs | 0 .../do-not-const-check-override.rs | 0 .../do-not-const-check.rs | 0 .../feature-gate.gated.stderr | 0 .../rfc-2632-const-trait-impl/feature-gate.rs | 0 .../feature-gate.stock.stderr | 0 ...function-pointer-does-not-require-const.rs | 0 .../rfc-2632-const-trait-impl/gate.rs | 0 .../rfc-2632-const-trait-impl/gate.stderr | 0 .../generic-bound.rs | 0 .../generic-bound.stderr | 0 .../hir-const-check.rs | 0 .../hir-const-check.stderr | 0 .../impl-tilde-const-trait.rs | 0 .../impl-tilde-const-trait.stderr | 0 .../impl-with-default-fn-fail.rs | 0 .../impl-with-default-fn-fail.stderr | 0 .../impl-with-default-fn-pass.rs | 0 .../inherent-impl-const-bounds.rs | 0 .../inherent-impl.rs | 0 .../inherent-impl.stderr | 0 .../rfc-2632-const-trait-impl/issue-100222.rs | 0 .../rfc-2632-const-trait-impl/issue-102156.rs | 0 .../issue-102156.stderr | 0 .../rfc-2632-const-trait-impl/issue-102985.rs | 0 .../issue-102985.stderr | 0 .../rfc-2632-const-trait-impl/issue-103677.rs | 0 .../rfc-2632-const-trait-impl/issue-79450.rs | 0 .../issue-79450.stderr | 0 .../rfc-2632-const-trait-impl/issue-88155.rs | 0 .../issue-88155.stderr | 0 .../rfc-2632-const-trait-impl/issue-90052.rs | 0 .../issue-90052.stderr | 0 .../rfc-2632-const-trait-impl/issue-92111.rs | 0 .../issue-92230-wf-super-trait-env.rs | 0 .../nested-closure.rs | 0 ...-const-op-const-closure-non-const-outer.rs | 0 ...st-op-const-closure-non-const-outer.stderr | 0 .../non-const-op-in-closure-in-const.rs | 0 .../non-const-op-in-closure-in-const.stderr | 0 ...fault-bound-non-const-specialized-bound.rs | 0 ...t-bound-non-const-specialized-bound.stderr | 0 .../const-default-const-specialized.rs | 0 ...default-impl-non-const-specialized-impl.rs | 0 ...ult-impl-non-const-specialized-impl.stderr | 0 .../specialization/default-keyword.rs | 0 .../issue-95186-specialize-on-tilde-const.rs | 0 ...87-same-trait-bound-different-constness.rs | 0 .../non-const-default-const-specialized.rs | 0 .../specializing-constness-2.rs | 0 .../specializing-constness-2.stderr | 0 .../specializing-constness.rs | 0 .../specializing-constness.stderr | 0 .../staged-api-user-crate.rs | 0 .../staged-api-user-crate.stderr | 0 .../rfc-2632-const-trait-impl/staged-api.rs | 0 .../staged-api.stable.stderr | 0 .../staged-api.unstable.stderr | 0 .../static-const-trait-bound.rs | 0 .../std-impl-gate.gated.stderr | 0 .../std-impl-gate.rs | 0 .../std-impl-gate.stock.stderr | 0 .../super-traits-fail-2.nn.stderr | 0 .../super-traits-fail-2.ny.stderr | 0 .../super-traits-fail-2.rs | 0 .../super-traits-fail-2.yn.stderr | 0 .../super-traits-fail-2.yy.stderr | 0 .../super-traits-fail-3.nn.stderr | 0 .../super-traits-fail-3.ny.stderr | 0 .../super-traits-fail-3.rs | 0 .../super-traits-fail-3.yn.stderr | 0 .../super-traits-fail.rs | 0 .../super-traits-fail.stderr | 0 .../rfc-2632-const-trait-impl/super-traits.rs | 0 .../rfc-2632-const-trait-impl/syntax.rs | 0 .../tilde-const-and-const-params.rs | 0 .../tilde-const-and-const-params.stderr | 0 .../tilde-const-invalid-places.rs | 0 .../tilde-const-invalid-places.stderr | 0 .../tilde-const-syntax.rs | 0 .../rfc-2632-const-trait-impl/tilde-twice.rs | 0 .../tilde-twice.stderr | 0 .../tilde_const_on_impl_bound.rs | 0 .../trait-default-body-stability.rs | 0 .../trait-default-body-stability.stderr | 0 .../trait-method-ptr-in-consts-ice.rs | 0 .../trait-where-clause-const.rs | 0 .../trait-where-clause-const.stderr | 0 .../trait-where-clause-run.rs | 0 .../trait-where-clause-self-referential.rs | 0 .../trait-where-clause.rs | 0 .../trait-where-clause.stderr | 0 .../without-tilde.rs | 0 .../without-tilde.stderr | 0 543 files changed, 145 insertions(+), 145 deletions(-) delete mode 100644 tests/ui/rfc-2005-default-binding-mode/enum.rs delete mode 100644 tests/ui/rfc-2005-default-binding-mode/for.rs delete mode 100644 tests/ui/rfc-2005-default-binding-mode/lit.rs delete mode 100644 tests/ui/rfc-2005-default-binding-mode/slice.rs rename tests/ui/{ => rfcs}/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs (100%) rename tests/ui/{ => rfcs}/rfc-0107-bind-by-move-pattern-guards/former-E0008-now-pass.rs (100%) rename tests/ui/{ => rfcs}/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs (100%) rename tests/ui/{ => rfcs}/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs (100%) rename tests/ui/{ => rfcs}/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.stderr (100%) rename tests/ui/{ => rfcs}/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.rs (100%) rename tests/ui/{ => rfcs}/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.stderr (100%) rename tests/ui/rfcs/{ => rfc-1014-stdout-existential-crisis}/rfc-1014-2.rs (100%) rename tests/ui/rfcs/{ => rfc-1014-stdout-existential-crisis}/rfc-1014.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/allow-use-behind-cousin-variant.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/feature-gate.no_gate.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/feature-gate.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/feature-gate.with_gate.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/fn-ptr-is-structurally-matchable.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/issue-6804.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/issue-6804.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/match-empty-array-allowed-without-eq-issue-62336.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.rs (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1445-restrict-constants-in-patterns/phantom-data-is-structurally-matchable.rs (100%) rename tests/ui/rfcs/{ => rfc-1445-restrict-constants-in-patterns}/rfc1445/eq-allows-match-on-ty-in-macro.rs (100%) rename tests/ui/rfcs/{ => rfc-1445-restrict-constants-in-patterns}/rfc1445/eq-allows-match.rs (100%) rename tests/ui/rfcs/{ => rfc-1623-static}/rfc1623-2.rs (100%) rename tests/ui/rfcs/{ => rfc-1623-static}/rfc1623-2.stderr (100%) rename tests/ui/rfcs/{ => rfc-1623-static}/rfc1623-3.rs (100%) rename tests/ui/rfcs/{ => rfc-1623-static}/rfc1623-3.stderr (100%) rename tests/ui/rfcs/{ => rfc-1623-static}/rfc1623.rs (100%) rename tests/ui/rfcs/{rfc1717 => rfc-1717-dllimport/1717-dllimport}/library-override.rs (100%) rename tests/ui/{ => rfcs}/rfc-1717-dllimport/missing-link-attr.rs (100%) rename tests/ui/{ => rfcs}/rfc-1717-dllimport/missing-link-attr.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1717-dllimport/multiple-renames.rs (100%) rename tests/ui/{ => rfcs}/rfc-1717-dllimport/multiple-renames.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1717-dllimport/rename-modifiers.rs (100%) rename tests/ui/{ => rfcs}/rfc-1717-dllimport/rename-modifiers.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1717-dllimport/rename-to-empty.rs (100%) rename tests/ui/{ => rfcs}/rfc-1717-dllimport/rename-to-empty.stderr (100%) rename tests/ui/rfcs/{rfc1857-drop-order.rs => rfc-1857-stabilize-drop-order/drop-order.rs} (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/issue-103052-1.rs (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/issue-103052-1.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/issue-103052-2.current.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/issue-103052-2.next.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/issue-103052-2.rs (100%) rename tests/ui/{rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs => rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-err.rs} (100%) rename tests/ui/rfcs/rfc-1937-termination-trait/{termination-trait-for-box-dyn-error.rs => termination-trait-for-box-dyn-error-ok.rs} (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/termination-trait-for-never.rs (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs (100%) rename tests/ui/{rfc-1937-termination-trait/termination-trait-for-str.rs => rfcs/rfc-1937-termination-trait/termination-trait-for-str-err.rs} (100%) rename tests/ui/rfcs/rfc-1937-termination-trait/{termination-trait-for-str.rs => termination-trait-for-str-ok.rs} (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/termination-trait-impl-trait.rs (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/termination-trait-impl-trait.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/termination-trait-in-test-should-panic.rs (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/termination-trait-in-test-should-panic.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/termination-trait-in-test.rs (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/termination-trait-main-i32.rs (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/termination-trait-main-i32.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/termination-trait-main-wrong-type.rs (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/termination-trait-main-wrong-type.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/termination-trait-not-satisfied.rs (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs (100%) rename tests/ui/{ => rfcs}/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2005-default-binding-mode/borrowck-issue-49631.rs (100%) rename tests/ui/{ => rfcs}/rfc-2005-default-binding-mode/borrowck-issue-49631.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2005-default-binding-mode/const.rs (100%) rename tests/ui/{ => rfcs}/rfc-2005-default-binding-mode/const.stderr (100%) create mode 100644 tests/ui/rfcs/rfc-2005-default-binding-mode/enum-ok.rs rename tests/ui/{ => rfcs}/rfc-2005-default-binding-mode/enum.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2005-default-binding-mode/explicit-mut.rs (100%) rename tests/ui/{ => rfcs}/rfc-2005-default-binding-mode/explicit-mut.stderr (100%) create mode 100644 tests/ui/rfcs/rfc-2005-default-binding-mode/for-ok.rs rename tests/ui/{ => rfcs}/rfc-2005-default-binding-mode/for.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2005-default-binding-mode/issue-44912-or.rs (100%) rename tests/ui/{ => rfcs}/rfc-2005-default-binding-mode/issue-44912-or.stderr (100%) create mode 100644 tests/ui/rfcs/rfc-2005-default-binding-mode/lit-ok.rs rename tests/ui/{ => rfcs}/rfc-2005-default-binding-mode/lit.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2005-default-binding-mode/no-double-error.rs (100%) rename tests/ui/{ => rfcs}/rfc-2005-default-binding-mode/no-double-error.stderr (100%) create mode 100644 tests/ui/rfcs/rfc-2005-default-binding-mode/slice-ok.rs rename tests/ui/{ => rfcs}/rfc-2005-default-binding-mode/slice.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/auxiliary/enums.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/auxiliary/monovariants.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/auxiliary/structs.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/auxiliary/unstable.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/auxiliary/variants.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/borrowck-exhaustive.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/borrowck-non-exhaustive.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/borrowck-non-exhaustive.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/enum-as-cast.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/enum-as-cast.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/enum.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/enum.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/enum_same_crate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/improper_ctypes/auxiliary/types.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/improper_ctypes/same_crate_proper.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/invalid-attribute.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/invalid-attribute.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/omitted-patterns.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/omitted-patterns.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/stable-omitted-patterns.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/stable-omitted-patterns.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/struct.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/struct.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/structs_same_crate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/coercions.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/coercions.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/match.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/match.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/patterns.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/variant.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/variant.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/variants_fictive_visibility.rs (100%) rename tests/ui/{ => rfcs}/rfc-2008-non-exhaustive/variants_same_crate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2027-object-safe-for-dispatch/downcast-unsafe-trait-objects.rs (100%) rename tests/ui/{ => rfcs}/rfc-2027-object-safe-for-dispatch/manual-self-impl-for-unsafe-obj.rs (100%) rename tests/ui/{ => rfcs}/rfc-2027-object-safe-for-dispatch/static-dispatch-unsafe-object.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/call-chain.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/caller-location-intrinsic.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/const-caller-location.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/diverging-caller-location.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/error-odd-syntax.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/error-odd-syntax.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/error-with-invalid-abi.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/error-with-invalid-abi.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/error-with-main.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/error-with-main.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/error-with-naked.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/error-with-naked.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/error-with-start.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/error-with-start.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/intrinsic-wrapper.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/macro-declaration.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/mir-inlined-macro.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/only-for-fns.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/only-for-fns.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/pass.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/std-panic-locations.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/track-caller-attribute.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/track-caller-ffi.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/tracked-closure.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/tracked-fn-ptr.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/tracked-trait-impls.rs (100%) rename tests/ui/{ => rfcs}/rfc-2091-track-caller/tracked-trait-obj.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/cross-crate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/cross-crate.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/dont-infer-static.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/dont-infer-static.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/enum.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/enum.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/explicit-dyn.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/explicit-dyn.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/explicit-enum.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/explicit-enum.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/explicit-projection.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/explicit-projection.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/explicit-struct.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/explicit-struct.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/explicit-union.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/explicit-union.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/issue-54467.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/nested-enum.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/nested-enum.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/nested-regions.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/nested-regions.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/nested-structs.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/nested-structs.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/nested-union.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/nested-union.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/privacy.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/projection.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/projection.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/reference.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/reference.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/regions-enum-not-wf.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/regions-enum-not-wf.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/regions-struct-not-wf.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/regions-struct-not-wf.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/self-dyn.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/self-dyn.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/self-structs.rs (100%) rename tests/ui/{ => rfcs}/rfc-2093-infer-outlives/self-structs.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2126-crate-paths/crate-path-non-absolute.rs (100%) rename tests/ui/{ => rfcs}/rfc-2126-crate-paths/crate-path-non-absolute.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2126-crate-paths/keyword-crate-as-identifier.rs (100%) rename tests/ui/{ => rfcs}/rfc-2126-crate-paths/keyword-crate-as-identifier.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2126-extern-absolute-paths/non-existent-1.rs (100%) rename tests/ui/{ => rfcs}/rfc-2126-extern-absolute-paths/non-existent-1.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2126-extern-absolute-paths/non-existent-2.rs (100%) rename tests/ui/{ => rfcs}/rfc-2126-extern-absolute-paths/non-existent-2.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2126-extern-absolute-paths/non-existent-3.rs (100%) rename tests/ui/{ => rfcs}/rfc-2126-extern-absolute-paths/non-existent-3.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2126-extern-absolute-paths/not-allowed.rs (100%) rename tests/ui/{ => rfcs}/rfc-2126-extern-absolute-paths/not-allowed.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2126-extern-absolute-paths/single-segment.rs (100%) rename tests/ui/{ => rfcs}/rfc-2126-extern-absolute-paths/single-segment.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2294-if-let-guard/bindings.rs (100%) rename tests/ui/{ => rfcs}/rfc-2294-if-let-guard/bindings.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2294-if-let-guard/feature-gate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2294-if-let-guard/feature-gate.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2294-if-let-guard/run-pass.rs (100%) rename tests/ui/{ => rfcs}/rfc-2294-if-let-guard/typeck.rs (100%) rename tests/ui/{ => rfcs}/rfc-2294-if-let-guard/typeck.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2294-if-let-guard/warns.rs (100%) rename tests/ui/{ => rfcs}/rfc-2294-if-let-guard/warns.stderr (100%) rename tests/ui/rfcs/{ => rfc-2302-self-struct-ctor}/rfc-2302-self-struct-ctor.rs (100%) rename tests/ui/{rfc-2306 => rfcs/rfc-2306-convert-id}/convert-id-const-with-gate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2361-dbg-macro/dbg-macro-expected-behavior.rs (100%) rename tests/ui/{ => rfcs}/rfc-2361-dbg-macro/dbg-macro-expected-behavior.run.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs (100%) rename tests/ui/{ => rfcs}/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs (100%) rename tests/ui/{ => rfcs}/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.rs (100%) rename tests/ui/{ => rfcs}/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2397-do-not-recommend/incorrect-locations.rs (100%) rename tests/ui/{ => rfcs}/rfc-2397-do-not-recommend/incorrect-locations.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2397-do-not-recommend/unstable-feature.rs (100%) rename tests/ui/{ => rfcs}/rfc-2397-do-not-recommend/unstable-feature.stderr (100%) rename tests/ui/rfcs/{rfc-2421-unreserve-pure-offsetof-sizeof-alignof.rs => rfc-2421-unreserve-pure-offsetof-sizeof-alignof/offsetof-alignof-sizeof-pure-can-be-used-as-idents.rs} (100%) rename tests/ui/{rfc-2457 => rfcs/rfc-2457-non-ascii-idents}/auxiliary/mod_file_nonascii_with_path_allowed-aux.rs (100%) rename tests/ui/{rfc-2457 => rfcs/rfc-2457-non-ascii-idents}/crate_name_nonascii_forbidden-1.rs (100%) rename tests/ui/{rfc-2457 => rfcs/rfc-2457-non-ascii-idents}/crate_name_nonascii_forbidden-1.stderr (100%) rename tests/ui/{rfc-2457 => rfcs/rfc-2457-non-ascii-idents}/crate_name_nonascii_forbidden-2.rs (100%) rename tests/ui/{rfc-2457 => rfcs/rfc-2457-non-ascii-idents}/crate_name_nonascii_forbidden-2.stderr (100%) rename tests/ui/{rfc-2457 => rfcs/rfc-2457-non-ascii-idents}/extern_block_nonascii_forbidden.rs (100%) rename tests/ui/{rfc-2457 => rfcs/rfc-2457-non-ascii-idents}/extern_block_nonascii_forbidden.stderr (100%) rename tests/ui/{rfc-2457 => rfcs/rfc-2457-non-ascii-idents}/idents-normalized.rs (100%) rename tests/ui/{rfc-2457 => rfcs/rfc-2457-non-ascii-idents}/mod_file_nonascii_forbidden.rs (100%) rename tests/ui/{rfc-2457 => rfcs/rfc-2457-non-ascii-idents}/mod_file_nonascii_forbidden.stderr (100%) rename tests/ui/{rfc-2457 => rfcs/rfc-2457-non-ascii-idents}/mod_file_nonascii_with_path_allowed.rs (100%) rename tests/ui/{rfc-2457 => rfcs/rfc-2457-non-ascii-idents}/mod_inline_nonascii_allowed.rs (100%) rename tests/ui/{rfc-2457 => rfcs/rfc-2457-non-ascii-idents}/no_mangle_nonascii_forbidden.rs (100%) rename tests/ui/{rfc-2457 => rfcs/rfc-2457-non-ascii-idents}/no_mangle_nonascii_forbidden.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/ast-pretty-check.rs (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/ast-pretty-check.stdout (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/ast-validate-guards.rs (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/ast-validate-guards.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/chains-without-let.rs (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/chains-without-let.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/disallowed-positions.rs (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/disallowed-positions.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/feature-gate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/feature-gate.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/irrefutable-lets.rs (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/issue-88498.rs (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/issue-90722.rs (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/issue-92145.rs (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/issue-93150.rs (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/issue-93150.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/issue-99938.rs (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/no-double-assigments.rs (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/protect-precedences.rs (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/protect-precedences.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2497-if-let-chains/then-else-blocks.rs (100%) rename tests/ui/{ => rfcs}/rfc-2565-param-attrs/attr-without-param.rs (100%) rename tests/ui/{ => rfcs}/rfc-2565-param-attrs/attr-without-param.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2565-param-attrs/auxiliary/ident-mac.rs (100%) rename tests/ui/{ => rfcs}/rfc-2565-param-attrs/auxiliary/param-attrs.rs (100%) rename tests/ui/{ => rfcs}/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs (100%) rename tests/ui/{ => rfcs}/rfc-2565-param-attrs/param-attrs-2018.rs (100%) rename tests/ui/{ => rfcs}/rfc-2565-param-attrs/param-attrs-2018.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2565-param-attrs/param-attrs-allowed.rs (100%) rename tests/ui/{ => rfcs}/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs (100%) rename tests/ui/{ => rfcs}/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2565-param-attrs/param-attrs-cfg.rs (100%) rename tests/ui/{ => rfcs}/rfc-2565-param-attrs/param-attrs-cfg.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2565-param-attrs/param-attrs-pretty.rs (100%) rename tests/ui/{ => rfcs}/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs (100%) rename tests/ui/{ => rfcs}/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/dlltool-failed.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/dlltool-failed.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/import-name-type-invalid-format.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/import-name-type-multiple.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/import-name-type-multiple.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/import-name-type-unknown-value.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/import-name-type-x86-only.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/import-name-type-x86-only.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/invalid-dlltool.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/invalid-dlltool.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/link-ordinal-and-name.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/link-ordinal-and-name.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/link-ordinal-multiple.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/link-ordinal-multiple.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/link-ordinal-too-large.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/link-ordinal-too-large.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/multiple-declarations.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/multiple-declarations.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/raw-dylib-windows-only.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/unsupported-abi.rs (100%) rename tests/ui/{ => rfcs}/rfc-2627-raw-dylib/unsupported-abi.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/assoc-type-const-bound-usage.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/assoc-type.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/assoc-type.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/attr-misuse.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/attr-misuse.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/auxiliary/staged-api.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call-generic-in-impl.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call-generic-in-impl.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call-generic-method-chain.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call-generic-method-chain.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call-generic-method-fail.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call-generic-method-fail.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call-generic-method-pass.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call-generic-method-pass.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/call.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-and-non-const-impl.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-closure-parse-not-item.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-closure-trait-method-fail.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-closure-trait-method.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-closures.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-default-method-bodies.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-default-method-bodies.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-drop-bound.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-drop-fail-2.precise.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-drop-fail-2.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-drop-fail-2.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-drop-fail-2.stock.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-drop-fail.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-drop.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-impl-norecover.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-impl-norecover.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-impl-recovery.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-impl-recovery.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-impl-requires-const-trait.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-impl-trait.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const-impl-trait.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const_derives/derive-const-gate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const_derives/derive-const-gate.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const_derives/derive-const-use.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/cross-crate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/cross-crate.stock.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/do-not-const-check-override.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/do-not-const-check.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/feature-gate.gated.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/feature-gate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/feature-gate.stock.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/gate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/gate.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/generic-bound.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/generic-bound.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/hir-const-check.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/hir-const-check.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/impl-tilde-const-trait.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/impl-tilde-const-trait.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/impl-with-default-fn-fail.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/impl-with-default-fn-fail.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/inherent-impl-const-bounds.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/inherent-impl.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/inherent-impl.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/issue-100222.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/issue-102156.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/issue-102156.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/issue-102985.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/issue-102985.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/issue-103677.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/issue-79450.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/issue-79450.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/issue-88155.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/issue-88155.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/issue-90052.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/issue-90052.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/issue-92111.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/nested-closure.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/specialization/default-keyword.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/specializing-constness-2.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/specializing-constness-2.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/specializing-constness.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/specializing-constness.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/staged-api-user-crate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/staged-api-user-crate.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/staged-api.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/staged-api.stable.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/staged-api.unstable.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/static-const-trait-bound.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/std-impl-gate.gated.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/std-impl-gate.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/super-traits-fail-2.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/super-traits-fail-3.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/super-traits-fail.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/super-traits-fail.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/super-traits.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/syntax.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/tilde-const-and-const-params.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/tilde-const-and-const-params.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/tilde-const-syntax.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/tilde-twice.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/tilde-twice.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/tilde_const_on_impl_bound.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/trait-default-body-stability.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/trait-default-body-stability.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/trait-method-ptr-in-consts-ice.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/trait-where-clause-const.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/trait-where-clause-const.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/trait-where-clause-run.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/trait-where-clause.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/trait-where-clause.stderr (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/without-tilde.rs (100%) rename tests/ui/{ => rfcs}/rfc-2632-const-trait-impl/without-tilde.stderr (100%) diff --git a/tests/ui/rfc-2005-default-binding-mode/enum.rs b/tests/ui/rfc-2005-default-binding-mode/enum.rs deleted file mode 100644 index 4e57769d6e24c..0000000000000 --- a/tests/ui/rfc-2005-default-binding-mode/enum.rs +++ /dev/null @@ -1,22 +0,0 @@ -enum Wrapper { - Wrap(i32), -} - -use Wrapper::Wrap; - -pub fn main() { - let Wrap(x) = &Wrap(3); - *x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference - - - if let Some(x) = &Some(3) { - *x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference - } else { - panic!(); - } - - while let Some(x) = &Some(3) { - *x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference - break; - } -} diff --git a/tests/ui/rfc-2005-default-binding-mode/for.rs b/tests/ui/rfc-2005-default-binding-mode/for.rs deleted file mode 100644 index d6c5a13b1bdb0..0000000000000 --- a/tests/ui/rfc-2005-default-binding-mode/for.rs +++ /dev/null @@ -1,9 +0,0 @@ -struct Foo {} - -pub fn main() { - let mut tups = vec![(Foo {}, Foo {})]; - // The below desugars to &(ref n, mut m). - for (n, mut m) in &tups { - //~^ ERROR cannot move out of a shared reference - } -} diff --git a/tests/ui/rfc-2005-default-binding-mode/lit.rs b/tests/ui/rfc-2005-default-binding-mode/lit.rs deleted file mode 100644 index ce79cfbdc1a30..0000000000000 --- a/tests/ui/rfc-2005-default-binding-mode/lit.rs +++ /dev/null @@ -1,24 +0,0 @@ -// FIXME(tschottdorf): we want these to compile, but they don't. - -fn with_str() { - let s: &'static str = "abc"; - - match &s { - "abc" => true, //~ ERROR mismatched types - _ => panic!(), - }; -} - -fn with_bytes() { - let s: &'static [u8] = b"abc"; - - match &s { - b"abc" => true, //~ ERROR mismatched types - _ => panic!(), - }; -} - -pub fn main() { - with_str(); - with_bytes(); -} diff --git a/tests/ui/rfc-2005-default-binding-mode/slice.rs b/tests/ui/rfc-2005-default-binding-mode/slice.rs deleted file mode 100644 index 363a0e3e649d9..0000000000000 --- a/tests/ui/rfc-2005-default-binding-mode/slice.rs +++ /dev/null @@ -1,7 +0,0 @@ -pub fn main() { - let sl: &[u8] = b"foo"; - - match sl { //~ ERROR non-exhaustive patterns - [first, remainder @ ..] => {}, - }; -} diff --git a/tests/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs similarity index 100% rename from tests/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs rename to tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs diff --git a/tests/ui/rfc-0107-bind-by-move-pattern-guards/former-E0008-now-pass.rs b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/former-E0008-now-pass.rs similarity index 100% rename from tests/ui/rfc-0107-bind-by-move-pattern-guards/former-E0008-now-pass.rs rename to tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/former-E0008-now-pass.rs diff --git a/tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs similarity index 100% rename from tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs rename to tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs diff --git a/tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs similarity index 100% rename from tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs rename to tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.rs diff --git a/tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.stderr b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.stderr similarity index 100% rename from tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.stderr rename to tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-across-arms.stderr diff --git a/tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.rs b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.rs similarity index 100% rename from tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.rs rename to tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.rs diff --git a/tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.stderr b/tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.stderr similarity index 100% rename from tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.stderr rename to tests/ui/rfcs/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.stderr diff --git a/tests/ui/rfcs/rfc-1014-2.rs b/tests/ui/rfcs/rfc-1014-stdout-existential-crisis/rfc-1014-2.rs similarity index 100% rename from tests/ui/rfcs/rfc-1014-2.rs rename to tests/ui/rfcs/rfc-1014-stdout-existential-crisis/rfc-1014-2.rs diff --git a/tests/ui/rfcs/rfc-1014.rs b/tests/ui/rfcs/rfc-1014-stdout-existential-crisis/rfc-1014.rs similarity index 100% rename from tests/ui/rfcs/rfc-1014.rs rename to tests/ui/rfcs/rfc-1014-stdout-existential-crisis/rfc-1014.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-embedded.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-direct-unsafe-ptr-param.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-embedded.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-hide-behind-indirect-unsafe-ptr-param.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/allow-use-behind-cousin-variant.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-use-behind-cousin-variant.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/allow-use-behind-cousin-variant.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/allow-use-behind-cousin-variant.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.stderr similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.stderr rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-embedded.stderr diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.stderr similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.stderr rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-direct-struct-param.stderr diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-embedded.stderr diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-doubly-indirect-param.stderr diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-embedded.stderr diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/cant-hide-behind-indirect-struct-param.stderr diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/feature-gate.no_gate.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/feature-gate.no_gate.stderr similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/feature-gate.no_gate.stderr rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/feature-gate.no_gate.stderr diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/feature-gate.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/feature-gate.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/feature-gate.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/feature-gate.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/feature-gate.with_gate.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/feature-gate.with_gate.stderr similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/feature-gate.with_gate.stderr rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/feature-gate.with_gate.stderr diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/fn-ptr-is-structurally-matchable.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/fn-ptr-is-structurally-matchable.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/fn-ptr-is-structurally-matchable.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/fn-ptr-is-structurally-matchable.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.stderr similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.stderr rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-61188-match-slice-forbidden-without-eq.stderr diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-62307-match-ref-ref-forbidden-without-eq.stderr diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.stderr similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.stderr rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-63479-match-fnptr.stderr diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-6804.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-6804.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/issue-6804.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-6804.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/issue-6804.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-6804.stderr similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/issue-6804.stderr rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/issue-6804.stderr diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-empty-array-allowed-without-eq-issue-62336.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-empty-array-allowed-without-eq-issue-62336.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/match-empty-array-allowed-without-eq-issue-62336.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-empty-array-allowed-without-eq-issue-62336.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-forbidden-without-eq.stderr diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.stderr similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.stderr rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-nonempty-array-forbidden-without-eq.stderr diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.rs diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.stderr b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.stderr similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.stderr rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/match-requires-both-partialeq-and-eq.stderr diff --git a/tests/ui/rfc-1445-restrict-constants-in-patterns/phantom-data-is-structurally-matchable.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/phantom-data-is-structurally-matchable.rs similarity index 100% rename from tests/ui/rfc-1445-restrict-constants-in-patterns/phantom-data-is-structurally-matchable.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/phantom-data-is-structurally-matchable.rs diff --git a/tests/ui/rfcs/rfc1445/eq-allows-match-on-ty-in-macro.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/rfc1445/eq-allows-match-on-ty-in-macro.rs similarity index 100% rename from tests/ui/rfcs/rfc1445/eq-allows-match-on-ty-in-macro.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/rfc1445/eq-allows-match-on-ty-in-macro.rs diff --git a/tests/ui/rfcs/rfc1445/eq-allows-match.rs b/tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/rfc1445/eq-allows-match.rs similarity index 100% rename from tests/ui/rfcs/rfc1445/eq-allows-match.rs rename to tests/ui/rfcs/rfc-1445-restrict-constants-in-patterns/rfc1445/eq-allows-match.rs diff --git a/tests/ui/rfcs/rfc1623-2.rs b/tests/ui/rfcs/rfc-1623-static/rfc1623-2.rs similarity index 100% rename from tests/ui/rfcs/rfc1623-2.rs rename to tests/ui/rfcs/rfc-1623-static/rfc1623-2.rs diff --git a/tests/ui/rfcs/rfc1623-2.stderr b/tests/ui/rfcs/rfc-1623-static/rfc1623-2.stderr similarity index 100% rename from tests/ui/rfcs/rfc1623-2.stderr rename to tests/ui/rfcs/rfc-1623-static/rfc1623-2.stderr diff --git a/tests/ui/rfcs/rfc1623-3.rs b/tests/ui/rfcs/rfc-1623-static/rfc1623-3.rs similarity index 100% rename from tests/ui/rfcs/rfc1623-3.rs rename to tests/ui/rfcs/rfc-1623-static/rfc1623-3.rs diff --git a/tests/ui/rfcs/rfc1623-3.stderr b/tests/ui/rfcs/rfc-1623-static/rfc1623-3.stderr similarity index 100% rename from tests/ui/rfcs/rfc1623-3.stderr rename to tests/ui/rfcs/rfc-1623-static/rfc1623-3.stderr diff --git a/tests/ui/rfcs/rfc1623.rs b/tests/ui/rfcs/rfc-1623-static/rfc1623.rs similarity index 100% rename from tests/ui/rfcs/rfc1623.rs rename to tests/ui/rfcs/rfc-1623-static/rfc1623.rs diff --git a/tests/ui/rfcs/rfc1717/library-override.rs b/tests/ui/rfcs/rfc-1717-dllimport/1717-dllimport/library-override.rs similarity index 100% rename from tests/ui/rfcs/rfc1717/library-override.rs rename to tests/ui/rfcs/rfc-1717-dllimport/1717-dllimport/library-override.rs diff --git a/tests/ui/rfc-1717-dllimport/missing-link-attr.rs b/tests/ui/rfcs/rfc-1717-dllimport/missing-link-attr.rs similarity index 100% rename from tests/ui/rfc-1717-dllimport/missing-link-attr.rs rename to tests/ui/rfcs/rfc-1717-dllimport/missing-link-attr.rs diff --git a/tests/ui/rfc-1717-dllimport/missing-link-attr.stderr b/tests/ui/rfcs/rfc-1717-dllimport/missing-link-attr.stderr similarity index 100% rename from tests/ui/rfc-1717-dllimport/missing-link-attr.stderr rename to tests/ui/rfcs/rfc-1717-dllimport/missing-link-attr.stderr diff --git a/tests/ui/rfc-1717-dllimport/multiple-renames.rs b/tests/ui/rfcs/rfc-1717-dllimport/multiple-renames.rs similarity index 100% rename from tests/ui/rfc-1717-dllimport/multiple-renames.rs rename to tests/ui/rfcs/rfc-1717-dllimport/multiple-renames.rs diff --git a/tests/ui/rfc-1717-dllimport/multiple-renames.stderr b/tests/ui/rfcs/rfc-1717-dllimport/multiple-renames.stderr similarity index 100% rename from tests/ui/rfc-1717-dllimport/multiple-renames.stderr rename to tests/ui/rfcs/rfc-1717-dllimport/multiple-renames.stderr diff --git a/tests/ui/rfc-1717-dllimport/rename-modifiers.rs b/tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.rs similarity index 100% rename from tests/ui/rfc-1717-dllimport/rename-modifiers.rs rename to tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.rs diff --git a/tests/ui/rfc-1717-dllimport/rename-modifiers.stderr b/tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.stderr similarity index 100% rename from tests/ui/rfc-1717-dllimport/rename-modifiers.stderr rename to tests/ui/rfcs/rfc-1717-dllimport/rename-modifiers.stderr diff --git a/tests/ui/rfc-1717-dllimport/rename-to-empty.rs b/tests/ui/rfcs/rfc-1717-dllimport/rename-to-empty.rs similarity index 100% rename from tests/ui/rfc-1717-dllimport/rename-to-empty.rs rename to tests/ui/rfcs/rfc-1717-dllimport/rename-to-empty.rs diff --git a/tests/ui/rfc-1717-dllimport/rename-to-empty.stderr b/tests/ui/rfcs/rfc-1717-dllimport/rename-to-empty.stderr similarity index 100% rename from tests/ui/rfc-1717-dllimport/rename-to-empty.stderr rename to tests/ui/rfcs/rfc-1717-dllimport/rename-to-empty.stderr diff --git a/tests/ui/rfcs/rfc1857-drop-order.rs b/tests/ui/rfcs/rfc-1857-stabilize-drop-order/drop-order.rs similarity index 100% rename from tests/ui/rfcs/rfc1857-drop-order.rs rename to tests/ui/rfcs/rfc-1857-stabilize-drop-order/drop-order.rs diff --git a/tests/ui/rfc-1937-termination-trait/issue-103052-1.rs b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-1.rs similarity index 100% rename from tests/ui/rfc-1937-termination-trait/issue-103052-1.rs rename to tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-1.rs diff --git a/tests/ui/rfc-1937-termination-trait/issue-103052-1.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-1.stderr similarity index 100% rename from tests/ui/rfc-1937-termination-trait/issue-103052-1.stderr rename to tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-1.stderr diff --git a/tests/ui/rfc-1937-termination-trait/issue-103052-2.current.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.current.stderr similarity index 100% rename from tests/ui/rfc-1937-termination-trait/issue-103052-2.current.stderr rename to tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.current.stderr diff --git a/tests/ui/rfc-1937-termination-trait/issue-103052-2.next.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.next.stderr similarity index 100% rename from tests/ui/rfc-1937-termination-trait/issue-103052-2.next.stderr rename to tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.next.stderr diff --git a/tests/ui/rfc-1937-termination-trait/issue-103052-2.rs b/tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.rs similarity index 100% rename from tests/ui/rfc-1937-termination-trait/issue-103052-2.rs rename to tests/ui/rfcs/rfc-1937-termination-trait/issue-103052-2.rs diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-err.rs similarity index 100% rename from tests/ui/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-err.rs diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-ok.rs similarity index 100% rename from tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error-ok.rs diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-for-never.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-never.rs similarity index 100% rename from tests/ui/rfc-1937-termination-trait/termination-trait-for-never.rs rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-never.rs diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs similarity index 100% rename from tests/ui/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-for-str.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-err.rs similarity index 100% rename from tests/ui/rfc-1937-termination-trait/termination-trait-for-str.rs rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-err.rs diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-ok.rs similarity index 100% rename from tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str.rs rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str-ok.rs diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-impl-trait.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-impl-trait.rs similarity index 100% rename from tests/ui/rfc-1937-termination-trait/termination-trait-impl-trait.rs rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-impl-trait.rs diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-impl-trait.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-impl-trait.stderr similarity index 100% rename from tests/ui/rfc-1937-termination-trait/termination-trait-impl-trait.stderr rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-impl-trait.stderr diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test-should-panic.rs similarity index 100% rename from tests/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.rs rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test-should-panic.rs diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test-should-panic.stderr similarity index 100% rename from tests/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.stderr rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test-should-panic.stderr diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-in-test.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test.rs similarity index 100% rename from tests/ui/rfc-1937-termination-trait/termination-trait-in-test.rs rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-in-test.rs diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-main-i32.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-i32.rs similarity index 100% rename from tests/ui/rfc-1937-termination-trait/termination-trait-main-i32.rs rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-i32.rs diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-main-i32.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-i32.stderr similarity index 100% rename from tests/ui/rfc-1937-termination-trait/termination-trait-main-i32.stderr rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-i32.stderr diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-wrong-type.rs similarity index 100% rename from tests/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.rs rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-wrong-type.rs diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-wrong-type.stderr similarity index 100% rename from tests/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.stderr rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-main-wrong-type.stderr diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-not-satisfied.rs similarity index 100% rename from tests/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.rs rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-not-satisfied.rs diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr similarity index 100% rename from tests/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs similarity index 100% rename from tests/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs diff --git a/tests/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr similarity index 100% rename from tests/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr rename to tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr diff --git a/tests/ui/rfc-2005-default-binding-mode/borrowck-issue-49631.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/borrowck-issue-49631.rs similarity index 100% rename from tests/ui/rfc-2005-default-binding-mode/borrowck-issue-49631.rs rename to tests/ui/rfcs/rfc-2005-default-binding-mode/borrowck-issue-49631.rs diff --git a/tests/ui/rfc-2005-default-binding-mode/borrowck-issue-49631.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/borrowck-issue-49631.stderr similarity index 100% rename from tests/ui/rfc-2005-default-binding-mode/borrowck-issue-49631.stderr rename to tests/ui/rfcs/rfc-2005-default-binding-mode/borrowck-issue-49631.stderr diff --git a/tests/ui/rfc-2005-default-binding-mode/const.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/const.rs similarity index 100% rename from tests/ui/rfc-2005-default-binding-mode/const.rs rename to tests/ui/rfcs/rfc-2005-default-binding-mode/const.rs diff --git a/tests/ui/rfc-2005-default-binding-mode/const.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/const.stderr similarity index 100% rename from tests/ui/rfc-2005-default-binding-mode/const.stderr rename to tests/ui/rfcs/rfc-2005-default-binding-mode/const.stderr diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/enum-ok.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/enum-ok.rs new file mode 100644 index 0000000000000..52fbb90ed541b --- /dev/null +++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/enum-ok.rs @@ -0,0 +1,45 @@ +// run-pass +enum Wrapper { + Wrap(i32), +} + +use Wrapper::Wrap; + +pub fn main() { + let Wrap(x) = &Wrap(3); + println!("{}", *x); + + let Wrap(x) = &mut Wrap(3); + println!("{}", *x); + + if let Some(x) = &Some(3) { + println!("{}", *x); + } else { + panic!(); + } + + if let Some(x) = &mut Some(3) { + println!("{}", *x); + } else { + panic!(); + } + + if let Some(x) = &mut Some(3) { + *x += 1; + } else { + panic!(); + } + + while let Some(x) = &Some(3) { + println!("{}", *x); + break; + } + while let Some(x) = &mut Some(3) { + println!("{}", *x); + break; + } + while let Some(x) = &mut Some(3) { + *x += 1; + break; + } +} diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/enum.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/enum.rs index 52fbb90ed541b..4e57769d6e24c 100644 --- a/tests/ui/rfcs/rfc-2005-default-binding-mode/enum.rs +++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/enum.rs @@ -1,4 +1,3 @@ -// run-pass enum Wrapper { Wrap(i32), } @@ -7,39 +6,17 @@ use Wrapper::Wrap; pub fn main() { let Wrap(x) = &Wrap(3); - println!("{}", *x); + *x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference - let Wrap(x) = &mut Wrap(3); - println!("{}", *x); if let Some(x) = &Some(3) { - println!("{}", *x); - } else { - panic!(); - } - - if let Some(x) = &mut Some(3) { - println!("{}", *x); - } else { - panic!(); - } - - if let Some(x) = &mut Some(3) { - *x += 1; + *x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference } else { panic!(); } while let Some(x) = &Some(3) { - println!("{}", *x); - break; - } - while let Some(x) = &mut Some(3) { - println!("{}", *x); - break; - } - while let Some(x) = &mut Some(3) { - *x += 1; + *x += 1; //~ ERROR cannot assign to `*x`, which is behind a `&` reference break; } } diff --git a/tests/ui/rfc-2005-default-binding-mode/enum.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/enum.stderr similarity index 100% rename from tests/ui/rfc-2005-default-binding-mode/enum.stderr rename to tests/ui/rfcs/rfc-2005-default-binding-mode/enum.stderr diff --git a/tests/ui/rfc-2005-default-binding-mode/explicit-mut.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/explicit-mut.rs similarity index 100% rename from tests/ui/rfc-2005-default-binding-mode/explicit-mut.rs rename to tests/ui/rfcs/rfc-2005-default-binding-mode/explicit-mut.rs diff --git a/tests/ui/rfc-2005-default-binding-mode/explicit-mut.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/explicit-mut.stderr similarity index 100% rename from tests/ui/rfc-2005-default-binding-mode/explicit-mut.stderr rename to tests/ui/rfcs/rfc-2005-default-binding-mode/explicit-mut.stderr diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/for-ok.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/for-ok.rs new file mode 100644 index 0000000000000..a5a24a806340f --- /dev/null +++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/for-ok.rs @@ -0,0 +1,20 @@ +// run-pass +pub fn main() { + let mut tups = vec![(0u8, 1u8)]; + + for (n, m) in &tups { + let _: &u8 = n; + let _: &u8 = m; + } + + for (n, m) in &mut tups { + *n += 1; + *m += 2; + } + + assert_eq!(tups, vec![(1u8, 3u8)]); + + for (n, m) in tups { + println!("{} {}", m, n); + } +} diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/for.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/for.rs index a5a24a806340f..d6c5a13b1bdb0 100644 --- a/tests/ui/rfcs/rfc-2005-default-binding-mode/for.rs +++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/for.rs @@ -1,20 +1,9 @@ -// run-pass -pub fn main() { - let mut tups = vec![(0u8, 1u8)]; - - for (n, m) in &tups { - let _: &u8 = n; - let _: &u8 = m; - } +struct Foo {} - for (n, m) in &mut tups { - *n += 1; - *m += 2; - } - - assert_eq!(tups, vec![(1u8, 3u8)]); - - for (n, m) in tups { - println!("{} {}", m, n); +pub fn main() { + let mut tups = vec![(Foo {}, Foo {})]; + // The below desugars to &(ref n, mut m). + for (n, mut m) in &tups { + //~^ ERROR cannot move out of a shared reference } } diff --git a/tests/ui/rfc-2005-default-binding-mode/for.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/for.stderr similarity index 100% rename from tests/ui/rfc-2005-default-binding-mode/for.stderr rename to tests/ui/rfcs/rfc-2005-default-binding-mode/for.stderr diff --git a/tests/ui/rfc-2005-default-binding-mode/issue-44912-or.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/issue-44912-or.rs similarity index 100% rename from tests/ui/rfc-2005-default-binding-mode/issue-44912-or.rs rename to tests/ui/rfcs/rfc-2005-default-binding-mode/issue-44912-or.rs diff --git a/tests/ui/rfc-2005-default-binding-mode/issue-44912-or.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/issue-44912-or.stderr similarity index 100% rename from tests/ui/rfc-2005-default-binding-mode/issue-44912-or.stderr rename to tests/ui/rfcs/rfc-2005-default-binding-mode/issue-44912-or.stderr diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/lit-ok.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/lit-ok.rs new file mode 100644 index 0000000000000..9379753598eb0 --- /dev/null +++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/lit-ok.rs @@ -0,0 +1,34 @@ +// run-pass +#![allow(dead_code)] +fn with_u8() { + let s = 5u8; + let r = match &s { + 4 => false, + 5 => true, + _ => false, + }; + assert!(r); +} + +// A string literal isn't mistaken for a non-ref pattern (in which case we'd +// deref `s` and mess things up). +fn with_str() { + let s: &'static str = "abc"; + match s { + "abc" => true, + _ => panic!(), + }; +} + +// Ditto with byte strings. +fn with_bytes() { + let s: &'static [u8] = b"abc"; + match s { + b"abc" => true, + _ => panic!(), + }; +} + +pub fn main() { + with_str(); +} diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/lit.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/lit.rs index 9379753598eb0..ce79cfbdc1a30 100644 --- a/tests/ui/rfcs/rfc-2005-default-binding-mode/lit.rs +++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/lit.rs @@ -1,34 +1,24 @@ -// run-pass -#![allow(dead_code)] -fn with_u8() { - let s = 5u8; - let r = match &s { - 4 => false, - 5 => true, - _ => false, - }; - assert!(r); -} +// FIXME(tschottdorf): we want these to compile, but they don't. -// A string literal isn't mistaken for a non-ref pattern (in which case we'd -// deref `s` and mess things up). fn with_str() { let s: &'static str = "abc"; - match s { - "abc" => true, + + match &s { + "abc" => true, //~ ERROR mismatched types _ => panic!(), }; } -// Ditto with byte strings. fn with_bytes() { let s: &'static [u8] = b"abc"; - match s { - b"abc" => true, + + match &s { + b"abc" => true, //~ ERROR mismatched types _ => panic!(), }; } pub fn main() { with_str(); + with_bytes(); } diff --git a/tests/ui/rfc-2005-default-binding-mode/lit.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/lit.stderr similarity index 100% rename from tests/ui/rfc-2005-default-binding-mode/lit.stderr rename to tests/ui/rfcs/rfc-2005-default-binding-mode/lit.stderr diff --git a/tests/ui/rfc-2005-default-binding-mode/no-double-error.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.rs similarity index 100% rename from tests/ui/rfc-2005-default-binding-mode/no-double-error.rs rename to tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.rs diff --git a/tests/ui/rfc-2005-default-binding-mode/no-double-error.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.stderr similarity index 100% rename from tests/ui/rfc-2005-default-binding-mode/no-double-error.stderr rename to tests/ui/rfcs/rfc-2005-default-binding-mode/no-double-error.stderr diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/slice-ok.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/slice-ok.rs new file mode 100644 index 0000000000000..33229a205f4d8 --- /dev/null +++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/slice-ok.rs @@ -0,0 +1,25 @@ +// run-pass + +fn slice_pat() { + let sl: &[u8] = b"foo"; + + match sl { + [first, remainder @ ..] => { + let _: &u8 = first; + assert_eq!(first, &b'f'); + assert_eq!(remainder, b"oo"); + } + [] => panic!(), + } +} + +fn slice_pat_omission() { + match &[0, 1, 2] { + [..] => {} + }; +} + +fn main() { + slice_pat(); + slice_pat_omission(); +} diff --git a/tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs b/tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs index 33229a205f4d8..363a0e3e649d9 100644 --- a/tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs +++ b/tests/ui/rfcs/rfc-2005-default-binding-mode/slice.rs @@ -1,25 +1,7 @@ -// run-pass - -fn slice_pat() { +pub fn main() { let sl: &[u8] = b"foo"; - match sl { - [first, remainder @ ..] => { - let _: &u8 = first; - assert_eq!(first, &b'f'); - assert_eq!(remainder, b"oo"); - } - [] => panic!(), - } -} - -fn slice_pat_omission() { - match &[0, 1, 2] { - [..] => {} - }; -} - -fn main() { - slice_pat(); - slice_pat_omission(); + match sl { //~ ERROR non-exhaustive patterns + [first, remainder @ ..] => {}, + }; } diff --git a/tests/ui/rfc-2005-default-binding-mode/slice.stderr b/tests/ui/rfcs/rfc-2005-default-binding-mode/slice.stderr similarity index 100% rename from tests/ui/rfc-2005-default-binding-mode/slice.stderr rename to tests/ui/rfcs/rfc-2005-default-binding-mode/slice.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/auxiliary/enums.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/enums.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/auxiliary/enums.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/enums.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/auxiliary/monovariants.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/monovariants.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/auxiliary/monovariants.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/monovariants.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/auxiliary/structs.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/structs.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/auxiliary/structs.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/structs.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/auxiliary/unstable.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/unstable.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/auxiliary/unstable.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/unstable.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/auxiliary/variants.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/variants.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/auxiliary/variants.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/auxiliary/variants.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/borrowck-exhaustive.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/borrowck-exhaustive.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/borrowck-exhaustive.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/borrowck-exhaustive.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/borrowck-non-exhaustive.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/borrowck-non-exhaustive.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/borrowck-non-exhaustive.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/borrowck-non-exhaustive.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/borrowck-non-exhaustive.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/enum-as-cast.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum-as-cast.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/enum-as-cast.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/enum-as-cast.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/enum-as-cast.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum-as-cast.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/enum-as-cast.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/enum-as-cast.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/enum.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/enum.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/enum.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/enum.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/enum.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/enum.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/enum_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/enum_same_crate.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/enum_same_crate_empty_match.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/improper_ctypes/auxiliary/types.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/auxiliary/types.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/improper_ctypes/auxiliary/types.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/auxiliary/types.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/extern_crate_improper.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/improper_ctypes/same_crate_proper.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/same_crate_proper.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/improper_ctypes/same_crate_proper.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/improper_ctypes/same_crate_proper.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/invalid-attribute.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/invalid-attribute.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/invalid-attribute.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/invalid-attribute.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/invalid-attribute.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/omitted-patterns.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/omitted-patterns.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/omitted-patterns.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/stable-omitted-patterns.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/stable-omitted-patterns.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/stable-omitted-patterns.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/stable-omitted-patterns.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/stable-omitted-patterns.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/stable-omitted-patterns.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/stable-omitted-patterns.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/stable-omitted-patterns.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/struct.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/struct.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/struct.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/struct.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/struct.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/struct.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/struct.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/struct.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/structs_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/structs_same_crate.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/structs_same_crate.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/structs_same_crate.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/auxiliary/uninhabited.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_same_crate.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/indirect_match_with_exhaustive_patterns_same_crate.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/match.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/match.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_same_crate.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/match_with_exhaustive_patterns_same_crate.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/patterns.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/patterns.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/uninhabited/patterns_same_crate.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/variant.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/variant.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/variant.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/variant.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/variant.stderr b/tests/ui/rfcs/rfc-2008-non-exhaustive/variant.stderr similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/variant.stderr rename to tests/ui/rfcs/rfc-2008-non-exhaustive/variant.stderr diff --git a/tests/ui/rfc-2008-non-exhaustive/variants_fictive_visibility.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/variants_fictive_visibility.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/variants_fictive_visibility.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/variants_fictive_visibility.rs diff --git a/tests/ui/rfc-2008-non-exhaustive/variants_same_crate.rs b/tests/ui/rfcs/rfc-2008-non-exhaustive/variants_same_crate.rs similarity index 100% rename from tests/ui/rfc-2008-non-exhaustive/variants_same_crate.rs rename to tests/ui/rfcs/rfc-2008-non-exhaustive/variants_same_crate.rs diff --git a/tests/ui/rfc-2027-object-safe-for-dispatch/downcast-unsafe-trait-objects.rs b/tests/ui/rfcs/rfc-2027-object-safe-for-dispatch/downcast-unsafe-trait-objects.rs similarity index 100% rename from tests/ui/rfc-2027-object-safe-for-dispatch/downcast-unsafe-trait-objects.rs rename to tests/ui/rfcs/rfc-2027-object-safe-for-dispatch/downcast-unsafe-trait-objects.rs diff --git a/tests/ui/rfc-2027-object-safe-for-dispatch/manual-self-impl-for-unsafe-obj.rs b/tests/ui/rfcs/rfc-2027-object-safe-for-dispatch/manual-self-impl-for-unsafe-obj.rs similarity index 100% rename from tests/ui/rfc-2027-object-safe-for-dispatch/manual-self-impl-for-unsafe-obj.rs rename to tests/ui/rfcs/rfc-2027-object-safe-for-dispatch/manual-self-impl-for-unsafe-obj.rs diff --git a/tests/ui/rfc-2027-object-safe-for-dispatch/static-dispatch-unsafe-object.rs b/tests/ui/rfcs/rfc-2027-object-safe-for-dispatch/static-dispatch-unsafe-object.rs similarity index 100% rename from tests/ui/rfc-2027-object-safe-for-dispatch/static-dispatch-unsafe-object.rs rename to tests/ui/rfcs/rfc-2027-object-safe-for-dispatch/static-dispatch-unsafe-object.rs diff --git a/tests/ui/rfc-2091-track-caller/call-chain.rs b/tests/ui/rfcs/rfc-2091-track-caller/call-chain.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/call-chain.rs rename to tests/ui/rfcs/rfc-2091-track-caller/call-chain.rs diff --git a/tests/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs b/tests/ui/rfcs/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs rename to tests/ui/rfcs/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.rs diff --git a/tests/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.stderr b/tests/ui/rfcs/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.stderr similarity index 100% rename from tests/ui/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.stderr rename to tests/ui/rfcs/rfc-2091-track-caller/caller-location-fnptr-rt-ctfe-equiv.stderr diff --git a/tests/ui/rfc-2091-track-caller/caller-location-intrinsic.rs b/tests/ui/rfcs/rfc-2091-track-caller/caller-location-intrinsic.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/caller-location-intrinsic.rs rename to tests/ui/rfcs/rfc-2091-track-caller/caller-location-intrinsic.rs diff --git a/tests/ui/rfc-2091-track-caller/const-caller-location.rs b/tests/ui/rfcs/rfc-2091-track-caller/const-caller-location.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/const-caller-location.rs rename to tests/ui/rfcs/rfc-2091-track-caller/const-caller-location.rs diff --git a/tests/ui/rfc-2091-track-caller/diverging-caller-location.rs b/tests/ui/rfcs/rfc-2091-track-caller/diverging-caller-location.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/diverging-caller-location.rs rename to tests/ui/rfcs/rfc-2091-track-caller/diverging-caller-location.rs diff --git a/tests/ui/rfc-2091-track-caller/error-odd-syntax.rs b/tests/ui/rfcs/rfc-2091-track-caller/error-odd-syntax.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/error-odd-syntax.rs rename to tests/ui/rfcs/rfc-2091-track-caller/error-odd-syntax.rs diff --git a/tests/ui/rfc-2091-track-caller/error-odd-syntax.stderr b/tests/ui/rfcs/rfc-2091-track-caller/error-odd-syntax.stderr similarity index 100% rename from tests/ui/rfc-2091-track-caller/error-odd-syntax.stderr rename to tests/ui/rfcs/rfc-2091-track-caller/error-odd-syntax.stderr diff --git a/tests/ui/rfc-2091-track-caller/error-with-invalid-abi.rs b/tests/ui/rfcs/rfc-2091-track-caller/error-with-invalid-abi.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/error-with-invalid-abi.rs rename to tests/ui/rfcs/rfc-2091-track-caller/error-with-invalid-abi.rs diff --git a/tests/ui/rfc-2091-track-caller/error-with-invalid-abi.stderr b/tests/ui/rfcs/rfc-2091-track-caller/error-with-invalid-abi.stderr similarity index 100% rename from tests/ui/rfc-2091-track-caller/error-with-invalid-abi.stderr rename to tests/ui/rfcs/rfc-2091-track-caller/error-with-invalid-abi.stderr diff --git a/tests/ui/rfc-2091-track-caller/error-with-main.rs b/tests/ui/rfcs/rfc-2091-track-caller/error-with-main.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/error-with-main.rs rename to tests/ui/rfcs/rfc-2091-track-caller/error-with-main.rs diff --git a/tests/ui/rfc-2091-track-caller/error-with-main.stderr b/tests/ui/rfcs/rfc-2091-track-caller/error-with-main.stderr similarity index 100% rename from tests/ui/rfc-2091-track-caller/error-with-main.stderr rename to tests/ui/rfcs/rfc-2091-track-caller/error-with-main.stderr diff --git a/tests/ui/rfc-2091-track-caller/error-with-naked.rs b/tests/ui/rfcs/rfc-2091-track-caller/error-with-naked.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/error-with-naked.rs rename to tests/ui/rfcs/rfc-2091-track-caller/error-with-naked.rs diff --git a/tests/ui/rfc-2091-track-caller/error-with-naked.stderr b/tests/ui/rfcs/rfc-2091-track-caller/error-with-naked.stderr similarity index 100% rename from tests/ui/rfc-2091-track-caller/error-with-naked.stderr rename to tests/ui/rfcs/rfc-2091-track-caller/error-with-naked.stderr diff --git a/tests/ui/rfc-2091-track-caller/error-with-start.rs b/tests/ui/rfcs/rfc-2091-track-caller/error-with-start.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/error-with-start.rs rename to tests/ui/rfcs/rfc-2091-track-caller/error-with-start.rs diff --git a/tests/ui/rfc-2091-track-caller/error-with-start.stderr b/tests/ui/rfcs/rfc-2091-track-caller/error-with-start.stderr similarity index 100% rename from tests/ui/rfc-2091-track-caller/error-with-start.stderr rename to tests/ui/rfcs/rfc-2091-track-caller/error-with-start.stderr diff --git a/tests/ui/rfc-2091-track-caller/intrinsic-wrapper.rs b/tests/ui/rfcs/rfc-2091-track-caller/intrinsic-wrapper.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/intrinsic-wrapper.rs rename to tests/ui/rfcs/rfc-2091-track-caller/intrinsic-wrapper.rs diff --git a/tests/ui/rfc-2091-track-caller/macro-declaration.rs b/tests/ui/rfcs/rfc-2091-track-caller/macro-declaration.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/macro-declaration.rs rename to tests/ui/rfcs/rfc-2091-track-caller/macro-declaration.rs diff --git a/tests/ui/rfc-2091-track-caller/mir-inlined-macro.rs b/tests/ui/rfcs/rfc-2091-track-caller/mir-inlined-macro.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/mir-inlined-macro.rs rename to tests/ui/rfcs/rfc-2091-track-caller/mir-inlined-macro.rs diff --git a/tests/ui/rfc-2091-track-caller/only-for-fns.rs b/tests/ui/rfcs/rfc-2091-track-caller/only-for-fns.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/only-for-fns.rs rename to tests/ui/rfcs/rfc-2091-track-caller/only-for-fns.rs diff --git a/tests/ui/rfc-2091-track-caller/only-for-fns.stderr b/tests/ui/rfcs/rfc-2091-track-caller/only-for-fns.stderr similarity index 100% rename from tests/ui/rfc-2091-track-caller/only-for-fns.stderr rename to tests/ui/rfcs/rfc-2091-track-caller/only-for-fns.stderr diff --git a/tests/ui/rfc-2091-track-caller/pass.rs b/tests/ui/rfcs/rfc-2091-track-caller/pass.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/pass.rs rename to tests/ui/rfcs/rfc-2091-track-caller/pass.rs diff --git a/tests/ui/rfc-2091-track-caller/std-panic-locations.rs b/tests/ui/rfcs/rfc-2091-track-caller/std-panic-locations.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/std-panic-locations.rs rename to tests/ui/rfcs/rfc-2091-track-caller/std-panic-locations.rs diff --git a/tests/ui/rfc-2091-track-caller/track-caller-attribute.rs b/tests/ui/rfcs/rfc-2091-track-caller/track-caller-attribute.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/track-caller-attribute.rs rename to tests/ui/rfcs/rfc-2091-track-caller/track-caller-attribute.rs diff --git a/tests/ui/rfc-2091-track-caller/track-caller-ffi.rs b/tests/ui/rfcs/rfc-2091-track-caller/track-caller-ffi.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/track-caller-ffi.rs rename to tests/ui/rfcs/rfc-2091-track-caller/track-caller-ffi.rs diff --git a/tests/ui/rfc-2091-track-caller/tracked-closure.rs b/tests/ui/rfcs/rfc-2091-track-caller/tracked-closure.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/tracked-closure.rs rename to tests/ui/rfcs/rfc-2091-track-caller/tracked-closure.rs diff --git a/tests/ui/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs b/tests/ui/rfcs/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs rename to tests/ui/rfcs/rfc-2091-track-caller/tracked-fn-ptr-with-arg.rs diff --git a/tests/ui/rfc-2091-track-caller/tracked-fn-ptr.rs b/tests/ui/rfcs/rfc-2091-track-caller/tracked-fn-ptr.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/tracked-fn-ptr.rs rename to tests/ui/rfcs/rfc-2091-track-caller/tracked-fn-ptr.rs diff --git a/tests/ui/rfc-2091-track-caller/tracked-trait-impls.rs b/tests/ui/rfcs/rfc-2091-track-caller/tracked-trait-impls.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/tracked-trait-impls.rs rename to tests/ui/rfcs/rfc-2091-track-caller/tracked-trait-impls.rs diff --git a/tests/ui/rfc-2091-track-caller/tracked-trait-obj.rs b/tests/ui/rfcs/rfc-2091-track-caller/tracked-trait-obj.rs similarity index 100% rename from tests/ui/rfc-2091-track-caller/tracked-trait-obj.rs rename to tests/ui/rfcs/rfc-2091-track-caller/tracked-trait-obj.rs diff --git a/tests/ui/rfc-2093-infer-outlives/cross-crate.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/cross-crate.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/cross-crate.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/cross-crate.rs diff --git a/tests/ui/rfc-2093-infer-outlives/cross-crate.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/cross-crate.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/cross-crate.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/cross-crate.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/dont-infer-static.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/dont-infer-static.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/dont-infer-static.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/dont-infer-static.rs diff --git a/tests/ui/rfc-2093-infer-outlives/dont-infer-static.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/dont-infer-static.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/dont-infer-static.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/dont-infer-static.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/enum.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/enum.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/enum.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/enum.rs diff --git a/tests/ui/rfc-2093-infer-outlives/enum.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/enum.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/enum.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/enum.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-dyn.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-dyn.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/explicit-dyn.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/explicit-dyn.rs diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-dyn.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-dyn.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/explicit-dyn.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/explicit-dyn.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-enum.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-enum.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/explicit-enum.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/explicit-enum.rs diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-enum.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-enum.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/explicit-enum.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/explicit-enum.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-projection.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-projection.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/explicit-projection.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/explicit-projection.rs diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-projection.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-projection.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/explicit-projection.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/explicit-projection.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-struct.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-struct.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/explicit-struct.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/explicit-struct.rs diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-struct.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-struct.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/explicit-struct.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/explicit-struct.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-union.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-union.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/explicit-union.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/explicit-union.rs diff --git a/tests/ui/rfc-2093-infer-outlives/explicit-union.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/explicit-union.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/explicit-union.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/explicit-union.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/issue-54467.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/issue-54467.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/issue-54467.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/issue-54467.rs diff --git a/tests/ui/rfc-2093-infer-outlives/nested-enum.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-enum.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/nested-enum.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/nested-enum.rs diff --git a/tests/ui/rfc-2093-infer-outlives/nested-enum.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-enum.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/nested-enum.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/nested-enum.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/nested-regions.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-regions.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/nested-regions.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/nested-regions.rs diff --git a/tests/ui/rfc-2093-infer-outlives/nested-regions.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-regions.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/nested-regions.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/nested-regions.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/nested-structs.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-structs.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/nested-structs.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/nested-structs.rs diff --git a/tests/ui/rfc-2093-infer-outlives/nested-structs.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-structs.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/nested-structs.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/nested-structs.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/nested-union.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-union.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/nested-union.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/nested-union.rs diff --git a/tests/ui/rfc-2093-infer-outlives/nested-union.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/nested-union.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/nested-union.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/nested-union.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/privacy.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/privacy.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/privacy.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/privacy.rs diff --git a/tests/ui/rfc-2093-infer-outlives/projection.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/projection.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/projection.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/projection.rs diff --git a/tests/ui/rfc-2093-infer-outlives/projection.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/projection.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/projection.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/projection.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/reference.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/reference.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/reference.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/reference.rs diff --git a/tests/ui/rfc-2093-infer-outlives/reference.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/reference.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/reference.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/reference.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-enum-not-wf.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/regions-enum-not-wf.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/regions-enum-not-wf.rs diff --git a/tests/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-enum-not-wf.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/regions-enum-not-wf.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/regions-enum-not-wf.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.rs diff --git a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region-rev.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.rs diff --git a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-region.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.rs diff --git a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type-rev.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.rs diff --git a/tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/regions-outlives-nominal-type-type.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/regions-struct-not-wf.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-struct-not-wf.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/regions-struct-not-wf.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/regions-struct-not-wf.rs diff --git a/tests/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/regions-struct-not-wf.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/regions-struct-not-wf.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/regions-struct-not-wf.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/self-dyn.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/self-dyn.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/self-dyn.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/self-dyn.rs diff --git a/tests/ui/rfc-2093-infer-outlives/self-dyn.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/self-dyn.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/self-dyn.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/self-dyn.stderr diff --git a/tests/ui/rfc-2093-infer-outlives/self-structs.rs b/tests/ui/rfcs/rfc-2093-infer-outlives/self-structs.rs similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/self-structs.rs rename to tests/ui/rfcs/rfc-2093-infer-outlives/self-structs.rs diff --git a/tests/ui/rfc-2093-infer-outlives/self-structs.stderr b/tests/ui/rfcs/rfc-2093-infer-outlives/self-structs.stderr similarity index 100% rename from tests/ui/rfc-2093-infer-outlives/self-structs.stderr rename to tests/ui/rfcs/rfc-2093-infer-outlives/self-structs.stderr diff --git a/tests/ui/rfc-2126-crate-paths/crate-path-non-absolute.rs b/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.rs similarity index 100% rename from tests/ui/rfc-2126-crate-paths/crate-path-non-absolute.rs rename to tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.rs diff --git a/tests/ui/rfc-2126-crate-paths/crate-path-non-absolute.stderr b/tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.stderr similarity index 100% rename from tests/ui/rfc-2126-crate-paths/crate-path-non-absolute.stderr rename to tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.stderr diff --git a/tests/ui/rfc-2126-crate-paths/keyword-crate-as-identifier.rs b/tests/ui/rfcs/rfc-2126-crate-paths/keyword-crate-as-identifier.rs similarity index 100% rename from tests/ui/rfc-2126-crate-paths/keyword-crate-as-identifier.rs rename to tests/ui/rfcs/rfc-2126-crate-paths/keyword-crate-as-identifier.rs diff --git a/tests/ui/rfc-2126-crate-paths/keyword-crate-as-identifier.stderr b/tests/ui/rfcs/rfc-2126-crate-paths/keyword-crate-as-identifier.stderr similarity index 100% rename from tests/ui/rfc-2126-crate-paths/keyword-crate-as-identifier.stderr rename to tests/ui/rfcs/rfc-2126-crate-paths/keyword-crate-as-identifier.stderr diff --git a/tests/ui/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs similarity index 100% rename from tests/ui/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs rename to tests/ui/rfcs/rfc-2126-extern-absolute-paths/auxiliary/xcrate.rs diff --git a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-1.rs b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-1.rs similarity index 100% rename from tests/ui/rfc-2126-extern-absolute-paths/non-existent-1.rs rename to tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-1.rs diff --git a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-1.stderr b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-1.stderr similarity index 100% rename from tests/ui/rfc-2126-extern-absolute-paths/non-existent-1.stderr rename to tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-1.stderr diff --git a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-2.rs b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.rs similarity index 100% rename from tests/ui/rfc-2126-extern-absolute-paths/non-existent-2.rs rename to tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.rs diff --git a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-2.stderr b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.stderr similarity index 100% rename from tests/ui/rfc-2126-extern-absolute-paths/non-existent-2.stderr rename to tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.stderr diff --git a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-3.rs b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-3.rs similarity index 100% rename from tests/ui/rfc-2126-extern-absolute-paths/non-existent-3.rs rename to tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-3.rs diff --git a/tests/ui/rfc-2126-extern-absolute-paths/non-existent-3.stderr b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-3.stderr similarity index 100% rename from tests/ui/rfc-2126-extern-absolute-paths/non-existent-3.stderr rename to tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-3.stderr diff --git a/tests/ui/rfc-2126-extern-absolute-paths/not-allowed.rs b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/not-allowed.rs similarity index 100% rename from tests/ui/rfc-2126-extern-absolute-paths/not-allowed.rs rename to tests/ui/rfcs/rfc-2126-extern-absolute-paths/not-allowed.rs diff --git a/tests/ui/rfc-2126-extern-absolute-paths/not-allowed.stderr b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/not-allowed.stderr similarity index 100% rename from tests/ui/rfc-2126-extern-absolute-paths/not-allowed.stderr rename to tests/ui/rfcs/rfc-2126-extern-absolute-paths/not-allowed.stderr diff --git a/tests/ui/rfc-2126-extern-absolute-paths/single-segment.rs b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/single-segment.rs similarity index 100% rename from tests/ui/rfc-2126-extern-absolute-paths/single-segment.rs rename to tests/ui/rfcs/rfc-2126-extern-absolute-paths/single-segment.rs diff --git a/tests/ui/rfc-2126-extern-absolute-paths/single-segment.stderr b/tests/ui/rfcs/rfc-2126-extern-absolute-paths/single-segment.stderr similarity index 100% rename from tests/ui/rfc-2126-extern-absolute-paths/single-segment.stderr rename to tests/ui/rfcs/rfc-2126-extern-absolute-paths/single-segment.stderr diff --git a/tests/ui/rfc-2294-if-let-guard/bindings.rs b/tests/ui/rfcs/rfc-2294-if-let-guard/bindings.rs similarity index 100% rename from tests/ui/rfc-2294-if-let-guard/bindings.rs rename to tests/ui/rfcs/rfc-2294-if-let-guard/bindings.rs diff --git a/tests/ui/rfc-2294-if-let-guard/bindings.stderr b/tests/ui/rfcs/rfc-2294-if-let-guard/bindings.stderr similarity index 100% rename from tests/ui/rfc-2294-if-let-guard/bindings.stderr rename to tests/ui/rfcs/rfc-2294-if-let-guard/bindings.stderr diff --git a/tests/ui/rfc-2294-if-let-guard/feature-gate.rs b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs similarity index 100% rename from tests/ui/rfc-2294-if-let-guard/feature-gate.rs rename to tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.rs diff --git a/tests/ui/rfc-2294-if-let-guard/feature-gate.stderr b/tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.stderr similarity index 100% rename from tests/ui/rfc-2294-if-let-guard/feature-gate.stderr rename to tests/ui/rfcs/rfc-2294-if-let-guard/feature-gate.stderr diff --git a/tests/ui/rfc-2294-if-let-guard/run-pass.rs b/tests/ui/rfcs/rfc-2294-if-let-guard/run-pass.rs similarity index 100% rename from tests/ui/rfc-2294-if-let-guard/run-pass.rs rename to tests/ui/rfcs/rfc-2294-if-let-guard/run-pass.rs diff --git a/tests/ui/rfc-2294-if-let-guard/typeck.rs b/tests/ui/rfcs/rfc-2294-if-let-guard/typeck.rs similarity index 100% rename from tests/ui/rfc-2294-if-let-guard/typeck.rs rename to tests/ui/rfcs/rfc-2294-if-let-guard/typeck.rs diff --git a/tests/ui/rfc-2294-if-let-guard/typeck.stderr b/tests/ui/rfcs/rfc-2294-if-let-guard/typeck.stderr similarity index 100% rename from tests/ui/rfc-2294-if-let-guard/typeck.stderr rename to tests/ui/rfcs/rfc-2294-if-let-guard/typeck.stderr diff --git a/tests/ui/rfc-2294-if-let-guard/warns.rs b/tests/ui/rfcs/rfc-2294-if-let-guard/warns.rs similarity index 100% rename from tests/ui/rfc-2294-if-let-guard/warns.rs rename to tests/ui/rfcs/rfc-2294-if-let-guard/warns.rs diff --git a/tests/ui/rfc-2294-if-let-guard/warns.stderr b/tests/ui/rfcs/rfc-2294-if-let-guard/warns.stderr similarity index 100% rename from tests/ui/rfc-2294-if-let-guard/warns.stderr rename to tests/ui/rfcs/rfc-2294-if-let-guard/warns.stderr diff --git a/tests/ui/rfcs/rfc-2302-self-struct-ctor.rs b/tests/ui/rfcs/rfc-2302-self-struct-ctor/rfc-2302-self-struct-ctor.rs similarity index 100% rename from tests/ui/rfcs/rfc-2302-self-struct-ctor.rs rename to tests/ui/rfcs/rfc-2302-self-struct-ctor/rfc-2302-self-struct-ctor.rs diff --git a/tests/ui/rfc-2306/convert-id-const-with-gate.rs b/tests/ui/rfcs/rfc-2306-convert-id/convert-id-const-with-gate.rs similarity index 100% rename from tests/ui/rfc-2306/convert-id-const-with-gate.rs rename to tests/ui/rfcs/rfc-2306-convert-id/convert-id-const-with-gate.rs diff --git a/tests/ui/rfc-2361-dbg-macro/dbg-macro-expected-behavior.rs b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-expected-behavior.rs similarity index 100% rename from tests/ui/rfc-2361-dbg-macro/dbg-macro-expected-behavior.rs rename to tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-expected-behavior.rs diff --git a/tests/ui/rfc-2361-dbg-macro/dbg-macro-expected-behavior.run.stderr b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-expected-behavior.run.stderr similarity index 100% rename from tests/ui/rfc-2361-dbg-macro/dbg-macro-expected-behavior.run.stderr rename to tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-expected-behavior.run.stderr diff --git a/tests/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs similarity index 100% rename from tests/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs rename to tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.rs diff --git a/tests/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr similarity index 100% rename from tests/ui/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr rename to tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-move-semantics.stderr diff --git a/tests/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs similarity index 100% rename from tests/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs rename to tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-requires-debug.rs diff --git a/tests/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr b/tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr similarity index 100% rename from tests/ui/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr rename to tests/ui/rfcs/rfc-2361-dbg-macro/dbg-macro-requires-debug.stderr diff --git a/tests/ui/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.rs b/tests/ui/rfcs/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.rs similarity index 100% rename from tests/ui/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.rs rename to tests/ui/rfcs/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.rs diff --git a/tests/ui/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.stderr b/tests/ui/rfcs/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.stderr similarity index 100% rename from tests/ui/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.stderr rename to tests/ui/rfcs/rfc-2397-do-not-recommend/feature-gate-do_not_recommend.stderr diff --git a/tests/ui/rfc-2397-do-not-recommend/incorrect-locations.rs b/tests/ui/rfcs/rfc-2397-do-not-recommend/incorrect-locations.rs similarity index 100% rename from tests/ui/rfc-2397-do-not-recommend/incorrect-locations.rs rename to tests/ui/rfcs/rfc-2397-do-not-recommend/incorrect-locations.rs diff --git a/tests/ui/rfc-2397-do-not-recommend/incorrect-locations.stderr b/tests/ui/rfcs/rfc-2397-do-not-recommend/incorrect-locations.stderr similarity index 100% rename from tests/ui/rfc-2397-do-not-recommend/incorrect-locations.stderr rename to tests/ui/rfcs/rfc-2397-do-not-recommend/incorrect-locations.stderr diff --git a/tests/ui/rfc-2397-do-not-recommend/unstable-feature.rs b/tests/ui/rfcs/rfc-2397-do-not-recommend/unstable-feature.rs similarity index 100% rename from tests/ui/rfc-2397-do-not-recommend/unstable-feature.rs rename to tests/ui/rfcs/rfc-2397-do-not-recommend/unstable-feature.rs diff --git a/tests/ui/rfc-2397-do-not-recommend/unstable-feature.stderr b/tests/ui/rfcs/rfc-2397-do-not-recommend/unstable-feature.stderr similarity index 100% rename from tests/ui/rfc-2397-do-not-recommend/unstable-feature.stderr rename to tests/ui/rfcs/rfc-2397-do-not-recommend/unstable-feature.stderr diff --git a/tests/ui/rfcs/rfc-2421-unreserve-pure-offsetof-sizeof-alignof.rs b/tests/ui/rfcs/rfc-2421-unreserve-pure-offsetof-sizeof-alignof/offsetof-alignof-sizeof-pure-can-be-used-as-idents.rs similarity index 100% rename from tests/ui/rfcs/rfc-2421-unreserve-pure-offsetof-sizeof-alignof.rs rename to tests/ui/rfcs/rfc-2421-unreserve-pure-offsetof-sizeof-alignof/offsetof-alignof-sizeof-pure-can-be-used-as-idents.rs diff --git a/tests/ui/rfc-2457/auxiliary/mod_file_nonascii_with_path_allowed-aux.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/auxiliary/mod_file_nonascii_with_path_allowed-aux.rs similarity index 100% rename from tests/ui/rfc-2457/auxiliary/mod_file_nonascii_with_path_allowed-aux.rs rename to tests/ui/rfcs/rfc-2457-non-ascii-idents/auxiliary/mod_file_nonascii_with_path_allowed-aux.rs diff --git a/tests/ui/rfc-2457/crate_name_nonascii_forbidden-1.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-1.rs similarity index 100% rename from tests/ui/rfc-2457/crate_name_nonascii_forbidden-1.rs rename to tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-1.rs diff --git a/tests/ui/rfc-2457/crate_name_nonascii_forbidden-1.stderr b/tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-1.stderr similarity index 100% rename from tests/ui/rfc-2457/crate_name_nonascii_forbidden-1.stderr rename to tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-1.stderr diff --git a/tests/ui/rfc-2457/crate_name_nonascii_forbidden-2.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-2.rs similarity index 100% rename from tests/ui/rfc-2457/crate_name_nonascii_forbidden-2.rs rename to tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-2.rs diff --git a/tests/ui/rfc-2457/crate_name_nonascii_forbidden-2.stderr b/tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-2.stderr similarity index 100% rename from tests/ui/rfc-2457/crate_name_nonascii_forbidden-2.stderr rename to tests/ui/rfcs/rfc-2457-non-ascii-idents/crate_name_nonascii_forbidden-2.stderr diff --git a/tests/ui/rfc-2457/extern_block_nonascii_forbidden.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/extern_block_nonascii_forbidden.rs similarity index 100% rename from tests/ui/rfc-2457/extern_block_nonascii_forbidden.rs rename to tests/ui/rfcs/rfc-2457-non-ascii-idents/extern_block_nonascii_forbidden.rs diff --git a/tests/ui/rfc-2457/extern_block_nonascii_forbidden.stderr b/tests/ui/rfcs/rfc-2457-non-ascii-idents/extern_block_nonascii_forbidden.stderr similarity index 100% rename from tests/ui/rfc-2457/extern_block_nonascii_forbidden.stderr rename to tests/ui/rfcs/rfc-2457-non-ascii-idents/extern_block_nonascii_forbidden.stderr diff --git a/tests/ui/rfc-2457/idents-normalized.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/idents-normalized.rs similarity index 100% rename from tests/ui/rfc-2457/idents-normalized.rs rename to tests/ui/rfcs/rfc-2457-non-ascii-idents/idents-normalized.rs diff --git a/tests/ui/rfc-2457/mod_file_nonascii_forbidden.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_forbidden.rs similarity index 100% rename from tests/ui/rfc-2457/mod_file_nonascii_forbidden.rs rename to tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_forbidden.rs diff --git a/tests/ui/rfc-2457/mod_file_nonascii_forbidden.stderr b/tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_forbidden.stderr similarity index 100% rename from tests/ui/rfc-2457/mod_file_nonascii_forbidden.stderr rename to tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_forbidden.stderr diff --git a/tests/ui/rfc-2457/mod_file_nonascii_with_path_allowed.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_with_path_allowed.rs similarity index 100% rename from tests/ui/rfc-2457/mod_file_nonascii_with_path_allowed.rs rename to tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_file_nonascii_with_path_allowed.rs diff --git a/tests/ui/rfc-2457/mod_inline_nonascii_allowed.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_inline_nonascii_allowed.rs similarity index 100% rename from tests/ui/rfc-2457/mod_inline_nonascii_allowed.rs rename to tests/ui/rfcs/rfc-2457-non-ascii-idents/mod_inline_nonascii_allowed.rs diff --git a/tests/ui/rfc-2457/no_mangle_nonascii_forbidden.rs b/tests/ui/rfcs/rfc-2457-non-ascii-idents/no_mangle_nonascii_forbidden.rs similarity index 100% rename from tests/ui/rfc-2457/no_mangle_nonascii_forbidden.rs rename to tests/ui/rfcs/rfc-2457-non-ascii-idents/no_mangle_nonascii_forbidden.rs diff --git a/tests/ui/rfc-2457/no_mangle_nonascii_forbidden.stderr b/tests/ui/rfcs/rfc-2457-non-ascii-idents/no_mangle_nonascii_forbidden.stderr similarity index 100% rename from tests/ui/rfc-2457/no_mangle_nonascii_forbidden.stderr rename to tests/ui/rfcs/rfc-2457-non-ascii-idents/no_mangle_nonascii_forbidden.stderr diff --git a/tests/ui/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs rename to tests/ui/rfcs/rfc-2497-if-let-chains/ast-lowering-does-not-wrap-let-chains.rs diff --git a/tests/ui/rfc-2497-if-let-chains/ast-pretty-check.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.rs similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/ast-pretty-check.rs rename to tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.rs diff --git a/tests/ui/rfc-2497-if-let-chains/ast-pretty-check.stdout b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.stdout similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/ast-pretty-check.stdout rename to tests/ui/rfcs/rfc-2497-if-let-chains/ast-pretty-check.stdout diff --git a/tests/ui/rfc-2497-if-let-chains/ast-validate-guards.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.rs similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/ast-validate-guards.rs rename to tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.rs diff --git a/tests/ui/rfc-2497-if-let-chains/ast-validate-guards.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.stderr similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/ast-validate-guards.stderr rename to tests/ui/rfcs/rfc-2497-if-let-chains/ast-validate-guards.stderr diff --git a/tests/ui/rfc-2497-if-let-chains/chains-without-let.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/chains-without-let.rs similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/chains-without-let.rs rename to tests/ui/rfcs/rfc-2497-if-let-chains/chains-without-let.rs diff --git a/tests/ui/rfc-2497-if-let-chains/chains-without-let.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/chains-without-let.stderr similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/chains-without-let.stderr rename to tests/ui/rfcs/rfc-2497-if-let-chains/chains-without-let.stderr diff --git a/tests/ui/rfc-2497-if-let-chains/disallowed-positions.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/disallowed-positions.rs rename to tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.rs diff --git a/tests/ui/rfc-2497-if-let-chains/disallowed-positions.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.stderr similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/disallowed-positions.stderr rename to tests/ui/rfcs/rfc-2497-if-let-chains/disallowed-positions.stderr diff --git a/tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs rename to tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.rs diff --git a/tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr rename to tests/ui/rfcs/rfc-2497-if-let-chains/ensure-that-let-else-does-not-interact-with-let-chains.stderr diff --git a/tests/ui/rfc-2497-if-let-chains/feature-gate.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/feature-gate.rs rename to tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.rs diff --git a/tests/ui/rfc-2497-if-let-chains/feature-gate.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.stderr similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/feature-gate.stderr rename to tests/ui/rfcs/rfc-2497-if-let-chains/feature-gate.stderr diff --git a/tests/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs rename to tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.rs diff --git a/tests/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr rename to tests/ui/rfcs/rfc-2497-if-let-chains/invalid-let-in-a-valid-let-context.stderr diff --git a/tests/ui/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr rename to tests/ui/rfcs/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr diff --git a/tests/ui/rfc-2497-if-let-chains/irrefutable-lets.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/irrefutable-lets.rs similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/irrefutable-lets.rs rename to tests/ui/rfcs/rfc-2497-if-let-chains/irrefutable-lets.rs diff --git a/tests/ui/rfc-2497-if-let-chains/issue-88498.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-88498.rs similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/issue-88498.rs rename to tests/ui/rfcs/rfc-2497-if-let-chains/issue-88498.rs diff --git a/tests/ui/rfc-2497-if-let-chains/issue-90722.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-90722.rs similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/issue-90722.rs rename to tests/ui/rfcs/rfc-2497-if-let-chains/issue-90722.rs diff --git a/tests/ui/rfc-2497-if-let-chains/issue-92145.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-92145.rs similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/issue-92145.rs rename to tests/ui/rfcs/rfc-2497-if-let-chains/issue-92145.rs diff --git a/tests/ui/rfc-2497-if-let-chains/issue-93150.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-93150.rs similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/issue-93150.rs rename to tests/ui/rfcs/rfc-2497-if-let-chains/issue-93150.rs diff --git a/tests/ui/rfc-2497-if-let-chains/issue-93150.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-93150.stderr similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/issue-93150.stderr rename to tests/ui/rfcs/rfc-2497-if-let-chains/issue-93150.stderr diff --git a/tests/ui/rfc-2497-if-let-chains/issue-99938.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/issue-99938.rs similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/issue-99938.rs rename to tests/ui/rfcs/rfc-2497-if-let-chains/issue-99938.rs diff --git a/tests/ui/rfc-2497-if-let-chains/no-double-assigments.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/no-double-assigments.rs similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/no-double-assigments.rs rename to tests/ui/rfcs/rfc-2497-if-let-chains/no-double-assigments.rs diff --git a/tests/ui/rfc-2497-if-let-chains/protect-precedences.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/protect-precedences.rs similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/protect-precedences.rs rename to tests/ui/rfcs/rfc-2497-if-let-chains/protect-precedences.rs diff --git a/tests/ui/rfc-2497-if-let-chains/protect-precedences.stderr b/tests/ui/rfcs/rfc-2497-if-let-chains/protect-precedences.stderr similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/protect-precedences.stderr rename to tests/ui/rfcs/rfc-2497-if-let-chains/protect-precedences.stderr diff --git a/tests/ui/rfc-2497-if-let-chains/then-else-blocks.rs b/tests/ui/rfcs/rfc-2497-if-let-chains/then-else-blocks.rs similarity index 100% rename from tests/ui/rfc-2497-if-let-chains/then-else-blocks.rs rename to tests/ui/rfcs/rfc-2497-if-let-chains/then-else-blocks.rs diff --git a/tests/ui/rfc-2565-param-attrs/attr-without-param.rs b/tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.rs similarity index 100% rename from tests/ui/rfc-2565-param-attrs/attr-without-param.rs rename to tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.rs diff --git a/tests/ui/rfc-2565-param-attrs/attr-without-param.stderr b/tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.stderr similarity index 100% rename from tests/ui/rfc-2565-param-attrs/attr-without-param.stderr rename to tests/ui/rfcs/rfc-2565-param-attrs/attr-without-param.stderr diff --git a/tests/ui/rfc-2565-param-attrs/auxiliary/ident-mac.rs b/tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/ident-mac.rs similarity index 100% rename from tests/ui/rfc-2565-param-attrs/auxiliary/ident-mac.rs rename to tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/ident-mac.rs diff --git a/tests/ui/rfc-2565-param-attrs/auxiliary/param-attrs.rs b/tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/param-attrs.rs similarity index 100% rename from tests/ui/rfc-2565-param-attrs/auxiliary/param-attrs.rs rename to tests/ui/rfcs/rfc-2565-param-attrs/auxiliary/param-attrs.rs diff --git a/tests/ui/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs b/tests/ui/rfcs/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs similarity index 100% rename from tests/ui/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs rename to tests/ui/rfcs/rfc-2565-param-attrs/issue-64682-dropping-first-attrs-in-impl-fns.rs diff --git a/tests/ui/rfc-2565-param-attrs/param-attrs-2018.rs b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-2018.rs similarity index 100% rename from tests/ui/rfc-2565-param-attrs/param-attrs-2018.rs rename to tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-2018.rs diff --git a/tests/ui/rfc-2565-param-attrs/param-attrs-2018.stderr b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-2018.stderr similarity index 100% rename from tests/ui/rfc-2565-param-attrs/param-attrs-2018.stderr rename to tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-2018.stderr diff --git a/tests/ui/rfc-2565-param-attrs/param-attrs-allowed.rs b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-allowed.rs similarity index 100% rename from tests/ui/rfc-2565-param-attrs/param-attrs-allowed.rs rename to tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-allowed.rs diff --git a/tests/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs similarity index 100% rename from tests/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs rename to tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.rs diff --git a/tests/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr similarity index 100% rename from tests/ui/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr rename to tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-builtin-attrs.stderr diff --git a/tests/ui/rfc-2565-param-attrs/param-attrs-cfg.rs b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-cfg.rs similarity index 100% rename from tests/ui/rfc-2565-param-attrs/param-attrs-cfg.rs rename to tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-cfg.rs diff --git a/tests/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-cfg.stderr similarity index 100% rename from tests/ui/rfc-2565-param-attrs/param-attrs-cfg.stderr rename to tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-cfg.stderr diff --git a/tests/ui/rfc-2565-param-attrs/param-attrs-pretty.rs b/tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs similarity index 100% rename from tests/ui/rfc-2565-param-attrs/param-attrs-pretty.rs rename to tests/ui/rfcs/rfc-2565-param-attrs/param-attrs-pretty.rs diff --git a/tests/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs b/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs similarity index 100% rename from tests/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs rename to tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.rs diff --git a/tests/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr b/tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr similarity index 100% rename from tests/ui/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr rename to tests/ui/rfcs/rfc-2565-param-attrs/proc-macro-cannot-be-used.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/dlltool-failed.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/dlltool-failed.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.rs diff --git a/tests/ui/rfc-2627-raw-dylib/dlltool-failed.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/dlltool-failed.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/dlltool-failed.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.rs diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-invalid-format.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-multiple.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/import-name-type-multiple.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.rs diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-multiple.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/import-name-type-multiple.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-multiple.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.rs diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unknown-value.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.rs diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-unsupported-link-kind.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-x86-only.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/import-name-type-x86-only.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.rs diff --git a/tests/ui/rfc-2627-raw-dylib/import-name-type-x86-only.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/import-name-type-x86-only.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/import-name-type-x86-only.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/invalid-dlltool.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/invalid-dlltool.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.rs diff --git a/tests/ui/rfc-2627-raw-dylib/invalid-dlltool.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/invalid-dlltool.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/invalid-dlltool.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/link-ordinal-and-name.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.rs diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-and-name.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/link-ordinal-and-name.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-and-name.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.rs diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-invalid-format.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.rs diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-missing-argument.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-multiple.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/link-ordinal-multiple.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.rs diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-multiple.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/link-ordinal-multiple.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-multiple.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.rs diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-not-foreign-fn.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-too-large.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/link-ordinal-too-large.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.rs diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-too-large.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/link-ordinal-too-large.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-large.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.rs diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-too-many-arguments.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.rs diff --git a/tests/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/link-ordinal-unsupported-link-kind.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/multiple-declarations.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/multiple-declarations.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.rs diff --git a/tests/ui/rfc-2627-raw-dylib/multiple-declarations.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/multiple-declarations.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/multiple-declarations.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.rs diff --git a/tests/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/raw-dylib-windows-only.stderr diff --git a/tests/ui/rfc-2627-raw-dylib/unsupported-abi.rs b/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.rs similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/unsupported-abi.rs rename to tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.rs diff --git a/tests/ui/rfc-2627-raw-dylib/unsupported-abi.stderr b/tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.stderr similarity index 100% rename from tests/ui/rfc-2627-raw-dylib/unsupported-abi.stderr rename to tests/ui/rfcs/rfc-2627-raw-dylib/unsupported-abi.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/assoc-type-const-bound-usage.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/assoc-type-const-bound-usage.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type-const-bound-usage.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/assoc-type.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/assoc-type.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/assoc-type.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/assoc-type.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/assoc-type.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/attr-misuse.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/attr-misuse.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/attr-misuse.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/attr-misuse.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/attr-misuse.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/attr-misuse.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/attr-misuse.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/attr-misuse.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/cross-crate.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/auxiliary/staged-api.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/staged-api.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/auxiliary/staged-api.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/auxiliary/staged-api.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-fail.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call-const-trait-method-pass.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call-generic-in-impl.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-in-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call-generic-in-impl.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-in-impl.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-chain.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call-generic-method-chain.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-chain.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call-generic-method-chain.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-chain.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-dup-bound.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call-generic-method-fail.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call-generic-method-fail.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-fail.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst-bound.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-nonconst.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-pass.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call-generic-method-pass.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/call-generic-method-pass.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call-generic-method-pass.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call-generic-method-pass.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/call.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/call.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/call.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/call.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-and-non-const-impl.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-check-fns-in-const-impl.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/const-closure-parse-not-item.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-parse-not-item.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-closure-parse-not-item.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-parse-not-item.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method-fail.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-closure-trait-method.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-closure-trait-method.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const-closures.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-closures.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-closures.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-closures.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const-default-method-bodies.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-default-method-bodies.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const-default-method-bodies.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-default-method-bodies.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-default-method-bodies.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-drop-bound.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-bound.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.precise.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.precise.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.precise.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.precise.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stock.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-drop-fail-2.stock.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail-2.stock.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.precise.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-drop-fail.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop-fail.stock.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/const-drop.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-drop.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-drop.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const-impl-norecover.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-norecover.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-impl-norecover.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-norecover.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const-impl-norecover.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-norecover.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-impl-norecover.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-norecover.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/const-impl-recovery.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-recovery.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-impl-recovery.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-recovery.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const-impl-recovery.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-recovery.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-impl-recovery.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-recovery.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-requires-const-trait.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-requires-const-trait.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/const-impl-trait.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-impl-trait.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const-impl-trait.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const-impl-trait.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const-impl-trait.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-gate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-gate.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-gate.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-gate.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-gate.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-gate.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-gate.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-gate.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-non-const-type.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-use.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-use.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-use.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/const_derives/derive-const-with-params.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate-default-method-body-is-const.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.gatednc.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/cross-crate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/cross-crate.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/cross-crate.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stock.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/cross-crate.stock.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stock.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/cross-crate.stocknc.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-body-checking.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-same-trait-ck.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/default-method-body-is-const-with-staged-api.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/do-not-const-check-override.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check-override.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/do-not-const-check-override.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check-override.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/do-not-const-check.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/do-not-const-check.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/do-not-const-check.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/feature-gate.gated.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/feature-gate.gated.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/feature-gate.gated.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/feature-gate.gated.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/feature-gate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/feature-gate.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/feature-gate.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/feature-gate.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/feature-gate.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/feature-gate.stock.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/feature-gate.stock.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/feature-gate.stock.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/function-pointer-does-not-require-const.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/gate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/gate.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/gate.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/gate.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/gate.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/gate.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/gate.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/gate.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/generic-bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/generic-bound.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/generic-bound.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/generic-bound.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/generic-bound.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/generic-bound.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/generic-bound.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/generic-bound.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/hir-const-check.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/hir-const-check.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/hir-const-check.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/hir-const-check.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/hir-const-check.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/impl-tilde-const-trait.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/impl-tilde-const-trait.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/impl-tilde-const-trait.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/impl-tilde-const-trait.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/impl-tilde-const-trait.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/impl-tilde-const-trait.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/impl-tilde-const-trait.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/impl-tilde-const-trait.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/impl-with-default-fn-fail.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-fail.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/impl-with-default-fn-fail.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/impl-with-default-fn-fail.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-fail.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/impl-with-default-fn-fail.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/impl-with-default-fn-pass.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/inherent-impl-const-bounds.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/inherent-impl-const-bounds.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/inherent-impl-const-bounds.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/inherent-impl-const-bounds.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/inherent-impl.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/inherent-impl.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/inherent-impl.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/inherent-impl.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/inherent-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/inherent-impl.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/inherent-impl.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/inherent-impl.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-100222.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-100222.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/issue-100222.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/issue-100222.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-102156.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102156.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/issue-102156.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102156.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-102156.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102156.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/issue-102156.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102156.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-102985.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/issue-102985.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-102985.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/issue-102985.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/issue-102985.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-103677.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-103677.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/issue-103677.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/issue-103677.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-79450.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/issue-79450.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-79450.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/issue-79450.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/issue-79450.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-88155.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/issue-88155.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-88155.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/issue-88155.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/issue-88155.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-90052.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-90052.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/issue-90052.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/issue-90052.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-90052.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-90052.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/issue-90052.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/issue-90052.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-92111.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/issue-92111.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92111.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/issue-92230-wf-super-trait-env.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/nested-closure.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/nested-closure.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/nested-closure.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/nested-closure.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-const-closure-non-const-outer.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/non-const-op-in-closure-in-const.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-bound-non-const-specialized-bound.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-const-specialized.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/const-default-impl-non-const-specialized-impl.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/default-keyword.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/default-keyword.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/specialization/default-keyword.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/default-keyword.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95186-specialize-on-tilde-const.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/issue-95187-same-trait-bound-different-constness.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/specialization/non-const-default-const-specialized.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/specializing-constness-2.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/specializing-constness-2.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/specializing-constness-2.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/specializing-constness-2.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness-2.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/specializing-constness.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/specializing-constness.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/specializing-constness.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/specializing-constness.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/specializing-constness.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/staged-api-user-crate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api-user-crate.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/staged-api-user-crate.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api-user-crate.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/staged-api-user-crate.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api-user-crate.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/staged-api-user-crate.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api-user-crate.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/staged-api.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/staged-api.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/staged-api.stable.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.stable.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/staged-api.stable.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.stable.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/staged-api.unstable.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.unstable.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/staged-api.unstable.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/staged-api.unstable.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/static-const-trait-bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/static-const-trait-bound.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/static-const-trait-bound.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/static-const-trait-bound.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/std-impl-gate.gated.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.gated.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/std-impl-gate.gated.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.gated.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/std-impl-gate.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/std-impl-gate.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/std-impl-gate.stock.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.nn.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.ny.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yn.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-2.yy.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.nn.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.ny.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail-3.yn.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/super-traits-fail.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits-fail.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/super-traits-fail.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits-fail.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/super-traits.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/super-traits.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/super-traits.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/syntax.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/syntax.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/syntax.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/syntax.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-and-const-params.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-and-const-params.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-and-const-params.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/tilde-const-and-const-params.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-and-const-params.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-invalid-places.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-invalid-places.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/tilde-const-syntax.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-syntax.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/tilde-const-syntax.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-const-syntax.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/tilde-twice.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-twice.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/tilde-twice.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-twice.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/tilde-twice.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-twice.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/tilde-twice.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/tilde-twice.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/tilde_const_on_impl_bound.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/tilde_const_on_impl_bound.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/tilde_const_on_impl_bound.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/tilde_const_on_impl_bound.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-default-body-stability.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/trait-default-body-stability.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-default-body-stability.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/trait-default-body-stability.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-method-ptr-in-consts-ice.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-method-ptr-in-consts-ice.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/trait-method-ptr-in-consts-ice.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/trait-method-ptr-in-consts-ice.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause-const.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/trait-where-clause-const.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause-const.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/trait-where-clause-const.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause-run.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-run.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/trait-where-clause-run.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-run.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-self-referential.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/trait-where-clause.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/trait-where-clause.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause.stderr diff --git a/tests/ui/rfc-2632-const-trait-impl/without-tilde.rs b/tests/ui/rfcs/rfc-2632-const-trait-impl/without-tilde.rs similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/without-tilde.rs rename to tests/ui/rfcs/rfc-2632-const-trait-impl/without-tilde.rs diff --git a/tests/ui/rfc-2632-const-trait-impl/without-tilde.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/without-tilde.stderr similarity index 100% rename from tests/ui/rfc-2632-const-trait-impl/without-tilde.stderr rename to tests/ui/rfcs/rfc-2632-const-trait-impl/without-tilde.stderr From b694a033f08339a20ad071d878faa2aa91d8270e Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Mon, 29 May 2023 15:43:36 +0000 Subject: [PATCH 16/16] Bless tidy root entry limit --- src/tools/tidy/src/ui_tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 3e9bf18a28711..50c147da986ce 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -11,7 +11,7 @@ use std::path::{Path, PathBuf}; const ENTRY_LIMIT: usize = 900; // FIXME: The following limits should be reduced eventually. const ISSUES_ENTRY_LIMIT: usize = 1898; -const ROOT_ENTRY_LIMIT: usize = 894; +const ROOT_ENTRY_LIMIT: usize = 874; const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[ "rs", // test source files