about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-04-25 18:51:15 +0000
committerbors <bors@rust-lang.org>2025-04-25 18:51:15 +0000
commitb4c8b0c3f0533bb342a4873ff59bdad3883ab8e3 (patch)
treeeef1aa90a79b32d1ea165af6b54170a3ca6c0468
parente3e432d4d65a55e6db167598e96db2bcb163e316 (diff)
parent99dc43b7178445e3e7eacd10630dfbfadefab560 (diff)
downloadrust-b4c8b0c3f0533bb342a4873ff59bdad3883ab8e3.tar.gz
rust-b4c8b0c3f0533bb342a4873ff59bdad3883ab8e3.zip
Auto merge of #140298 - matthiaskrgr:rollup-5tc1gvb, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #137683 (Add a tidy check for GCC submodule version)
 - #138968 (Update the index of Result to make the summary more comprehensive)
 - #139572 (docs(std): mention const blocks in const keyword doc page)
 - #140152 (Unify the format of rustc cli flags)
 - #140193 (fix ICE in `#[naked]` attribute validation)
 - #140205 (Tidying up UI tests [2/N])
 - #140284 (remove expect() in `unnecessary_transmutes`)
 - #140290 (rustdoc: fix typo change from equivelent to equivalent)

r? `@ghost`
`@rustbot` modify labels: rollup
-rw-r--r--compiler/rustc_mir_transform/src/check_unnecessary_transmutes.rs7
-rw-r--r--compiler/rustc_passes/src/check_attr.rs6
-rw-r--r--compiler/rustc_passes/src/errors.rs2
-rw-r--r--compiler/rustc_session/src/config.rs79
-rw-r--r--compiler/rustc_span/src/edition.rs2
-rw-r--r--library/core/src/result.rs32
-rw-r--r--library/std/src/keyword_docs.rs9
-rw-r--r--src/doc/rustdoc/src/read-documentation/search.md2
m---------src/gcc0
-rw-r--r--src/tools/tidy/src/gcc_submodule.rs47
-rw-r--r--src/tools/tidy/src/lib.rs1
-rw-r--r--src/tools/tidy/src/main.rs1
-rw-r--r--tests/run-make/rustc-help/help-v.diff23
-rw-r--r--tests/run-make/rustc-help/help-v.stdout75
-rw-r--r--tests/run-make/rustc-help/help.stdout54
-rw-r--r--tests/run-make/rustdoc-default-output/output-default.stdout2
-rw-r--r--tests/ui/asm/naked-invalid-attr.rs9
-rw-r--r--tests/ui/asm/naked-invalid-attr.stderr19
-rw-r--r--tests/ui/compiletest-self-test/compile-flags-last.stderr2
-rw-r--r--tests/ui/copy-a-resource.rs21
-rw-r--r--tests/ui/invalid-compile-flags/emit-output-types-without-args.stderr3
-rw-r--r--tests/ui/invalid-compile-flags/print-without-arg.stderr5
-rw-r--r--tests/ui/macros/no-matching-rule.rs (renamed from tests/ui/fail-simple.rs)0
-rw-r--r--tests/ui/macros/no-matching-rule.stderr (renamed from tests/ui/fail-simple.stderr)2
-rw-r--r--tests/ui/methods/clone-missing.rs19
-rw-r--r--tests/ui/methods/clone-missing.stderr (renamed from tests/ui/copy-a-resource.stderr)2
-rw-r--r--tests/ui/modules/mod-pub-access.rs11
-rw-r--r--tests/ui/path.rs7
-rw-r--r--tests/ui/resolve/fn-item-cant-capture-dynamic-env.rs (renamed from tests/ui/capture1.rs)0
-rw-r--r--tests/ui/resolve/fn-item-cant-capture-dynamic-env.stderr (renamed from tests/ui/capture1.stderr)2
-rw-r--r--tests/ui/transmute/auxiliary/unnecessary-transmute-path-remap-ice-140277-trans.rs10
-rw-r--r--tests/ui/transmute/unnecessary-transmute-path-remap-ice-140277.rs10
-rw-r--r--tests/ui/type-alias/type-param.rs11
-rw-r--r--tests/ui/type-param.rs10
34 files changed, 317 insertions, 168 deletions
diff --git a/compiler/rustc_mir_transform/src/check_unnecessary_transmutes.rs b/compiler/rustc_mir_transform/src/check_unnecessary_transmutes.rs
index 8be782dcbf0..4aff127908e 100644
--- a/compiler/rustc_mir_transform/src/check_unnecessary_transmutes.rs
+++ b/compiler/rustc_mir_transform/src/check_unnecessary_transmutes.rs
@@ -87,11 +87,8 @@ impl<'tcx> Visitor<'tcx> for UnnecessaryTransmuteChecker<'_, 'tcx> {
             && let Some((func_def_id, _)) = func.const_fn_def()
             && self.tcx.is_intrinsic(func_def_id, sym::transmute)
             && let span = self.body.source_info(location).span
-            && let Some(lint) = self.is_unnecessary_transmute(
-                func,
-                self.tcx.sess.source_map().span_to_snippet(arg).expect("ok"),
-                span,
-            )
+            && let Ok(snippet) = self.tcx.sess.source_map().span_to_snippet(arg)
+            && let Some(lint) = self.is_unnecessary_transmute(func, snippet, span)
             && let Some(hir_id) = terminator.source_info.scope.lint_root(&self.body.source_scopes)
         {
             self.tcx.emit_node_span_lint(UNNECESSARY_TRANSMUTES, hir_id, span, lint);
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs
index cfc71a412be..7a27bc5c387 100644
--- a/compiler/rustc_passes/src/check_attr.rs
+++ b/compiler/rustc_passes/src/check_attr.rs
@@ -680,10 +680,14 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
                     }
 
                     if !other_attr.has_any_name(ALLOW_LIST) {
+                        let path = other_attr.path();
+                        let path: Vec<_> = path.iter().map(|s| s.as_str()).collect();
+                        let other_attr_name = path.join("::");
+
                         self.dcx().emit_err(errors::NakedFunctionIncompatibleAttribute {
                             span: other_attr.span(),
                             naked_span: attr.span(),
-                            attr: other_attr.name().unwrap(),
+                            attr: other_attr_name,
                         });
 
                         return;
diff --git a/compiler/rustc_passes/src/errors.rs b/compiler/rustc_passes/src/errors.rs
index 4052264b051..b1b4b9ee927 100644
--- a/compiler/rustc_passes/src/errors.rs
+++ b/compiler/rustc_passes/src/errors.rs
@@ -1249,7 +1249,7 @@ pub(crate) struct NakedFunctionIncompatibleAttribute {
     pub span: Span,
     #[label(passes_naked_attribute)]
     pub naked_span: Span,
-    pub attr: Symbol,
+    pub attr: String,
 }
 
 #[derive(Diagnostic)]
diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs
index 02c164a706c..43955cc23a9 100644
--- a/compiler/rustc_session/src/config.rs
+++ b/compiler/rustc_session/src/config.rs
@@ -1650,7 +1650,7 @@ The default is {DEFAULT_EDITION} and the latest stable edition is {LATEST_STABLE
 static PRINT_HELP: LazyLock<String> = LazyLock::new(|| {
     format!(
         "Compiler information to print on stdout (or to a file)\n\
-        INFO may be one of ({}).",
+        INFO may be one of <{}>.",
         PRINT_KINDS.iter().map(|(name, _)| format!("{name}")).collect::<Vec<_>>().join("|")
     )
 });
@@ -1669,6 +1669,13 @@ static EMIT_HELP: LazyLock<String> = LazyLock::new(|| {
 
 /// Returns all rustc command line options, including metadata for
 /// each option, such as whether the option is stable.
+///
+/// # Option style guidelines
+///
+/// - `<param>`: Indicates a required parameter
+/// - `[param]`: Indicates an optional parameter
+/// - `|`: Indicates a mutually exclusive option
+/// - `*`: a list element with description
 pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
     use OptionKind::{Flag, FlagMulti, Multi, Opt};
     use OptionStability::{Stable, Unstable};
@@ -1683,18 +1690,18 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
             "",
             "cfg",
             "Configure the compilation environment.\n\
-                SPEC supports the syntax `NAME[=\"VALUE\"]`.",
-            "SPEC",
+                SPEC supports the syntax `<NAME>[=\"<VALUE>\"]`.",
+            "<SPEC>",
         ),
-        opt(Stable, Multi, "", "check-cfg", "Provide list of expected cfgs for checking", "SPEC"),
+        opt(Stable, Multi, "", "check-cfg", "Provide list of expected cfgs for checking", "<SPEC>"),
         opt(
             Stable,
             Multi,
             "L",
             "",
             "Add a directory to the library search path. \
-                The optional KIND can be one of dependency, crate, native, framework, or all (the default).",
-            "[KIND=]PATH",
+                The optional KIND can be one of <dependency|crate|native|framework|all> (default: all).",
+            "[<KIND>=]<PATH>",
         ),
         opt(
             Stable,
@@ -1703,46 +1710,46 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
             "",
             "Link the generated crate(s) to the specified native\n\
                 library NAME. The optional KIND can be one of\n\
-                static, framework, or dylib (the default).\n\
+                <static|framework|dylib> (default: dylib).\n\
                 Optional comma separated MODIFIERS\n\
-                (bundle|verbatim|whole-archive|as-needed)\n\
+                <bundle|verbatim|whole-archive|as-needed>\n\
                 may be specified each with a prefix of either '+' to\n\
                 enable or '-' to disable.",
-            "[KIND[:MODIFIERS]=]NAME[:RENAME]",
+            "[<KIND>[:<MODIFIERS>]=]<NAME>[:<RENAME>]",
         ),
         make_crate_type_option(),
-        opt(Stable, Opt, "", "crate-name", "Specify the name of the crate being built", "NAME"),
+        opt(Stable, Opt, "", "crate-name", "Specify the name of the crate being built", "<NAME>"),
         opt(Stable, Opt, "", "edition", &EDITION_STRING, EDITION_NAME_LIST),
-        opt(Stable, Multi, "", "emit", &EMIT_HELP, "TYPE[=FILE]"),
-        opt(Stable, Multi, "", "print", &PRINT_HELP, "INFO[=FILE]"),
+        opt(Stable, Multi, "", "emit", &EMIT_HELP, "<TYPE>[=<FILE>]"),
+        opt(Stable, Multi, "", "print", &PRINT_HELP, "<INFO>[=<FILE>]"),
         opt(Stable, FlagMulti, "g", "", "Equivalent to -C debuginfo=2", ""),
         opt(Stable, FlagMulti, "O", "", "Equivalent to -C opt-level=3", ""),
-        opt(Stable, Opt, "o", "", "Write output to <filename>", "FILENAME"),
-        opt(Stable, Opt, "", "out-dir", "Write output to compiler-chosen filename in <dir>", "DIR"),
+        opt(Stable, Opt, "o", "", "Write output to FILENAME", "<FILENAME>"),
+        opt(Stable, Opt, "", "out-dir", "Write output to compiler-chosen filename in DIR", "<DIR>"),
         opt(
             Stable,
             Opt,
             "",
             "explain",
             "Provide a detailed explanation of an error message",
-            "OPT",
+            "<OPT>",
         ),
         opt(Stable, Flag, "", "test", "Build a test harness", ""),
-        opt(Stable, Opt, "", "target", "Target triple for which the code is compiled", "TARGET"),
-        opt(Stable, Multi, "A", "allow", "Set lint allowed", "LINT"),
-        opt(Stable, Multi, "W", "warn", "Set lint warnings", "LINT"),
-        opt(Stable, Multi, "", "force-warn", "Set lint force-warn", "LINT"),
-        opt(Stable, Multi, "D", "deny", "Set lint denied", "LINT"),
-        opt(Stable, Multi, "F", "forbid", "Set lint forbidden", "LINT"),
+        opt(Stable, Opt, "", "target", "Target triple for which the code is compiled", "<TARGET>"),
+        opt(Stable, Multi, "A", "allow", "Set lint allowed", "<LINT>"),
+        opt(Stable, Multi, "W", "warn", "Set lint warnings", "<LINT>"),
+        opt(Stable, Multi, "", "force-warn", "Set lint force-warn", "<LINT>"),
+        opt(Stable, Multi, "D", "deny", "Set lint denied", "<LINT>"),
+        opt(Stable, Multi, "F", "forbid", "Set lint forbidden", "<LINT>"),
         opt(
             Stable,
             Multi,
             "",
             "cap-lints",
             "Set the most restrictive lint level. More restrictive lints are capped at this level",
-            "LEVEL",
+            "<LEVEL>",
         ),
-        opt(Stable, Multi, "C", "codegen", "Set a codegen option", "OPT[=VALUE]"),
+        opt(Stable, Multi, "C", "codegen", "Set a codegen option", "<OPT>[=<VALUE>]"),
         opt(Stable, Flag, "V", "version", "Print version info and exit", ""),
         opt(Stable, Flag, "v", "verbose", "Use verbose output", ""),
     ];
@@ -1756,29 +1763,29 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
             "",
             "extern",
             "Specify where an external rust library is located",
-            "NAME[=PATH]",
+            "<NAME>[=<PATH>]",
         ),
-        opt(Stable, Opt, "", "sysroot", "Override the system root", "PATH"),
-        opt(Unstable, Multi, "Z", "", "Set unstable / perma-unstable options", "FLAG"),
+        opt(Stable, Opt, "", "sysroot", "Override the system root", "<PATH>"),
+        opt(Unstable, Multi, "Z", "", "Set unstable / perma-unstable options", "<FLAG>"),
         opt(
             Stable,
             Opt,
             "",
             "error-format",
             "How errors and other messages are produced",
-            "human|json|short",
+            "<human|json|short>",
         ),
-        opt(Stable, Multi, "", "json", "Configure the JSON output of the compiler", "CONFIG"),
+        opt(Stable, Multi, "", "json", "Configure the JSON output of the compiler", "<CONFIG>"),
         opt(
             Stable,
             Opt,
             "",
             "color",
             "Configure coloring of output:
-                auto   = colorize, if output goes to a tty (default);
-                always = always colorize output;
-                never  = never colorize output",
-            "auto|always|never",
+                * auto   = colorize, if output goes to a tty (default);
+                * always = always colorize output;
+                * never  = never colorize output",
+            "<auto|always|never>",
         ),
         opt(
             Stable,
@@ -1786,7 +1793,7 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
             "",
             "diagnostic-width",
             "Inform rustc of the width of the output so that diagnostics can be truncated to fit",
-            "WIDTH",
+            "<WIDTH>",
         ),
         opt(
             Stable,
@@ -1794,9 +1801,9 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
             "",
             "remap-path-prefix",
             "Remap source names in all output (compiler messages and output files)",
-            "FROM=TO",
+            "<FROM>=<TO>",
         ),
-        opt(Unstable, Multi, "", "env-set", "Inject an environment variable", "VAR=VALUE"),
+        opt(Unstable, Multi, "", "env-set", "Inject an environment variable", "<VAR>=<VALUE>"),
     ];
     options.extend(verbose_only.into_iter().map(|mut opt| {
         opt.is_verbose_help_only = true;
@@ -2796,7 +2803,7 @@ pub fn make_crate_type_option() -> RustcOptGroup {
         "crate-type",
         "Comma separated list of types of crates
                                 for the compiler to emit",
-        "[bin|lib|rlib|dylib|cdylib|staticlib|proc-macro]",
+        "<bin|lib|rlib|dylib|cdylib|staticlib|proc-macro>",
     )
 }
 
diff --git a/compiler/rustc_span/src/edition.rs b/compiler/rustc_span/src/edition.rs
index da298080ed2..28335734f4d 100644
--- a/compiler/rustc_span/src/edition.rs
+++ b/compiler/rustc_span/src/edition.rs
@@ -45,7 +45,7 @@ pub const ALL_EDITIONS: &[Edition] = &[
     Edition::EditionFuture,
 ];
 
-pub const EDITION_NAME_LIST: &str = "2015|2018|2021|2024";
+pub const EDITION_NAME_LIST: &str = "<2015|2018|2021|2024|future>";
 
 pub const DEFAULT_EDITION: Edition = Edition::Edition2015;
 
diff --git a/library/core/src/result.rs b/library/core/src/result.rs
index 48ab9267f21..736ffb7d0ca 100644
--- a/library/core/src/result.rs
+++ b/library/core/src/result.rs
@@ -259,8 +259,14 @@
 //! The [`is_ok`] and [`is_err`] methods return [`true`] if the [`Result`]
 //! is [`Ok`] or [`Err`], respectively.
 //!
+//! The [`is_ok_and`] and [`is_err_and`] methods apply the provided function
+//! to the contents of the [`Result`] to produce a boolean value. If the [`Result`] does not have the expected variant
+//! then [`false`] is returned instead without executing the function.
+//!
 //! [`is_err`]: Result::is_err
 //! [`is_ok`]: Result::is_ok
+//! [`is_ok_and`]: Result::is_ok_and
+//! [`is_err_and`]: Result::is_err_and
 //!
 //! ## Adapters for working with references
 //!
@@ -287,6 +293,7 @@
 //!   (which must implement the [`Default`] trait)
 //! * [`unwrap_or_else`] returns the result of evaluating the provided
 //!   function
+//! * [`unwrap_unchecked`] produces *[undefined behavior]*
 //!
 //! The panicking methods [`expect`] and [`unwrap`] require `E` to
 //! implement the [`Debug`] trait.
@@ -297,6 +304,8 @@
 //! [`unwrap_or`]: Result::unwrap_or
 //! [`unwrap_or_default`]: Result::unwrap_or_default
 //! [`unwrap_or_else`]: Result::unwrap_or_else
+//! [`unwrap_unchecked`]: Result::unwrap_unchecked
+//! [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
 //!
 //! These methods extract the contained value in a [`Result<T, E>`] when it
 //! is the [`Err`] variant. They require `T` to implement the [`Debug`]
@@ -304,10 +313,13 @@
 //!
 //! * [`expect_err`] panics with a provided custom message
 //! * [`unwrap_err`] panics with a generic message
+//! * [`unwrap_err_unchecked`] produces *[undefined behavior]*
 //!
 //! [`Debug`]: crate::fmt::Debug
 //! [`expect_err`]: Result::expect_err
 //! [`unwrap_err`]: Result::unwrap_err
+//! [`unwrap_err_unchecked`]: Result::unwrap_err_unchecked
+//! [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html
 //!
 //! ## Transforming contained values
 //!
@@ -330,21 +342,29 @@
 //! [`Some(v)`]: Option::Some
 //! [`transpose`]: Result::transpose
 //!
-//! This method transforms the contained value of the [`Ok`] variant:
+//! These methods transform the contained value of the [`Ok`] variant:
 //!
 //! * [`map`] transforms [`Result<T, E>`] into [`Result<U, E>`] by applying
 //!   the provided function to the contained value of [`Ok`] and leaving
 //!   [`Err`] values unchanged
+//! * [`inspect`] takes ownership of the [`Result`], applies the
+//!   provided function to the contained value by reference,
+//!   and then returns the [`Result`]
 //!
 //! [`map`]: Result::map
+//! [`inspect`]: Result::inspect
 //!
-//! This method transforms the contained value of the [`Err`] variant:
+//! These methods transform the contained value of the [`Err`] variant:
 //!
 //! * [`map_err`] transforms [`Result<T, E>`] into [`Result<T, F>`] by
 //!   applying the provided function to the contained value of [`Err`] and
 //!   leaving [`Ok`] values unchanged
+//! * [`inspect_err`] takes ownership of the [`Result`], applies the
+//!   provided function to the contained value of [`Err`] by reference,
+//!   and then returns the [`Result`]
 //!
 //! [`map_err`]: Result::map_err
+//! [`inspect_err`]: Result::inspect_err
 //!
 //! These methods transform a [`Result<T, E>`] into a value of a possibly
 //! different type `U`:
@@ -578,6 +598,10 @@ impl<T, E> Result<T, E> {
     ///
     /// let x: Result<u32, &str> = Err("hey");
     /// assert_eq!(x.is_ok_and(|x| x > 1), false);
+    ///
+    /// let x: Result<String, &str> = Ok("ownership".to_string());
+    /// assert_eq!(x.as_ref().is_ok_and(|x| x.len() > 1), true);
+    /// println!("still alive {:?}", x);
     /// ```
     #[must_use]
     #[inline]
@@ -623,6 +647,10 @@ impl<T, E> Result<T, E> {
     ///
     /// let x: Result<u32, Error> = Ok(123);
     /// assert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);
+    ///
+    /// let x: Result<u32, String> = Err("ownership".to_string());
+    /// assert_eq!(x.as_ref().is_err_and(|x| x.len() > 1), true);
+    /// println!("still alive {:?}", x);
     /// ```
     #[must_use]
     #[inline]
diff --git a/library/std/src/keyword_docs.rs b/library/std/src/keyword_docs.rs
index c07c391892d..91701576130 100644
--- a/library/std/src/keyword_docs.rs
+++ b/library/std/src/keyword_docs.rs
@@ -119,7 +119,7 @@ mod break_keyword {}
 
 #[doc(keyword = "const")]
 //
-/// Compile-time constants, compile-time evaluable functions, and raw pointers.
+/// Compile-time constants, compile-time blocks, compile-time evaluable functions, and raw pointers.
 ///
 /// ## Compile-time constants
 ///
@@ -166,6 +166,12 @@ mod break_keyword {}
 ///
 /// For more detail on `const`, see the [Rust Book] or the [Reference].
 ///
+/// ## Compile-time blocks
+///
+/// The `const` keyword can also be used to define a block of code that is evaluated at compile time.
+/// This is useful for ensuring certain computations are completed before optimizations happen, as well as
+/// before runtime. For more details, see the [Reference][const-blocks].
+///
 /// ## Compile-time evaluable functions
 ///
 /// The other main use of the `const` keyword is in `const fn`. This marks a function as being
@@ -184,6 +190,7 @@ mod break_keyword {}
 /// [pointer primitive]: pointer
 /// [Rust Book]: ../book/ch03-01-variables-and-mutability.html#constants
 /// [Reference]: ../reference/items/constant-items.html
+/// [const-blocks]: ../reference/expressions/block-expr.html#const-blocks
 /// [const-eval]: ../reference/const_eval.html
 mod const_keyword {}
 
diff --git a/src/doc/rustdoc/src/read-documentation/search.md b/src/doc/rustdoc/src/read-documentation/search.md
index bace2f5f953..5635f68b1b3 100644
--- a/src/doc/rustdoc/src/read-documentation/search.md
+++ b/src/doc/rustdoc/src/read-documentation/search.md
@@ -89,7 +89,7 @@ the standard library and functions that are included in the results list:
 
 ### Non-functions in type-based search
 Certain items that are not functions are treated as though they
-were a semantically equivelent function.
+were a semantically equivalent function.
 
 For example, struct fields are treated as though they were getter methods.
 This means that a search for `CpuidResult -> u32` will show
diff --git a/src/gcc b/src/gcc
-Subproject 13cc8243226a9028bb08ab6c5e1c5fe6d533bcd
+Subproject 0ea98a1365b81f7488073512c850e8ee951a4af
diff --git a/src/tools/tidy/src/gcc_submodule.rs b/src/tools/tidy/src/gcc_submodule.rs
new file mode 100644
index 00000000000..952ebe9e0cf
--- /dev/null
+++ b/src/tools/tidy/src/gcc_submodule.rs
@@ -0,0 +1,47 @@
+//! Tidy check to ensure that the commit SHA of the `src/gcc` submodule is the same as the
+//! required GCC version of the GCC codegen backend.
+
+use std::path::Path;
+use std::process::Command;
+
+pub fn check(root_path: &Path, compiler_path: &Path, bad: &mut bool) {
+    let cg_gcc_version_path = compiler_path.join("rustc_codegen_gcc/libgccjit.version");
+    let cg_gcc_version = std::fs::read_to_string(&cg_gcc_version_path)
+        .expect(&format!("Cannot read GCC version from {}", cg_gcc_version_path.display()))
+        .trim()
+        .to_string();
+
+    let git_output = Command::new("git")
+        .current_dir(root_path)
+        .arg("submodule")
+        .arg("status")
+        // --cached asks for the version that is actually committed in the repository, not the one
+        // that is currently checked out.
+        .arg("--cached")
+        .arg("src/gcc")
+        .output()
+        .expect("Cannot determine git SHA of the src/gcc checkout");
+
+    // This can return e.g.
+    // -e607be166673a8de9fc07f6f02c60426e556c5f2 src/gcc
+    //  e607be166673a8de9fc07f6f02c60426e556c5f2 src/gcc (master-e607be166673a8de9fc07f6f02c60426e556c5f2.e607be)
+    // +e607be166673a8de9fc07f6f02c60426e556c5f2 src/gcc (master-e607be166673a8de9fc07f6f02c60426e556c5f2.e607be)
+    let git_output = String::from_utf8_lossy(&git_output.stdout)
+        .trim()
+        .split_whitespace()
+        .next()
+        .unwrap_or_default()
+        .to_string();
+
+    // The SHA can start with + if the submodule is modified or - if it is not checked out.
+    let gcc_submodule_sha = git_output.trim_start_matches(&['+', '-']);
+    if gcc_submodule_sha != cg_gcc_version {
+        *bad = true;
+        eprintln!(
+            r#"Commit SHA of the src/gcc submodule (`{gcc_submodule_sha}`) does not match the required GCC version of the GCC codegen backend (`{cg_gcc_version}`).
+Make sure to set the src/gcc submodule to commit {cg_gcc_version}.
+The GCC codegen backend commit is configured at {}."#,
+            cg_gcc_version_path.display(),
+        );
+    }
+}
diff --git a/src/tools/tidy/src/lib.rs b/src/tools/tidy/src/lib.rs
index 66856f5247b..ca45f8bb84b 100644
--- a/src/tools/tidy/src/lib.rs
+++ b/src/tools/tidy/src/lib.rs
@@ -75,6 +75,7 @@ pub mod features;
 pub mod fluent_alphabetical;
 pub mod fluent_period;
 mod fluent_used;
+pub mod gcc_submodule;
 pub(crate) mod iter_header;
 pub mod known_bug;
 pub mod mir_opt_tests;
diff --git a/src/tools/tidy/src/main.rs b/src/tools/tidy/src/main.rs
index 4078d462f55..48122129b01 100644
--- a/src/tools/tidy/src/main.rs
+++ b/src/tools/tidy/src/main.rs
@@ -116,6 +116,7 @@ fn main() {
         check!(fluent_alphabetical, &compiler_path, bless);
         check!(fluent_period, &compiler_path);
         check!(target_policy, &root_path);
+        check!(gcc_submodule, &root_path, &compiler_path);
 
         // Checks that only make sense for the std libs.
         check!(pal, &library_path);
diff --git a/tests/run-make/rustc-help/help-v.diff b/tests/run-make/rustc-help/help-v.diff
index 0ea79f3e557..60a9dfbe201 100644
--- a/tests/run-make/rustc-help/help-v.diff
+++ b/tests/run-make/rustc-help/help-v.diff
@@ -1,22 +1,23 @@
-@@ -63,10 +63,27 @@
+@@ -65,10 +65,28 @@
                          Set a codegen option
      -V, --version       Print version info and exit
      -v, --verbose       Use verbose output
-+        --extern NAME[=PATH]
++        --extern <NAME>[=<PATH>]
 +                        Specify where an external rust library is located
-+        --sysroot PATH  Override the system root
-+        --error-format human|json|short
++        --sysroot <PATH>
++                        Override the system root
++        --error-format <human|json|short>
 +                        How errors and other messages are produced
-+        --json CONFIG   Configure the JSON output of the compiler
-+        --color auto|always|never
++        --json <CONFIG> Configure the JSON output of the compiler
++        --color <auto|always|never>
 +                        Configure coloring of output:
-+                        auto = colorize, if output goes to a tty (default);
-+                        always = always colorize output;
-+                        never = never colorize output
-+        --diagnostic-width WIDTH
++                        * auto = colorize, if output goes to a tty (default);
++                        * always = always colorize output;
++                        * never = never colorize output
++        --diagnostic-width <WIDTH>
 +                        Inform rustc of the width of the output so that
 +                        diagnostics can be truncated to fit
-+        --remap-path-prefix FROM=TO
++        --remap-path-prefix <FROM>=<TO>
 +                        Remap source names in all output (compiler messages
 +                        and output files)
 +    @path               Read newline separated options from `path`
diff --git a/tests/run-make/rustc-help/help-v.stdout b/tests/run-make/rustc-help/help-v.stdout
index 744453d6e85..3fc297fb08e 100644
--- a/tests/run-make/rustc-help/help-v.stdout
+++ b/tests/run-make/rustc-help/help-v.stdout
@@ -2,31 +2,32 @@ Usage: rustc [OPTIONS] INPUT
 
 Options:
     -h, --help          Display this message
-        --cfg SPEC      Configure the compilation environment.
-                        SPEC supports the syntax `NAME[="VALUE"]`.
-        --check-cfg SPEC
+        --cfg <SPEC>    Configure the compilation environment.
+                        SPEC supports the syntax `<NAME>[="<VALUE>"]`.
+        --check-cfg <SPEC>
                         Provide list of expected cfgs for checking
-    -L [KIND=]PATH      Add a directory to the library search path. The
-                        optional KIND can be one of dependency, crate, native,
-                        framework, or all (the default).
-    -l [KIND[:MODIFIERS]=]NAME[:RENAME]
+    -L [<KIND>=]<PATH>  Add a directory to the library search path. The
+                        optional KIND can be one of
+                        <dependency|crate|native|framework|all> (default:
+                        all).
+    -l [<KIND>[:<MODIFIERS>]=]<NAME>[:<RENAME>]
                         Link the generated crate(s) to the specified native
                         library NAME. The optional KIND can be one of
-                        static, framework, or dylib (the default).
+                        <static|framework|dylib> (default: dylib).
                         Optional comma separated MODIFIERS
-                        (bundle|verbatim|whole-archive|as-needed)
+                        <bundle|verbatim|whole-archive|as-needed>
                         may be specified each with a prefix of either '+' to
                         enable or '-' to disable.
-        --crate-type [bin|lib|rlib|dylib|cdylib|staticlib|proc-macro]
+        --crate-type <bin|lib|rlib|dylib|cdylib|staticlib|proc-macro>
                         Comma separated list of types of crates
                         for the compiler to emit
-        --crate-name NAME
+        --crate-name <NAME>
                         Specify the name of the crate being built
-        --edition 2015|2018|2021|2024
+        --edition <2015|2018|2021|2024|future>
                         Specify which edition of the compiler to use when
                         compiling code. The default is 2015 and the latest
                         stable edition is 2024.
-        --emit TYPE[=FILE]
+        --emit <TYPE>[=<FILE>]
                         Comma separated list of types of output for the
                         compiler to emit.
                         Each TYPE has the default FILE name:
@@ -39,45 +40,47 @@ Options:
                         * mir - CRATE_NAME.mir
                         * obj - CRATE_NAME.o
                         * thin-link-bitcode - CRATE_NAME.indexing.o
-        --print INFO[=FILE]
+        --print <INFO>[=<FILE>]
                         Compiler information to print on stdout (or to a file)
                         INFO may be one of
-                        (all-target-specs-json|calling-conventions|cfg|check-cfg|code-models|crate-name|crate-root-lint-levels|deployment-target|file-names|host-tuple|link-args|native-static-libs|relocation-models|split-debuginfo|stack-protector-strategies|supported-crate-types|sysroot|target-cpus|target-features|target-libdir|target-list|target-spec-json|tls-models).
+                        <all-target-specs-json|calling-conventions|cfg|check-cfg|code-models|crate-name|crate-root-lint-levels|deployment-target|file-names|host-tuple|link-args|native-static-libs|relocation-models|split-debuginfo|stack-protector-strategies|supported-crate-types|sysroot|target-cpus|target-features|target-libdir|target-list|target-spec-json|tls-models>.
     -g                  Equivalent to -C debuginfo=2
     -O                  Equivalent to -C opt-level=3
-    -o FILENAME         Write output to <filename>
-        --out-dir DIR   Write output to compiler-chosen filename in <dir>
-        --explain OPT   Provide a detailed explanation of an error message
+    -o <FILENAME>       Write output to FILENAME
+        --out-dir <DIR> Write output to compiler-chosen filename in DIR
+        --explain <OPT> Provide a detailed explanation of an error message
         --test          Build a test harness
-        --target TARGET Target triple for which the code is compiled
-    -A, --allow LINT    Set lint allowed
-    -W, --warn LINT     Set lint warnings
-        --force-warn LINT
+        --target <TARGET>
+                        Target triple for which the code is compiled
+    -A, --allow <LINT>  Set lint allowed
+    -W, --warn <LINT>   Set lint warnings
+        --force-warn <LINT>
                         Set lint force-warn
-    -D, --deny LINT     Set lint denied
-    -F, --forbid LINT   Set lint forbidden
-        --cap-lints LEVEL
+    -D, --deny <LINT>   Set lint denied
+    -F, --forbid <LINT> Set lint forbidden
+        --cap-lints <LEVEL>
                         Set the most restrictive lint level. More restrictive
                         lints are capped at this level
-    -C, --codegen OPT[=VALUE]
+    -C, --codegen <OPT>[=<VALUE>]
                         Set a codegen option
     -V, --version       Print version info and exit
     -v, --verbose       Use verbose output
-        --extern NAME[=PATH]
+        --extern <NAME>[=<PATH>]
                         Specify where an external rust library is located
-        --sysroot PATH  Override the system root
-        --error-format human|json|short
+        --sysroot <PATH>
+                        Override the system root
+        --error-format <human|json|short>
                         How errors and other messages are produced
-        --json CONFIG   Configure the JSON output of the compiler
-        --color auto|always|never
+        --json <CONFIG> Configure the JSON output of the compiler
+        --color <auto|always|never>
                         Configure coloring of output:
-                        auto = colorize, if output goes to a tty (default);
-                        always = always colorize output;
-                        never = never colorize output
-        --diagnostic-width WIDTH
+                        * auto = colorize, if output goes to a tty (default);
+                        * always = always colorize output;
+                        * never = never colorize output
+        --diagnostic-width <WIDTH>
                         Inform rustc of the width of the output so that
                         diagnostics can be truncated to fit
-        --remap-path-prefix FROM=TO
+        --remap-path-prefix <FROM>=<TO>
                         Remap source names in all output (compiler messages
                         and output files)
     @path               Read newline separated options from `path`
diff --git a/tests/run-make/rustc-help/help.stdout b/tests/run-make/rustc-help/help.stdout
index 3043755207a..caffe28f498 100644
--- a/tests/run-make/rustc-help/help.stdout
+++ b/tests/run-make/rustc-help/help.stdout
@@ -2,31 +2,32 @@ Usage: rustc [OPTIONS] INPUT
 
 Options:
     -h, --help          Display this message
-        --cfg SPEC      Configure the compilation environment.
-                        SPEC supports the syntax `NAME[="VALUE"]`.
-        --check-cfg SPEC
+        --cfg <SPEC>    Configure the compilation environment.
+                        SPEC supports the syntax `<NAME>[="<VALUE>"]`.
+        --check-cfg <SPEC>
                         Provide list of expected cfgs for checking
-    -L [KIND=]PATH      Add a directory to the library search path. The
-                        optional KIND can be one of dependency, crate, native,
-                        framework, or all (the default).
-    -l [KIND[:MODIFIERS]=]NAME[:RENAME]
+    -L [<KIND>=]<PATH>  Add a directory to the library search path. The
+                        optional KIND can be one of
+                        <dependency|crate|native|framework|all> (default:
+                        all).
+    -l [<KIND>[:<MODIFIERS>]=]<NAME>[:<RENAME>]
                         Link the generated crate(s) to the specified native
                         library NAME. The optional KIND can be one of
-                        static, framework, or dylib (the default).
+                        <static|framework|dylib> (default: dylib).
                         Optional comma separated MODIFIERS
-                        (bundle|verbatim|whole-archive|as-needed)
+                        <bundle|verbatim|whole-archive|as-needed>
                         may be specified each with a prefix of either '+' to
                         enable or '-' to disable.
-        --crate-type [bin|lib|rlib|dylib|cdylib|staticlib|proc-macro]
+        --crate-type <bin|lib|rlib|dylib|cdylib|staticlib|proc-macro>
                         Comma separated list of types of crates
                         for the compiler to emit
-        --crate-name NAME
+        --crate-name <NAME>
                         Specify the name of the crate being built
-        --edition 2015|2018|2021|2024
+        --edition <2015|2018|2021|2024|future>
                         Specify which edition of the compiler to use when
                         compiling code. The default is 2015 and the latest
                         stable edition is 2024.
-        --emit TYPE[=FILE]
+        --emit <TYPE>[=<FILE>]
                         Comma separated list of types of output for the
                         compiler to emit.
                         Each TYPE has the default FILE name:
@@ -39,27 +40,28 @@ Options:
                         * mir - CRATE_NAME.mir
                         * obj - CRATE_NAME.o
                         * thin-link-bitcode - CRATE_NAME.indexing.o
-        --print INFO[=FILE]
+        --print <INFO>[=<FILE>]
                         Compiler information to print on stdout (or to a file)
                         INFO may be one of
-                        (all-target-specs-json|calling-conventions|cfg|check-cfg|code-models|crate-name|crate-root-lint-levels|deployment-target|file-names|host-tuple|link-args|native-static-libs|relocation-models|split-debuginfo|stack-protector-strategies|supported-crate-types|sysroot|target-cpus|target-features|target-libdir|target-list|target-spec-json|tls-models).
+                        <all-target-specs-json|calling-conventions|cfg|check-cfg|code-models|crate-name|crate-root-lint-levels|deployment-target|file-names|host-tuple|link-args|native-static-libs|relocation-models|split-debuginfo|stack-protector-strategies|supported-crate-types|sysroot|target-cpus|target-features|target-libdir|target-list|target-spec-json|tls-models>.
     -g                  Equivalent to -C debuginfo=2
     -O                  Equivalent to -C opt-level=3
-    -o FILENAME         Write output to <filename>
-        --out-dir DIR   Write output to compiler-chosen filename in <dir>
-        --explain OPT   Provide a detailed explanation of an error message
+    -o <FILENAME>       Write output to FILENAME
+        --out-dir <DIR> Write output to compiler-chosen filename in DIR
+        --explain <OPT> Provide a detailed explanation of an error message
         --test          Build a test harness
-        --target TARGET Target triple for which the code is compiled
-    -A, --allow LINT    Set lint allowed
-    -W, --warn LINT     Set lint warnings
-        --force-warn LINT
+        --target <TARGET>
+                        Target triple for which the code is compiled
+    -A, --allow <LINT>  Set lint allowed
+    -W, --warn <LINT>   Set lint warnings
+        --force-warn <LINT>
                         Set lint force-warn
-    -D, --deny LINT     Set lint denied
-    -F, --forbid LINT   Set lint forbidden
-        --cap-lints LEVEL
+    -D, --deny <LINT>   Set lint denied
+    -F, --forbid <LINT> Set lint forbidden
+        --cap-lints <LEVEL>
                         Set the most restrictive lint level. More restrictive
                         lints are capped at this level
-    -C, --codegen OPT[=VALUE]
+    -C, --codegen <OPT>[=<VALUE>]
                         Set a codegen option
     -V, --version       Print version info and exit
     -v, --verbose       Use verbose output
diff --git a/tests/run-make/rustdoc-default-output/output-default.stdout b/tests/run-make/rustdoc-default-output/output-default.stdout
index 563f8ec50cd..78ca8c863eb 100644
--- a/tests/run-make/rustdoc-default-output/output-default.stdout
+++ b/tests/run-make/rustdoc-default-output/output-default.stdout
@@ -11,7 +11,7 @@ Options:
     -o, --out-dir PATH  which directory to place the output
         --crate-name NAME
                         specify the name of this crate
-        --crate-type [bin|lib|rlib|dylib|cdylib|staticlib|proc-macro]
+        --crate-type <bin|lib|rlib|dylib|cdylib|staticlib|proc-macro>
                         Comma separated list of types of crates
                         for the compiler to emit
     -L, --library-path DIR
diff --git a/tests/ui/asm/naked-invalid-attr.rs b/tests/ui/asm/naked-invalid-attr.rs
index c3a3131ee46..6ac9cb9e3a9 100644
--- a/tests/ui/asm/naked-invalid-attr.rs
+++ b/tests/ui/asm/naked-invalid-attr.rs
@@ -51,3 +51,12 @@ fn main() {
     #[unsafe(naked)] //~ ERROR should be applied to a function definition
     || {};
 }
+
+// Check that the path of an attribute without a name is printed correctly (issue #140082)
+#[::a]
+//~^ ERROR attribute incompatible with `#[unsafe(naked)]`
+//~| ERROR failed to resolve: use of unresolved module or unlinked crate `a`
+#[unsafe(naked)]
+extern "C" fn issue_140082() {
+    naked_asm!("")
+}
diff --git a/tests/ui/asm/naked-invalid-attr.stderr b/tests/ui/asm/naked-invalid-attr.stderr
index 81d30e6475d..ef389e7d921 100644
--- a/tests/ui/asm/naked-invalid-attr.stderr
+++ b/tests/ui/asm/naked-invalid-attr.stderr
@@ -1,3 +1,9 @@
+error[E0433]: failed to resolve: use of unresolved module or unlinked crate `a`
+  --> $DIR/naked-invalid-attr.rs:56:5
+   |
+LL | #[::a]
+   |     ^ use of unresolved module or unlinked crate `a`
+
 error: attribute should be applied to a function definition
   --> $DIR/naked-invalid-attr.rs:13:1
    |
@@ -27,6 +33,15 @@ LL |     #[unsafe(naked)]
 LL |     || {};
    |     ----- not a function definition
 
+error[E0736]: attribute incompatible with `#[unsafe(naked)]`
+  --> $DIR/naked-invalid-attr.rs:56:1
+   |
+LL | #[::a]
+   | ^^^^^^ the `{{root}}::a` attribute is incompatible with `#[unsafe(naked)]`
+...
+LL | #[unsafe(naked)]
+   | ---------------- function marked with `#[unsafe(naked)]` here
+
 error: attribute should be applied to a function definition
   --> $DIR/naked-invalid-attr.rs:22:5
    |
@@ -49,5 +64,7 @@ error: attribute should be applied to a function definition
 LL | #![unsafe(naked)]
    | ^^^^^^^^^^^^^^^^^ cannot be applied to crates
 
-error: aborting due to 6 previous errors
+error: aborting due to 8 previous errors
 
+Some errors have detailed explanations: E0433, E0736.
+For more information about an error, try `rustc --explain E0433`.
diff --git a/tests/ui/compiletest-self-test/compile-flags-last.stderr b/tests/ui/compiletest-self-test/compile-flags-last.stderr
index 72d92206e2b..5a48361cfc0 100644
--- a/tests/ui/compiletest-self-test/compile-flags-last.stderr
+++ b/tests/ui/compiletest-self-test/compile-flags-last.stderr
@@ -1,5 +1,5 @@
 error: Argument to option 'cap-lints' missing
        Usage:
-           --cap-lints LEVEL   Set the most restrictive lint level. More restrictive
+           --cap-lints <LEVEL> Set the most restrictive lint level. More restrictive
                                lints are capped at this level
 
diff --git a/tests/ui/copy-a-resource.rs b/tests/ui/copy-a-resource.rs
deleted file mode 100644
index 55f2dd4ee6d..00000000000
--- a/tests/ui/copy-a-resource.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-#[derive(Debug)]
-struct Foo {
-  i: isize,
-}
-
-impl Drop for Foo {
-    fn drop(&mut self) {}
-}
-
-fn foo(i:isize) -> Foo {
-    Foo {
-        i: i
-    }
-}
-
-fn main() {
-    let x = foo(10);
-    let _y = x.clone();
-    //~^ ERROR no method named `clone` found
-    println!("{:?}", x);
-}
diff --git a/tests/ui/invalid-compile-flags/emit-output-types-without-args.stderr b/tests/ui/invalid-compile-flags/emit-output-types-without-args.stderr
index 669913b5765..9e4486a272f 100644
--- a/tests/ui/invalid-compile-flags/emit-output-types-without-args.stderr
+++ b/tests/ui/invalid-compile-flags/emit-output-types-without-args.stderr
@@ -1,6 +1,7 @@
 error: Argument to option 'emit' missing
        Usage:
-           --emit TYPE[=FILE]  Comma separated list of types of output for the
+           --emit <TYPE>[=<FILE>]
+                               Comma separated list of types of output for the
                                compiler to emit.
                                Each TYPE has the default FILE name:
                                * asm - CRATE_NAME.s
diff --git a/tests/ui/invalid-compile-flags/print-without-arg.stderr b/tests/ui/invalid-compile-flags/print-without-arg.stderr
index fd2a36e761b..3048a59d0d0 100644
--- a/tests/ui/invalid-compile-flags/print-without-arg.stderr
+++ b/tests/ui/invalid-compile-flags/print-without-arg.stderr
@@ -1,6 +1,7 @@
 error: Argument to option 'print' missing
        Usage:
-           --print INFO[=FILE] Compiler information to print on stdout (or to a file)
+           --print <INFO>[=<FILE>]
+                               Compiler information to print on stdout (or to a file)
                                INFO may be one of
-                               (all-target-specs-json|calling-conventions|cfg|check-cfg|code-models|crate-name|crate-root-lint-levels|deployment-target|file-names|host-tuple|link-args|native-static-libs|relocation-models|split-debuginfo|stack-protector-strategies|supported-crate-types|sysroot|target-cpus|target-features|target-libdir|target-list|target-spec-json|tls-models).
+                               <all-target-specs-json|calling-conventions|cfg|check-cfg|code-models|crate-name|crate-root-lint-levels|deployment-target|file-names|host-tuple|link-args|native-static-libs|relocation-models|split-debuginfo|stack-protector-strategies|supported-crate-types|sysroot|target-cpus|target-features|target-libdir|target-list|target-spec-json|tls-models>.
 
diff --git a/tests/ui/fail-simple.rs b/tests/ui/macros/no-matching-rule.rs
index 55e547ee72b..55e547ee72b 100644
--- a/tests/ui/fail-simple.rs
+++ b/tests/ui/macros/no-matching-rule.rs
diff --git a/tests/ui/fail-simple.stderr b/tests/ui/macros/no-matching-rule.stderr
index 50c350b3ef5..a6312a843f3 100644
--- a/tests/ui/fail-simple.stderr
+++ b/tests/ui/macros/no-matching-rule.stderr
@@ -1,5 +1,5 @@
 error: no rules expected `@`
-  --> $DIR/fail-simple.rs:2:12
+  --> $DIR/no-matching-rule.rs:2:12
    |
 LL |     panic!(@);
    |            ^ no rules expected this token in macro call
diff --git a/tests/ui/methods/clone-missing.rs b/tests/ui/methods/clone-missing.rs
new file mode 100644
index 00000000000..f2e4ad268c6
--- /dev/null
+++ b/tests/ui/methods/clone-missing.rs
@@ -0,0 +1,19 @@
+// This test checks that calling `.clone()` on a type that does not implement the `Clone` trait
+// results in a compilation error. The `Foo` struct does not derive or implement `Clone`,
+// so attempting to clone it should fail.
+
+struct Foo {
+  i: isize,
+}
+
+fn foo(i:isize) -> Foo {
+    Foo {
+        i: i
+    }
+}
+
+fn main() {
+    let x = foo(10);
+    let _y = x.clone();
+    //~^ ERROR no method named `clone` found
+}
diff --git a/tests/ui/copy-a-resource.stderr b/tests/ui/methods/clone-missing.stderr
index ff1e28bf961..4ab1aae4934 100644
--- a/tests/ui/copy-a-resource.stderr
+++ b/tests/ui/methods/clone-missing.stderr
@@ -1,5 +1,5 @@
 error[E0599]: no method named `clone` found for struct `Foo` in the current scope
-  --> $DIR/copy-a-resource.rs:18:16
+  --> $DIR/clone-missing.rs:17:16
    |
 LL | struct Foo {
    | ---------- method `clone` not found for this struct
diff --git a/tests/ui/modules/mod-pub-access.rs b/tests/ui/modules/mod-pub-access.rs
new file mode 100644
index 00000000000..c07e7a2ff30
--- /dev/null
+++ b/tests/ui/modules/mod-pub-access.rs
@@ -0,0 +1,11 @@
+//@ run-pass
+// This is a name resolution smoke test that ensures paths with more than one
+// segment (e.g., `foo::bar`) resolve correctly.
+// It also serves as a basic visibility test — confirming that a `pub` item
+// inside a private module can still be accessed from outside that module.
+
+mod foo {
+    pub fn bar(_offset: usize) {}
+}
+
+fn main() { foo::bar(0); }
diff --git a/tests/ui/path.rs b/tests/ui/path.rs
deleted file mode 100644
index bd7b99ac01a..00000000000
--- a/tests/ui/path.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-//@ run-pass
-
-mod foo {
-    pub fn bar(_offset: usize) { }
-}
-
-pub fn main() { foo::bar(0); }
diff --git a/tests/ui/capture1.rs b/tests/ui/resolve/fn-item-cant-capture-dynamic-env.rs
index 4f8c04e3fa9..4f8c04e3fa9 100644
--- a/tests/ui/capture1.rs
+++ b/tests/ui/resolve/fn-item-cant-capture-dynamic-env.rs
diff --git a/tests/ui/capture1.stderr b/tests/ui/resolve/fn-item-cant-capture-dynamic-env.stderr
index 8027430de52..6b3e8792011 100644
--- a/tests/ui/capture1.stderr
+++ b/tests/ui/resolve/fn-item-cant-capture-dynamic-env.stderr
@@ -1,5 +1,5 @@
 error[E0434]: can't capture dynamic environment in a fn item
-  --> $DIR/capture1.rs:3:32
+  --> $DIR/fn-item-cant-capture-dynamic-env.rs:3:32
    |
 LL |     fn foo() -> isize { return bar; }
    |                                ^^^
diff --git a/tests/ui/transmute/auxiliary/unnecessary-transmute-path-remap-ice-140277-trans.rs b/tests/ui/transmute/auxiliary/unnecessary-transmute-path-remap-ice-140277-trans.rs
new file mode 100644
index 00000000000..0f273a6f536
--- /dev/null
+++ b/tests/ui/transmute/auxiliary/unnecessary-transmute-path-remap-ice-140277-trans.rs
@@ -0,0 +1,10 @@
+//@ compile-flags: --remap-path-prefix=/=/non-existent
+// helper for ../unnecessary-transmute-path-remap-ice-140277.rs
+
+#[macro_export]
+macro_rules! transmute {
+    ($e:expr) => {{
+        let e = $e;
+        std::mem::transmute(e)
+    }};
+}
diff --git a/tests/ui/transmute/unnecessary-transmute-path-remap-ice-140277.rs b/tests/ui/transmute/unnecessary-transmute-path-remap-ice-140277.rs
new file mode 100644
index 00000000000..756ce7b3d50
--- /dev/null
+++ b/tests/ui/transmute/unnecessary-transmute-path-remap-ice-140277.rs
@@ -0,0 +1,10 @@
+//@ aux-crate: zerocopy=unnecessary-transmute-path-remap-ice-140277-trans.rs
+//@ check-pass
+// tests for a regression in linting for unnecessary transmutes
+// where a span was inacessible for snippet procuring,
+// when remap-path-prefix was set, causing a panic.
+
+fn bytes_at_home(x: [u8; 4]) -> u32 {
+    unsafe { zerocopy::transmute!(x) }
+}
+fn main() {}
diff --git a/tests/ui/type-alias/type-param.rs b/tests/ui/type-alias/type-param.rs
new file mode 100644
index 00000000000..f8e73518bad
--- /dev/null
+++ b/tests/ui/type-alias/type-param.rs
@@ -0,0 +1,11 @@
+//@ run-pass
+// This is a smoke test to ensure that type aliases with type parameters
+// are accepted by the compiler and that the parameters are correctly
+// resolved in the aliased item type.
+
+#![allow(dead_code)]
+
+type Foo<T> = extern "C" fn(T) -> bool;
+type Bar<T> = fn(T) -> bool;
+
+fn main() {}
diff --git a/tests/ui/type-param.rs b/tests/ui/type-param.rs
deleted file mode 100644
index e7cf0e5446b..00000000000
--- a/tests/ui/type-param.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-//@ run-pass
-
-#![allow(non_camel_case_types)]
-#![allow(dead_code)]
-
-
-
-type lteq<T> = extern "C" fn(T) -> bool;
-
-pub fn main() { }