From f00184e7fe7d4e8967abc96bf4c690859d44a9d1 Mon Sep 17 00:00:00 2001 From: Christian Poveda Date: Tue, 18 Nov 2025 19:07:16 -0500 Subject: [PATCH 01/15] Add a timeout to the `remote-test-client` connection --- src/tools/remote-test-client/src/main.rs | 27 ++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/tools/remote-test-client/src/main.rs b/src/tools/remote-test-client/src/main.rs index b9741431b5034..21043f0994574 100644 --- a/src/tools/remote-test-client/src/main.rs +++ b/src/tools/remote-test-client/src/main.rs @@ -11,12 +11,16 @@ use std::io::{self, BufWriter}; use std::net::TcpStream; use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; -use std::time::Duration; +use std::time::{Duration, Instant}; use std::{env, thread}; const REMOTE_ADDR_ENV: &str = "TEST_DEVICE_ADDR"; const DEFAULT_ADDR: &str = "127.0.0.1:12345"; +const CONNECT_TIMEOUT_ENV: &str = "TEST_DEVICE_CONNECT_TIMEOUT_SECONDS"; +/// The default timeout is high to not break slow CI or slow device starts. +const DEFAULT_CONNECT_TIMEOUT: Duration = Duration::from_mins(30); + macro_rules! t { ($e:expr) => { match $e { @@ -56,6 +60,17 @@ fn main() { } } +fn connect_timeout() -> Duration { + match env::var(CONNECT_TIMEOUT_ENV).ok() { + Some(timeout) => timeout.parse().map(Duration::from_secs).unwrap_or_else(|e| { + panic!( + "error: parsing `{CONNECT_TIMEOUT_ENV}` value \"{timeout}\" as seconds failed: {e}" + ) + }), + None => DEFAULT_CONNECT_TIMEOUT, + } +} + fn spawn_emulator(target: &str, server: &Path, tmpdir: &Path, rootfs: Option) { let device_address = env::var(REMOTE_ADDR_ENV).unwrap_or(DEFAULT_ADDR.to_string()); @@ -69,7 +84,10 @@ fn spawn_emulator(target: &str, server: &Path, tmpdir: &Path, rootfs: Option Date: Wed, 19 Nov 2025 13:21:13 -0500 Subject: [PATCH 02/15] Test the `remote-test-client` timeout --- src/tools/remote-test-client/tests/lib.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/tools/remote-test-client/tests/lib.rs b/src/tools/remote-test-client/tests/lib.rs index 663afbfb6c7dd..32726d230da95 100644 --- a/src/tools/remote-test-client/tests/lib.rs +++ b/src/tools/remote-test-client/tests/lib.rs @@ -8,3 +8,18 @@ fn test_help() { let stdout = String::from_utf8(output.stdout.clone()).unwrap(); assert!(stdout.trim().starts_with("Usage:")); } + +#[test] +fn test_timeout() { + let mut cmd = assert_cmd::cargo::cargo_bin_cmd!(); + cmd.env("TEST_DEVICE_CONNECT_TIMEOUT_SECONDS", "1"); + cmd.env("TEST_DEVICE_ADDR", "127.69.69.69:6969"); + cmd.args(["spawn-emulator", "dummy-target", "dummy-server", "dummy-tmpdir"]); + + let assert = cmd.assert().failure(); + let output = assert.get_output(); + + let stderr = String::from_utf8(output.stderr.clone()).unwrap(); + let pass_msg = "Gave up trying to connect to test device"; + assert!(stderr.contains(pass_msg), "Could not find `{pass_msg}` in `{stderr}`"); +} From 6bd5de70eece499ba157e38f23685dce09e5689f Mon Sep 17 00:00:00 2001 From: Christian Poveda Date: Thu, 6 Nov 2025 00:40:49 -0500 Subject: [PATCH 03/15] Document the new env variable in the rustc-dev-guide --- src/doc/rustc-dev-guide/src/tests/running.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/doc/rustc-dev-guide/src/tests/running.md b/src/doc/rustc-dev-guide/src/tests/running.md index 48ce9d8ad185b..74bcc01e28c14 100644 --- a/src/doc/rustc-dev-guide/src/tests/running.md +++ b/src/doc/rustc-dev-guide/src/tests/running.md @@ -321,6 +321,10 @@ Tests are built on the machine running `x` not on the remote machine. Tests which fail to build unexpectedly (or `ui` tests producing incorrect build output) may fail without ever running on the remote machine. +There is a default timeout of 30 minutes in case the `remote-test-server` +cannot be reached by the `x` command. This timeout can be modified by using the +`TEST_DEVICE_CONNECT_TIMEOUT_SECONDS` environment variable. + ## Testing on emulators Some platforms are tested via an emulator for architectures that aren't readily available. From b27bb8359275939608ce155f042c67dcd1bb7f39 Mon Sep 17 00:00:00 2001 From: Aditya-PS-05 Date: Fri, 28 Nov 2025 00:55:07 +0530 Subject: [PATCH 04/15] add regression test for align attribute on struct fields --- tests/ui/attributes/align-on-fields-143987.rs | 30 +++++++++++++++++ .../attributes/align-on-fields-143987.stderr | 33 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 tests/ui/attributes/align-on-fields-143987.rs create mode 100644 tests/ui/attributes/align-on-fields-143987.stderr diff --git a/tests/ui/attributes/align-on-fields-143987.rs b/tests/ui/attributes/align-on-fields-143987.rs new file mode 100644 index 0000000000000..387e8f80e54d2 --- /dev/null +++ b/tests/ui/attributes/align-on-fields-143987.rs @@ -0,0 +1,30 @@ +// Regression test for issue #143987 +// Ensure that using `#[align]` on struct fields produces an error +// instead of causing an ICE (Internal Compiler Error) + +// FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity +#![feature(rustc_attrs)] +#![feature(fn_align)] + +struct Data { + #[rustc_align(8)] //~ ERROR `#[rustc_align]` attribute cannot be used on struct fields + x: usize, +} + +// Test with invalid type to match the original issue more closely +struct DataInvalid { + #[rustc_align(8)] //~ ERROR `#[rustc_align]` attribute cannot be used on struct fields + x: usize8, //~ ERROR cannot find type `usize8` in this scope +} + +// Test with tuple struct +struct TupleData( + #[rustc_align(32)] //~ ERROR `#[rustc_align]` attribute cannot be used on struct fields + u32 +); + +// Test that it works correctly on functions (no error) +#[rustc_align(16)] +fn aligned_function() {} + +fn main() {} diff --git a/tests/ui/attributes/align-on-fields-143987.stderr b/tests/ui/attributes/align-on-fields-143987.stderr new file mode 100644 index 0000000000000..2356cdb1e5fb9 --- /dev/null +++ b/tests/ui/attributes/align-on-fields-143987.stderr @@ -0,0 +1,33 @@ +error[E0412]: cannot find type `usize8` in this scope + --> $DIR/align-on-fields-143987.rs:17:8 + | +LL | x: usize8, + | ^^^^^^ help: a builtin type with a similar name exists: `usize` + +error: `#[rustc_align]` attribute cannot be used on struct fields + --> $DIR/align-on-fields-143987.rs:10:5 + | +LL | #[rustc_align(8)] + | ^^^^^^^^^^^^^^^^^ + | + = help: `#[rustc_align]` can only be applied to functions + +error: `#[rustc_align]` attribute cannot be used on struct fields + --> $DIR/align-on-fields-143987.rs:16:5 + | +LL | #[rustc_align(8)] + | ^^^^^^^^^^^^^^^^^ + | + = help: `#[rustc_align]` can only be applied to functions + +error: `#[rustc_align]` attribute cannot be used on struct fields + --> $DIR/align-on-fields-143987.rs:22:5 + | +LL | #[rustc_align(32)] + | ^^^^^^^^^^^^^^^^^^ + | + = help: `#[rustc_align]` can only be applied to functions + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0412`. From 3ceea4768bed17c188ebc73866d5c2c13bf953e5 Mon Sep 17 00:00:00 2001 From: Aditya-PS-05 Date: Fri, 28 Nov 2025 01:15:22 +0530 Subject: [PATCH 05/15] add issue link in test --- tests/ui/attributes/align-on-fields-143987.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ui/attributes/align-on-fields-143987.rs b/tests/ui/attributes/align-on-fields-143987.rs index 387e8f80e54d2..7abd61a264995 100644 --- a/tests/ui/attributes/align-on-fields-143987.rs +++ b/tests/ui/attributes/align-on-fields-143987.rs @@ -1,4 +1,4 @@ -// Regression test for issue #143987 +// Regression test for issue https://github.com/rust-lang/rust/issues/143987 // Ensure that using `#[align]` on struct fields produces an error // instead of causing an ICE (Internal Compiler Error) From 3f943fbf8451100d5335612a6165bb152ae569a4 Mon Sep 17 00:00:00 2001 From: reddevilmidzy Date: Wed, 26 Nov 2025 01:47:42 +0900 Subject: [PATCH 06/15] Fix ICE when include_str! reads absolute path binary files --- compiler/rustc_parse/src/lib.rs | 7 +++++++ src/tools/tidy/src/ui_tests.rs | 1 + .../ui/include-macros/invalid-utf8-binary-file.bin | Bin 0 -> 5 bytes tests/ui/include-macros/invalid-utf8-binary-file.rs | 10 ++++++++++ .../include-macros/invalid-utf8-binary-file.stderr | 10 ++++++++++ 5 files changed, 28 insertions(+) create mode 100644 tests/ui/include-macros/invalid-utf8-binary-file.bin create mode 100644 tests/ui/include-macros/invalid-utf8-binary-file.rs create mode 100644 tests/ui/include-macros/invalid-utf8-binary-file.stderr diff --git a/compiler/rustc_parse/src/lib.rs b/compiler/rustc_parse/src/lib.rs index edec44ca95019..0992bee32f326 100644 --- a/compiler/rustc_parse/src/lib.rs +++ b/compiler/rustc_parse/src/lib.rs @@ -130,6 +130,13 @@ pub fn utf8_error( }; let contents = String::from_utf8_lossy(contents).to_string(); let source = sm.new_source_file(PathBuf::from(path).into(), contents); + + // Avoid out-of-bounds span from lossy UTF-8 conversion. + if start as u32 > source.normalized_source_len.0 { + err.note(note); + return; + } + let span = Span::with_root_ctxt( source.normalized_byte_pos(start as u32), source.normalized_byte_pos(start as u32), diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 45c2e76d1c1c0..bf51810810a6c 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -157,6 +157,7 @@ fn check_unexpected_extension(check: &mut RunningCheck, file_path: &Path, ext: & "tests/ui/crate-loading/auxiliary/libfoo.rlib", // testing loading a manually created rlib "tests/ui/include-macros/data.bin", // testing including data with the include macros "tests/ui/include-macros/file.txt", // testing including data with the include macros + "tests/ui/include-macros/invalid-utf8-binary-file.bin", // testing including data with the include macros "tests/ui/macros/macro-expanded-include/file.txt", // testing including data with the include macros "tests/ui/macros/not-utf8.bin", // testing including data with the include macros "tests/ui/macros/syntax-extension-source-utils-files/includeme.fragment", // more include diff --git a/tests/ui/include-macros/invalid-utf8-binary-file.bin b/tests/ui/include-macros/invalid-utf8-binary-file.bin new file mode 100644 index 0000000000000000000000000000000000000000..560c5cd2da23727f4f9e7b40d9bd96534390bd38 GIT binary patch literal 5 McmeZ`n!vyX00gK3LI3~& literal 0 HcmV?d00001 diff --git a/tests/ui/include-macros/invalid-utf8-binary-file.rs b/tests/ui/include-macros/invalid-utf8-binary-file.rs new file mode 100644 index 0000000000000..0bbdbac611fd0 --- /dev/null +++ b/tests/ui/include-macros/invalid-utf8-binary-file.rs @@ -0,0 +1,10 @@ +//@ normalize-stderr: "at byte `\d+`" -> "at byte `$$BYTE`" +//@ normalize-stderr: "`[^`\n]*invalid-utf8-binary-file\.bin`" -> "`$DIR/invalid-utf8-binary-file.bin`" +//@ rustc-env:INVALID_UTF8_BIN={{src-base}}/include-macros/invalid-utf8-binary-file.bin + +//! Ensure that ICE does not occur when reading an invalid UTF8 file with an absolute path. +//! regression test for issue + +#![doc = include_str!(concat!(env!("INVALID_UTF8_BIN")))] //~ ERROR: wasn't a utf-8 file + +fn main() {} diff --git a/tests/ui/include-macros/invalid-utf8-binary-file.stderr b/tests/ui/include-macros/invalid-utf8-binary-file.stderr new file mode 100644 index 0000000000000..4ac4def1b00a1 --- /dev/null +++ b/tests/ui/include-macros/invalid-utf8-binary-file.stderr @@ -0,0 +1,10 @@ +error: `/invalid-utf8-binary-file.bin` wasn't a utf-8 file + --> $DIR/invalid-utf8-binary-file.rs:8:10 + | +LL | #![doc = include_str!(concat!(env!("INVALID_UTF8_BIN")))] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: invalid utf-8 at byte `$BYTE` + +error: aborting due to 1 previous error + From bfc0c0204350f9677afb5351fe388296f29239e4 Mon Sep 17 00:00:00 2001 From: reddevilmidzy Date: Thu, 27 Nov 2025 20:58:07 +0900 Subject: [PATCH 07/15] Relocate macro_backtrace to macro and remove macro_backtrace --- tests/ui/README.md | 6 ------ tests/ui/{macro_backtrace => macros}/auxiliary/ping.rs | 10 +++++----- .../macro-backtrace-complex.-Zmacro-backtrace.stderr} | 6 +++--- .../macro-backtrace-complex.default.stderr} | 6 +++--- .../main.rs => macros/macro-backtrace-complex.rs} | 6 ++++-- 5 files changed, 15 insertions(+), 19 deletions(-) rename tests/ui/{macro_backtrace => macros}/auxiliary/ping.rs (71%) rename tests/ui/{macro_backtrace/main.-Zmacro-backtrace.stderr => macros/macro-backtrace-complex.-Zmacro-backtrace.stderr} (94%) rename tests/ui/{macro_backtrace/main.default.stderr => macros/macro-backtrace-complex.default.stderr} (90%) rename tests/ui/{macro_backtrace/main.rs => macros/macro-backtrace-complex.rs} (68%) diff --git a/tests/ui/README.md b/tests/ui/README.md index 6cec5a27d21ce..13b213f9cf797 100644 --- a/tests/ui/README.md +++ b/tests/ui/README.md @@ -891,12 +891,6 @@ Exercise *Link-Time Optimization* (LTO), involving the flags `-C lto` or `-Z thi Tests on changes to inference variable lattice LUB/GLB, see . -## `tests/ui/macro_backtrace/`: `-Zmacro-backtrace` - -Contains a single test, checking the unstable command-line flag to enable detailed macro backtraces. - -**FIXME**: This could be merged with `ui/macros`, which already contains other macro backtrace tests. - ## `tests/ui/macros/` Broad category of tests on macros. diff --git a/tests/ui/macro_backtrace/auxiliary/ping.rs b/tests/ui/macros/auxiliary/ping.rs similarity index 71% rename from tests/ui/macro_backtrace/auxiliary/ping.rs rename to tests/ui/macros/auxiliary/ping.rs index 25b9efbc93ac9..d009acb02adb1 100644 --- a/tests/ui/macro_backtrace/auxiliary/ping.rs +++ b/tests/ui/macros/auxiliary/ping.rs @@ -1,30 +1,30 @@ -// Test that the macro backtrace facility works (supporting file) +// Test that the macro backtrace facility works (supporting macro-backtrace-complex.rs) // a non-local macro #[macro_export] macro_rules! ping { () => { pong!(); - } + }; } #[macro_export] macro_rules! deep { () => { foo!(); - } + }; } #[macro_export] macro_rules! foo { () => { bar!(); - } + }; } #[macro_export] macro_rules! bar { () => { ping!(); - } + }; } diff --git a/tests/ui/macro_backtrace/main.-Zmacro-backtrace.stderr b/tests/ui/macros/macro-backtrace-complex.-Zmacro-backtrace.stderr similarity index 94% rename from tests/ui/macro_backtrace/main.-Zmacro-backtrace.stderr rename to tests/ui/macros/macro-backtrace-complex.-Zmacro-backtrace.stderr index bf85a2d75db23..18df7f4a67849 100644 --- a/tests/ui/macro_backtrace/main.-Zmacro-backtrace.stderr +++ b/tests/ui/macros/macro-backtrace-complex.-Zmacro-backtrace.stderr @@ -1,5 +1,5 @@ error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` - --> $DIR/main.rs:10:20 + --> $DIR/macro-backtrace-complex.rs:12:20 | LL | / macro_rules! pong { LL | | () => { syntax error }; @@ -11,7 +11,7 @@ LL | pong!(); | ------- in this macro invocation error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` - --> $DIR/main.rs:10:20 + --> $DIR/macro-backtrace-complex.rs:12:20 | LL | / macro_rules! pong { LL | | () => { syntax error }; @@ -31,7 +31,7 @@ LL | pong!(); | ------- in this macro invocation (#2) error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` - --> $DIR/main.rs:10:20 + --> $DIR/macro-backtrace-complex.rs:12:20 | LL | / macro_rules! pong { LL | | () => { syntax error }; diff --git a/tests/ui/macro_backtrace/main.default.stderr b/tests/ui/macros/macro-backtrace-complex.default.stderr similarity index 90% rename from tests/ui/macro_backtrace/main.default.stderr rename to tests/ui/macros/macro-backtrace-complex.default.stderr index 9ed4b3525e1d0..6aae85c1501ad 100644 --- a/tests/ui/macro_backtrace/main.default.stderr +++ b/tests/ui/macros/macro-backtrace-complex.default.stderr @@ -1,5 +1,5 @@ error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` - --> $DIR/main.rs:10:20 + --> $DIR/macro-backtrace-complex.rs:12:20 | LL | () => { syntax error }; | ^^^^^ expected one of 8 possible tokens @@ -10,7 +10,7 @@ LL | pong!(); = note: this error originates in the macro `pong` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` - --> $DIR/main.rs:10:20 + --> $DIR/macro-backtrace-complex.rs:12:20 | LL | () => { syntax error }; | ^^^^^ expected one of 8 possible tokens @@ -21,7 +21,7 @@ LL | ping!(); = note: this error originates in the macro `pong` which comes from the expansion of the macro `ping` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `error` - --> $DIR/main.rs:10:20 + --> $DIR/macro-backtrace-complex.rs:12:20 | LL | () => { syntax error }; | ^^^^^ expected one of 8 possible tokens diff --git a/tests/ui/macro_backtrace/main.rs b/tests/ui/macros/macro-backtrace-complex.rs similarity index 68% rename from tests/ui/macro_backtrace/main.rs rename to tests/ui/macros/macro-backtrace-complex.rs index e39cecb5938b4..3ab586f546531 100644 --- a/tests/ui/macro_backtrace/main.rs +++ b/tests/ui/macros/macro-backtrace-complex.rs @@ -1,9 +1,11 @@ -// Test that the macro backtrace facility works +// Test the unstable command-line flag (-Z macro-backtrace) to enable detailed macro backtraces +// across nested local and external macros. //@ aux-build:ping.rs //@ revisions: default -Zmacro-backtrace //@[-Zmacro-backtrace] compile-flags: -Z macro-backtrace -#[macro_use] extern crate ping; +#[macro_use] +extern crate ping; // a local macro macro_rules! pong { From 57f92698be7b1e2ee880535d7029f10b9e384815 Mon Sep 17 00:00:00 2001 From: Aditya-PS-05 Date: Fri, 28 Nov 2025 15:15:29 +0530 Subject: [PATCH 08/15] add test for borrow checker ICE with nested generic closures --- tests/ui/issues/issue-143821.rs | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 tests/ui/issues/issue-143821.rs diff --git a/tests/ui/issues/issue-143821.rs b/tests/ui/issues/issue-143821.rs new file mode 100644 index 0000000000000..f0e308da38718 --- /dev/null +++ b/tests/ui/issues/issue-143821.rs @@ -0,0 +1,39 @@ +//@ check-pass +// Regression test for issue https://github.com/rust-lang/rust/issues/143821 +// Tests that we don't ICE when borrow-checking nested closures with generic type parameters +// and late-bound lifetime parameters. + +fn data_(_: &()) -> &T { + loop {} +} + +fn register(f: F) -> IfaceToken +where + T: 'static, + F: FnOnce(&()), +{ + loop {} +} + +fn method_with_cr_async(cb: CB) +where + CB: Fn(), +{ + loop {} +} + +struct IfaceToken(T); + +fn foo() -> IfaceToken { + register::(|b: &()| { + method_with_cr_async(|| { + data_::(&()); + }); + }) +} + +struct A(); + +fn main() { + foo::(); +} From 6bbd73741529047995e754860c675c4ab0406dd5 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Fri, 28 Nov 2025 11:20:28 +0000 Subject: [PATCH 09/15] Remove test-float-parse from workspace list in tidy It is now part of the main workspace. --- src/tools/tidy/src/deps.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/tools/tidy/src/deps.rs b/src/tools/tidy/src/deps.rs index 5b34f393316f7..bac426495c2f7 100644 --- a/src/tools/tidy/src/deps.rs +++ b/src/tools/tidy/src/deps.rs @@ -168,12 +168,6 @@ pub(crate) const WORKSPACES: &[WorkspaceInfo<'static>] = &[ crates_and_deps: None, submodules: &["src/tools/rustc-perf"], }, - WorkspaceInfo { - path: "src/tools/test-float-parse", - exceptions: EXCEPTIONS, - crates_and_deps: None, - submodules: &[], - }, WorkspaceInfo { path: "tests/run-make-cargo/uefi-qemu/uefi_qemu_test", exceptions: EXCEPTIONS_UEFI_QEMU_TEST, From 58a802e629ec89aa86591aaad3d1ee22763d4c78 Mon Sep 17 00:00:00 2001 From: reddevilmidzy Date: Fri, 28 Nov 2025 14:27:44 +0900 Subject: [PATCH 10/15] Relocate modules_ans_files_visibity/mod_file_correct_spans.rs to modules/mod_file_correct_spans.rs --- tests/ui/modules/mod_file_aux.rs | 2 +- .../mod_file_correct_spans.rs | 0 .../mod_file_correct_spans.stderr | 0 tests/ui/modules_and_files_visibility/mod_file_aux.rs | 3 --- 4 files changed, 1 insertion(+), 4 deletions(-) rename tests/ui/{modules_and_files_visibility => modules}/mod_file_correct_spans.rs (100%) rename tests/ui/{modules_and_files_visibility => modules}/mod_file_correct_spans.stderr (100%) delete mode 100644 tests/ui/modules_and_files_visibility/mod_file_aux.rs diff --git a/tests/ui/modules/mod_file_aux.rs b/tests/ui/modules/mod_file_aux.rs index eec38d189b4a8..dba57c31b248c 100644 --- a/tests/ui/modules/mod_file_aux.rs +++ b/tests/ui/modules/mod_file_aux.rs @@ -1,3 +1,3 @@ -//@ ignore-auxiliary (used by `./mod_file_with_path_attr.rs` and `mod_file.rs`) +//@ ignore-auxiliary (used by `./mod_file_with_path_attr.rs` and `mod_file.rs` and `mod_file_correct_spans.rs`) pub fn foo() -> isize { 10 } diff --git a/tests/ui/modules_and_files_visibility/mod_file_correct_spans.rs b/tests/ui/modules/mod_file_correct_spans.rs similarity index 100% rename from tests/ui/modules_and_files_visibility/mod_file_correct_spans.rs rename to tests/ui/modules/mod_file_correct_spans.rs diff --git a/tests/ui/modules_and_files_visibility/mod_file_correct_spans.stderr b/tests/ui/modules/mod_file_correct_spans.stderr similarity index 100% rename from tests/ui/modules_and_files_visibility/mod_file_correct_spans.stderr rename to tests/ui/modules/mod_file_correct_spans.stderr diff --git a/tests/ui/modules_and_files_visibility/mod_file_aux.rs b/tests/ui/modules_and_files_visibility/mod_file_aux.rs deleted file mode 100644 index 6fac8dae3d766..0000000000000 --- a/tests/ui/modules_and_files_visibility/mod_file_aux.rs +++ /dev/null @@ -1,3 +0,0 @@ -//@ ignore-auxiliary (used by `./mod_file_correct_spans.rs`) - -pub fn foo() -> isize { 10 } From 8e74c6b137a7aac915a9356265862fa8abe4cd42 Mon Sep 17 00:00:00 2001 From: reddevilmidzy Date: Fri, 28 Nov 2025 14:54:12 +0900 Subject: [PATCH 11/15] Relocate modules_and_files_visibility/mod_file_disambig.rs to modules/mod_file_disambig.rs add fix --- tests/ui/README.md | 4 ---- tests/ui/modules/mod_file_aux.rs | 1 + tests/ui/modules/mod_file_disambig.rs | 5 ++++ tests/ui/modules/mod_file_disambig.stderr | 11 +++++++++ .../mod_file_disambig_aux.rs | 0 .../compiletest-ignore-dir | 0 .../mod_file_disambig_aux/mod.rs | 0 .../mod_file_disambig.rs | 6 ----- .../mod_file_disambig.stderr | 23 ------------------- 9 files changed, 17 insertions(+), 33 deletions(-) create mode 100644 tests/ui/modules/mod_file_disambig.rs create mode 100644 tests/ui/modules/mod_file_disambig.stderr rename tests/ui/{modules_and_files_visibility => modules}/mod_file_disambig_aux.rs (100%) rename tests/ui/{modules_and_files_visibility => modules}/mod_file_disambig_aux/compiletest-ignore-dir (100%) rename tests/ui/{modules_and_files_visibility => modules}/mod_file_disambig_aux/mod.rs (100%) delete mode 100644 tests/ui/modules_and_files_visibility/mod_file_disambig.rs delete mode 100644 tests/ui/modules_and_files_visibility/mod_file_disambig.stderr diff --git a/tests/ui/README.md b/tests/ui/README.md index 13b213f9cf797..b7496a39bccae 100644 --- a/tests/ui/README.md +++ b/tests/ui/README.md @@ -957,10 +957,6 @@ Tests on the module system. **FIXME**: `tests/ui/imports/` should probably be merged with this. -## `tests/ui/modules_and_files_visibility/` - -**FIXME**: Merge with `tests/ui/modules/`. - ## `tests/ui/moves` Tests on moves (destructive moves). diff --git a/tests/ui/modules/mod_file_aux.rs b/tests/ui/modules/mod_file_aux.rs index dba57c31b248c..9e2ec534eb169 100644 --- a/tests/ui/modules/mod_file_aux.rs +++ b/tests/ui/modules/mod_file_aux.rs @@ -1,3 +1,4 @@ //@ ignore-auxiliary (used by `./mod_file_with_path_attr.rs` and `mod_file.rs` and `mod_file_correct_spans.rs`) +// ignore-tidy-linelength pub fn foo() -> isize { 10 } diff --git a/tests/ui/modules/mod_file_disambig.rs b/tests/ui/modules/mod_file_disambig.rs new file mode 100644 index 0000000000000..e87babf03ba7f --- /dev/null +++ b/tests/ui/modules/mod_file_disambig.rs @@ -0,0 +1,5 @@ +//! related issue + +mod mod_file_disambig_aux; //~ ERROR file for module `mod_file_disambig_aux` found at both + +fn main() {} diff --git a/tests/ui/modules/mod_file_disambig.stderr b/tests/ui/modules/mod_file_disambig.stderr new file mode 100644 index 0000000000000..60b5b468f4975 --- /dev/null +++ b/tests/ui/modules/mod_file_disambig.stderr @@ -0,0 +1,11 @@ +error[E0761]: file for module `mod_file_disambig_aux` found at both "$DIR/mod_file_disambig_aux.rs" and "$DIR/mod_file_disambig_aux/mod.rs" + --> $DIR/mod_file_disambig.rs:3:1 + | +LL | mod mod_file_disambig_aux; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = help: delete or rename one of them to remove the ambiguity + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0761`. diff --git a/tests/ui/modules_and_files_visibility/mod_file_disambig_aux.rs b/tests/ui/modules/mod_file_disambig_aux.rs similarity index 100% rename from tests/ui/modules_and_files_visibility/mod_file_disambig_aux.rs rename to tests/ui/modules/mod_file_disambig_aux.rs diff --git a/tests/ui/modules_and_files_visibility/mod_file_disambig_aux/compiletest-ignore-dir b/tests/ui/modules/mod_file_disambig_aux/compiletest-ignore-dir similarity index 100% rename from tests/ui/modules_and_files_visibility/mod_file_disambig_aux/compiletest-ignore-dir rename to tests/ui/modules/mod_file_disambig_aux/compiletest-ignore-dir diff --git a/tests/ui/modules_and_files_visibility/mod_file_disambig_aux/mod.rs b/tests/ui/modules/mod_file_disambig_aux/mod.rs similarity index 100% rename from tests/ui/modules_and_files_visibility/mod_file_disambig_aux/mod.rs rename to tests/ui/modules/mod_file_disambig_aux/mod.rs diff --git a/tests/ui/modules_and_files_visibility/mod_file_disambig.rs b/tests/ui/modules_and_files_visibility/mod_file_disambig.rs deleted file mode 100644 index 1483e3e4630c2..0000000000000 --- a/tests/ui/modules_and_files_visibility/mod_file_disambig.rs +++ /dev/null @@ -1,6 +0,0 @@ -mod mod_file_disambig_aux; //~ ERROR file for module `mod_file_disambig_aux` found at both - -fn main() { - assert_eq!(mod_file_aux::bar(), 10); - //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `mod_file_aux` -} diff --git a/tests/ui/modules_and_files_visibility/mod_file_disambig.stderr b/tests/ui/modules_and_files_visibility/mod_file_disambig.stderr deleted file mode 100644 index e71a6de2fb9bc..0000000000000 --- a/tests/ui/modules_and_files_visibility/mod_file_disambig.stderr +++ /dev/null @@ -1,23 +0,0 @@ -error[E0761]: file for module `mod_file_disambig_aux` found at both "$DIR/mod_file_disambig_aux.rs" and "$DIR/mod_file_disambig_aux/mod.rs" - --> $DIR/mod_file_disambig.rs:1:1 - | -LL | mod mod_file_disambig_aux; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = help: delete or rename one of them to remove the ambiguity - -error[E0433]: failed to resolve: use of unresolved module or unlinked crate `mod_file_aux` - --> $DIR/mod_file_disambig.rs:4:16 - | -LL | assert_eq!(mod_file_aux::bar(), 10); - | ^^^^^^^^^^^^ use of unresolved module or unlinked crate `mod_file_aux` - | -help: to make use of source file $DIR/mod_file_aux.rs, use `mod mod_file_aux` in this file to declare the module - | -LL + mod mod_file_aux; - | - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0433, E0761. -For more information about an error, try `rustc --explain E0433`. From aa97acce629a246167bc60171f4562830c72b96e Mon Sep 17 00:00:00 2001 From: reddevilmidzy Date: Fri, 28 Nov 2025 15:25:38 +0900 Subject: [PATCH 12/15] Relocate qualified/qualified-path-params to typeck/qualified-path-params.rs merged test removed ui/qualified directory --- tests/ui/README.md | 6 ---- tests/ui/qualified/qualified-path-params-2.rs | 21 ------------- .../qualified/qualified-path-params-2.stderr | 15 ---------- .../ui/qualified/qualified-path-params.stderr | 18 ----------- .../qualified-path-params.rs | 5 +++- tests/ui/typeck/qualified-path-params.stderr | 30 +++++++++++++++++++ 6 files changed, 34 insertions(+), 61 deletions(-) delete mode 100644 tests/ui/qualified/qualified-path-params-2.rs delete mode 100644 tests/ui/qualified/qualified-path-params-2.stderr delete mode 100644 tests/ui/qualified/qualified-path-params.stderr rename tests/ui/{qualified => typeck}/qualified-path-params.rs (80%) create mode 100644 tests/ui/typeck/qualified-path-params.stderr diff --git a/tests/ui/README.md b/tests/ui/README.md index b7496a39bccae..7900af9d8c9b8 100644 --- a/tests/ui/README.md +++ b/tests/ui/README.md @@ -1125,12 +1125,6 @@ A large category about function and type public/private visibility, and its impa **FIXME**: merge with `tests/ui/privacy/`. -## `tests/ui/qualified/` - -Contains few tests on qualified paths where a type parameter is provided at the end: `type A = ::A::f;`. The tests check if this fails during type checking, not parsing. - -**FIXME**: Should be rehomed to `ui/typeck`. - ## `tests/ui/query-system/` Tests on Rust methods and functions which use the query system, such as `std::mem::size_of`. These compute information about the current runtime and return it. See [Query system | rustc-dev-guide](https://rustc-dev-guide.rust-lang.org/query.html). diff --git a/tests/ui/qualified/qualified-path-params-2.rs b/tests/ui/qualified/qualified-path-params-2.rs deleted file mode 100644 index d0cc1fa3d5172..0000000000000 --- a/tests/ui/qualified/qualified-path-params-2.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Check that qualified paths with type parameters -// fail during type checking and not during parsing - -struct S; - -trait Tr { - type A; -} - -impl Tr for S { - type A = S; -} - -impl S { - fn f() {} -} - -type A = ::A::f; -//~^ ERROR ambiguous associated type - -fn main() {} diff --git a/tests/ui/qualified/qualified-path-params-2.stderr b/tests/ui/qualified/qualified-path-params-2.stderr deleted file mode 100644 index e70cdbdc3f49e..0000000000000 --- a/tests/ui/qualified/qualified-path-params-2.stderr +++ /dev/null @@ -1,15 +0,0 @@ -error[E0223]: ambiguous associated type - --> $DIR/qualified-path-params-2.rs:18:10 - | -LL | type A = ::A::f; - | ^^^^^^^^^^^^^^^^^^^ - | -help: if there were a trait named `Example` with associated type `f` implemented for `::A`, you could use the fully-qualified path - | -LL - type A = ::A::f; -LL + type A = <::A as Example>::f; - | - -error: aborting due to 1 previous error - -For more information about this error, try `rustc --explain E0223`. diff --git a/tests/ui/qualified/qualified-path-params.stderr b/tests/ui/qualified/qualified-path-params.stderr deleted file mode 100644 index a49ed6c8f607a..0000000000000 --- a/tests/ui/qualified/qualified-path-params.stderr +++ /dev/null @@ -1,18 +0,0 @@ -error[E0533]: expected unit struct, unit variant or constant, found associated function `<::A>::f` - --> $DIR/qualified-path-params.rs:20:9 - | -LL | ::A::f:: => {} - | ^^^^^^^^^^^^^^^^^^^^^ not a unit struct, unit variant or constant - -error[E0029]: only `char` and numeric types are allowed in range patterns - --> $DIR/qualified-path-params.rs:22:15 - | -LL | 0 ..= ::A::f:: => {} - | - ^^^^^^^^^^^^^^^^^^^^^ this is of type `fn() {S::f::}` but it should be `char` or numeric - | | - | this is of type `{integer}` - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0029, E0533. -For more information about an error, try `rustc --explain E0029`. diff --git a/tests/ui/qualified/qualified-path-params.rs b/tests/ui/typeck/qualified-path-params.rs similarity index 80% rename from tests/ui/qualified/qualified-path-params.rs rename to tests/ui/typeck/qualified-path-params.rs index e8a95a46010af..95bfc5d8fb80d 100644 --- a/tests/ui/qualified/qualified-path-params.rs +++ b/tests/ui/typeck/qualified-path-params.rs @@ -15,11 +15,14 @@ impl S { fn f() {} } +type A = ::A::f; +//~^ ERROR ambiguous associated type + fn main() { match 10 { ::A::f:: => {} //~^ ERROR expected unit struct, unit variant or constant, found associated function - 0 ..= ::A::f:: => {} + 0..=::A::f:: => {} //~^ ERROR only `char` and numeric types are allowed in range } } diff --git a/tests/ui/typeck/qualified-path-params.stderr b/tests/ui/typeck/qualified-path-params.stderr new file mode 100644 index 0000000000000..b79d883394db7 --- /dev/null +++ b/tests/ui/typeck/qualified-path-params.stderr @@ -0,0 +1,30 @@ +error[E0223]: ambiguous associated type + --> $DIR/qualified-path-params.rs:18:10 + | +LL | type A = ::A::f; + | ^^^^^^^^^^^^^^^^^^^ + | +help: if there were a trait named `Example` with associated type `f` implemented for `::A`, you could use the fully-qualified path + | +LL - type A = ::A::f; +LL + type A = <::A as Example>::f; + | + +error[E0533]: expected unit struct, unit variant or constant, found associated function `<::A>::f` + --> $DIR/qualified-path-params.rs:23:9 + | +LL | ::A::f:: => {} + | ^^^^^^^^^^^^^^^^^^^^^ not a unit struct, unit variant or constant + +error[E0029]: only `char` and numeric types are allowed in range patterns + --> $DIR/qualified-path-params.rs:25:13 + | +LL | 0..=::A::f:: => {} + | - ^^^^^^^^^^^^^^^^^^^^^ this is of type `fn() {S::f::}` but it should be `char` or numeric + | | + | this is of type `{integer}` + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0029, E0223, E0533. +For more information about an error, try `rustc --explain E0029`. From cd618a9ccbbfb87883296569c676b76ab69730e3 Mon Sep 17 00:00:00 2001 From: reddevilmidzy Date: Fri, 28 Nov 2025 16:10:18 +0900 Subject: [PATCH 13/15] Merge missing_non_modrs with modules --- tests/ui/README.md | 6 ------ tests/ui/missing_non_modrs_mod/missing_non_modrs_mod.rs | 4 ---- .../missing_non_modrs_mod/missing_non_modrs_mod_inline.rs | 4 ---- .../foo.rs => modules/missing_mod.rs} | 2 +- .../foo_inline.rs => modules/missing_mod_inline.rs} | 2 +- tests/ui/modules/missing_non_modrs_mod.rs | 5 +++++ .../missing_non_modrs_mod.stderr | 4 ++-- tests/ui/modules/missing_non_modrs_mod_inline.rs | 5 +++++ .../missing_non_modrs_mod_inline.stderr | 4 ++-- 9 files changed, 16 insertions(+), 20 deletions(-) delete mode 100644 tests/ui/missing_non_modrs_mod/missing_non_modrs_mod.rs delete mode 100644 tests/ui/missing_non_modrs_mod/missing_non_modrs_mod_inline.rs rename tests/ui/{missing_non_modrs_mod/foo.rs => modules/missing_mod.rs} (62%) rename tests/ui/{missing_non_modrs_mod/foo_inline.rs => modules/missing_mod_inline.rs} (69%) create mode 100644 tests/ui/modules/missing_non_modrs_mod.rs rename tests/ui/{missing_non_modrs_mod => modules}/missing_non_modrs_mod.stderr (67%) create mode 100644 tests/ui/modules/missing_non_modrs_mod_inline.rs rename tests/ui/{missing_non_modrs_mod => modules}/missing_non_modrs_mod_inline.stderr (63%) diff --git a/tests/ui/README.md b/tests/ui/README.md index 7900af9d8c9b8..a9f1c61c6b668 100644 --- a/tests/ui/README.md +++ b/tests/ui/README.md @@ -939,12 +939,6 @@ Something is missing which could be added to fix (e.g. suggestions). **FIXME**: this is way too vague, tests should be rehomed. -## `tests/ui/missing_non_modrs_mod/` - -This directory is a small tree of `mod` dependencies, but the root, `foo.rs`, is looking for a file which does not exist. The test checks that the error is reported at the top-level module. - -**FIXME**: Merge with `tests/ui/modules/`. - ## `tests/ui/missing-trait-bounds/` Tests for checking missing trait bounds, and their diagnostics. diff --git a/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod.rs b/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod.rs deleted file mode 100644 index b1ac0756688fe..0000000000000 --- a/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod.rs +++ /dev/null @@ -1,4 +0,0 @@ -mod foo; -fn main() {} - -//~? ERROR file not found for module `missing` diff --git a/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod_inline.rs b/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod_inline.rs deleted file mode 100644 index 987fe1166d74a..0000000000000 --- a/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod_inline.rs +++ /dev/null @@ -1,4 +0,0 @@ -mod foo_inline; -fn main() {} - -//~? ERROR file not found for module `missing` diff --git a/tests/ui/missing_non_modrs_mod/foo.rs b/tests/ui/modules/missing_mod.rs similarity index 62% rename from tests/ui/missing_non_modrs_mod/foo.rs rename to tests/ui/modules/missing_mod.rs index afdc5e39b84d2..5fc98998aca08 100644 --- a/tests/ui/missing_non_modrs_mod/foo.rs +++ b/tests/ui/modules/missing_mod.rs @@ -1,3 +1,3 @@ //@ ignore-auxiliary (used by `./missing_non_modrs_mod.rs`) - +// looking for a file which does not exist. mod missing; diff --git a/tests/ui/missing_non_modrs_mod/foo_inline.rs b/tests/ui/modules/missing_mod_inline.rs similarity index 69% rename from tests/ui/missing_non_modrs_mod/foo_inline.rs rename to tests/ui/modules/missing_mod_inline.rs index ed6d3a49101da..a6adcf9427164 100644 --- a/tests/ui/missing_non_modrs_mod/foo_inline.rs +++ b/tests/ui/modules/missing_mod_inline.rs @@ -1,5 +1,5 @@ //@ ignore-auxiliary (used by `./missing_non_modrs_mod_inline.rs`) - +// looking for a file which does not exist. mod inline { mod missing; } diff --git a/tests/ui/modules/missing_non_modrs_mod.rs b/tests/ui/modules/missing_non_modrs_mod.rs new file mode 100644 index 0000000000000..1ed3318ed5c91 --- /dev/null +++ b/tests/ui/modules/missing_non_modrs_mod.rs @@ -0,0 +1,5 @@ +//! Tests the error reporting when a declared module file is missing. +mod missing_mod; +fn main() {} + +//~? ERROR file not found for module `missing` diff --git a/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod.stderr b/tests/ui/modules/missing_non_modrs_mod.stderr similarity index 67% rename from tests/ui/missing_non_modrs_mod/missing_non_modrs_mod.stderr rename to tests/ui/modules/missing_non_modrs_mod.stderr index c084fbf00c26f..4717e35fdea1a 100644 --- a/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod.stderr +++ b/tests/ui/modules/missing_non_modrs_mod.stderr @@ -1,10 +1,10 @@ error[E0583]: file not found for module `missing` - --> $DIR/foo.rs:3:1 + --> $DIR/missing_mod.rs:3:1 | LL | mod missing; | ^^^^^^^^^^^^ | - = help: to create the module `missing`, create file "$DIR/foo/missing.rs" or "$DIR/foo/missing/mod.rs" + = help: to create the module `missing`, create file "$DIR/missing_mod/missing.rs" or "$DIR/missing_mod/missing/mod.rs" = note: if there is a `mod missing` elsewhere in the crate already, import it with `use crate::...` instead error: aborting due to 1 previous error diff --git a/tests/ui/modules/missing_non_modrs_mod_inline.rs b/tests/ui/modules/missing_non_modrs_mod_inline.rs new file mode 100644 index 0000000000000..f652519c76589 --- /dev/null +++ b/tests/ui/modules/missing_non_modrs_mod_inline.rs @@ -0,0 +1,5 @@ +//! Tests the error reporting when a declared module file is missing. +mod missing_mod_inline; +fn main() {} + +//~? ERROR file not found for module `missing` diff --git a/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod_inline.stderr b/tests/ui/modules/missing_non_modrs_mod_inline.stderr similarity index 63% rename from tests/ui/missing_non_modrs_mod/missing_non_modrs_mod_inline.stderr rename to tests/ui/modules/missing_non_modrs_mod_inline.stderr index 86193dd26e041..dfbba6bce8ef3 100644 --- a/tests/ui/missing_non_modrs_mod/missing_non_modrs_mod_inline.stderr +++ b/tests/ui/modules/missing_non_modrs_mod_inline.stderr @@ -1,10 +1,10 @@ error[E0583]: file not found for module `missing` - --> $DIR/foo_inline.rs:4:5 + --> $DIR/missing_mod_inline.rs:4:5 | LL | mod missing; | ^^^^^^^^^^^^ | - = help: to create the module `missing`, create file "$DIR/foo_inline/inline/missing.rs" or "$DIR/foo_inline/inline/missing/mod.rs" + = help: to create the module `missing`, create file "$DIR/missing_mod_inline/inline/missing.rs" or "$DIR/missing_mod_inline/inline/missing/mod.rs" = note: if there is a `mod missing` elsewhere in the crate already, import it with `use crate::...` instead error: aborting due to 1 previous error From ace4aebb6d95b276ef655017bd9e0aa8742fb444 Mon Sep 17 00:00:00 2001 From: reddevilmidzy Date: Fri, 28 Nov 2025 16:38:38 +0900 Subject: [PATCH 14/15] Merge `while` with `for-loop-while` --- tests/ui/README.md | 6 ------ tests/ui/{while => for-loop-while}/while-else-err.rs | 0 tests/ui/{while => for-loop-while}/while-else-err.stderr | 0 .../ui/{while => for-loop-while}/while-else-let-else-err.rs | 0 .../while-else-let-else-err.stderr | 0 .../while-let-scope.rs} | 1 + 6 files changed, 1 insertion(+), 6 deletions(-) rename tests/ui/{while => for-loop-while}/while-else-err.rs (100%) rename tests/ui/{while => for-loop-while}/while-else-err.stderr (100%) rename tests/ui/{while => for-loop-while}/while-else-let-else-err.rs (100%) rename tests/ui/{while => for-loop-while}/while-else-let-else-err.stderr (100%) rename tests/ui/{while/while-let-scope-issue-40235.rs => for-loop-while/while-let-scope.rs} (80%) diff --git a/tests/ui/README.md b/tests/ui/README.md index a9f1c61c6b668..11003bbef9928 100644 --- a/tests/ui/README.md +++ b/tests/ui/README.md @@ -1561,12 +1561,6 @@ Tests on various well-formedness checks, e.g. [Type-checking normal functions](h Tests on `where` clauses. See [Where clauses | Reference](https://doc.rust-lang.org/reference/items/generics.html#where-clauses). -## `tests/ui/while/` - -Tests on the `while` keyword and the `while` construct. - -**FIXME**: merge with `ui/for-loop-while`. - ## `tests/ui/windows-subsystem/`: `#![windows_subsystem = ""]` See [the `windows_subsystem` attribute](https://doc.rust-lang.org/reference/runtime.html#the-windows_subsystem-attribute). diff --git a/tests/ui/while/while-else-err.rs b/tests/ui/for-loop-while/while-else-err.rs similarity index 100% rename from tests/ui/while/while-else-err.rs rename to tests/ui/for-loop-while/while-else-err.rs diff --git a/tests/ui/while/while-else-err.stderr b/tests/ui/for-loop-while/while-else-err.stderr similarity index 100% rename from tests/ui/while/while-else-err.stderr rename to tests/ui/for-loop-while/while-else-err.stderr diff --git a/tests/ui/while/while-else-let-else-err.rs b/tests/ui/for-loop-while/while-else-let-else-err.rs similarity index 100% rename from tests/ui/while/while-else-let-else-err.rs rename to tests/ui/for-loop-while/while-else-let-else-err.rs diff --git a/tests/ui/while/while-else-let-else-err.stderr b/tests/ui/for-loop-while/while-else-let-else-err.stderr similarity index 100% rename from tests/ui/while/while-else-let-else-err.stderr rename to tests/ui/for-loop-while/while-else-let-else-err.stderr diff --git a/tests/ui/while/while-let-scope-issue-40235.rs b/tests/ui/for-loop-while/while-let-scope.rs similarity index 80% rename from tests/ui/while/while-let-scope-issue-40235.rs rename to tests/ui/for-loop-while/while-let-scope.rs index 7d5dfc64a9059..e72cc5bf0c357 100644 --- a/tests/ui/while/while-let-scope-issue-40235.rs +++ b/tests/ui/for-loop-while/while-let-scope.rs @@ -1,4 +1,5 @@ //@ check-pass +// regression test for #40235 #![allow(unused_variables)] fn foo() {} From 2b4b02e61345e8247064ee35c8a22bf09386685f Mon Sep 17 00:00:00 2001 From: Aditya-PS-05 Date: Fri, 28 Nov 2025 18:52:18 +0530 Subject: [PATCH 15/15] change test location --- .../nested-closure-with-generic-ice.rs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/ui/{issues/issue-143821.rs => borrowck/nested-closure-with-generic-ice.rs} (100%) diff --git a/tests/ui/issues/issue-143821.rs b/tests/ui/borrowck/nested-closure-with-generic-ice.rs similarity index 100% rename from tests/ui/issues/issue-143821.rs rename to tests/ui/borrowck/nested-closure-with-generic-ice.rs