Auto merge of #149717 - matthiaskrgr:rollup-spntobh, r=matthiaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#149659 (Look for typos when reporting an unknown nightly feature)
 - rust-lang/rust#149699 (Implement `Vec::from_fn`)
 - rust-lang/rust#149700 (rustdoc: fix bugs with search aliases and merging)
 - rust-lang/rust#149713 (Update windows-gnullvm platform support doc)
 - rust-lang/rust#149716 (miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
diff --git a/compiler/rustc_ast/src/lib.rs b/compiler/rustc_ast/src/lib.rs
index e19dccb..cbdc89f 100644
--- a/compiler/rustc_ast/src/lib.rs
+++ b/compiler/rustc_ast/src/lib.rs
@@ -5,8 +5,8 @@
 //! This API is completely unstable and subject to change.
 
 // tidy-alphabetical-start
+#![cfg_attr(bootstrap, feature(array_windows))]
 #![doc(test(attr(deny(warnings), allow(internal_features))))]
-#![feature(array_windows)]
 #![feature(associated_type_defaults)]
 #![feature(box_patterns)]
 #![feature(if_let_guard)]
diff --git a/compiler/rustc_data_structures/src/lib.rs b/compiler/rustc_data_structures/src/lib.rs
index b403197..41f6292 100644
--- a/compiler/rustc_data_structures/src/lib.rs
+++ b/compiler/rustc_data_structures/src/lib.rs
@@ -10,9 +10,9 @@
 #![allow(internal_features)]
 #![allow(rustc::default_hash_types)]
 #![allow(rustc::potential_query_instability)]
+#![cfg_attr(bootstrap, feature(array_windows))]
 #![deny(unsafe_op_in_unsafe_fn)]
 #![feature(allocator_api)]
-#![feature(array_windows)]
 #![feature(ascii_char)]
 #![feature(ascii_char_variants)]
 #![feature(assert_matches)]
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs
index 12e6700..d1d52e1 100644
--- a/compiler/rustc_errors/src/lib.rs
+++ b/compiler/rustc_errors/src/lib.rs
@@ -7,7 +7,7 @@
 #![allow(rustc::diagnostic_outside_of_impl)]
 #![allow(rustc::direct_use_of_rustc_type_ir)]
 #![allow(rustc::untranslatable_diagnostic)]
-#![feature(array_windows)]
+#![cfg_attr(bootstrap, feature(array_windows))]
 #![feature(assert_matches)]
 #![feature(associated_type_defaults)]
 #![feature(box_patterns)]
diff --git a/compiler/rustc_expand/src/lib.rs b/compiler/rustc_expand/src/lib.rs
index e76fca9..5eefa4b 100644
--- a/compiler/rustc_expand/src/lib.rs
+++ b/compiler/rustc_expand/src/lib.rs
@@ -1,7 +1,7 @@
 // tidy-alphabetical-start
 #![allow(internal_features)]
 #![allow(rustc::diagnostic_outside_of_impl)]
-#![feature(array_windows)]
+#![cfg_attr(bootstrap, feature(array_windows))]
 #![feature(associated_type_defaults)]
 #![feature(if_let_guard)]
 #![feature(macro_metavar_expr)]
diff --git a/compiler/rustc_lint/src/lib.rs b/compiler/rustc_lint/src/lib.rs
index 23afbf6..a5f9eab 100644
--- a/compiler/rustc_lint/src/lib.rs
+++ b/compiler/rustc_lint/src/lib.rs
@@ -21,7 +21,7 @@
 
 // tidy-alphabetical-start
 #![allow(internal_features)]
-#![feature(array_windows)]
+#![cfg_attr(bootstrap, feature(array_windows))]
 #![feature(assert_matches)]
 #![feature(box_patterns)]
 #![feature(if_let_guard)]
diff --git a/compiler/rustc_middle/src/lib.rs b/compiler/rustc_middle/src/lib.rs
index ef8326f..5f62d44 100644
--- a/compiler/rustc_middle/src/lib.rs
+++ b/compiler/rustc_middle/src/lib.rs
@@ -29,8 +29,8 @@
 #![allow(rustc::diagnostic_outside_of_impl)]
 #![allow(rustc::direct_use_of_rustc_type_ir)]
 #![allow(rustc::untranslatable_diagnostic)]
+#![cfg_attr(bootstrap, feature(array_windows))]
 #![feature(allocator_api)]
-#![feature(array_windows)]
 #![feature(assert_matches)]
 #![feature(associated_type_defaults)]
 #![feature(box_as_ptr)]
diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs
index 06744ae..6a4122a 100644
--- a/compiler/rustc_middle/src/ty/print/pretty.rs
+++ b/compiler/rustc_middle/src/ty/print/pretty.rs
@@ -105,7 +105,7 @@ pub fn $name() -> bool {
     ///
     /// Overrides `with_crate_prefix`.
 
-    // This function is not currently used in-tree, but it's used by a downstream rustc-driver in
+    // This function is used by `rustc_public` and downstream rustc-driver in
     // Ferrocene. Please check with them before removing it.
     fn with_resolve_crate_name(CrateNamePrefixGuard, SHOULD_PREFIX_WITH_CRATE_NAME);
     /// Adds the `crate::` prefix to paths where appropriate.
diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs
index 9a964d5..6415f39 100644
--- a/compiler/rustc_mir_transform/src/lib.rs
+++ b/compiler/rustc_mir_transform/src/lib.rs
@@ -1,5 +1,5 @@
 // tidy-alphabetical-start
-#![feature(array_windows)]
+#![cfg_attr(bootstrap, feature(array_windows))]
 #![feature(assert_matches)]
 #![feature(box_patterns)]
 #![feature(const_type_name)]
diff --git a/compiler/rustc_monomorphize/src/lib.rs b/compiler/rustc_monomorphize/src/lib.rs
index 0568394..8b48cf5 100644
--- a/compiler/rustc_monomorphize/src/lib.rs
+++ b/compiler/rustc_monomorphize/src/lib.rs
@@ -1,5 +1,5 @@
 // tidy-alphabetical-start
-#![feature(array_windows)]
+#![cfg_attr(bootstrap, feature(array_windows))]
 #![feature(file_buffered)]
 #![feature(if_let_guard)]
 #![feature(impl_trait_in_assoc_type)]
diff --git a/compiler/rustc_public/src/lib.rs b/compiler/rustc_public/src/lib.rs
index f470eeb..5da7919 100644
--- a/compiler/rustc_public/src/lib.rs
+++ b/compiler/rustc_public/src/lib.rs
@@ -178,7 +178,7 @@ pub fn is_foreign_item(&self) -> bool {
     pub fn emit_mir<W: io::Write>(&self, w: &mut W) -> io::Result<()> {
         self.body()
             .ok_or_else(|| io::Error::other(format!("No body found for `{}`", self.name())))?
-            .dump(w, &self.name())
+            .dump(w, &self.trimmed_name())
     }
 }
 
diff --git a/compiler/rustc_public/src/mir/pretty.rs b/compiler/rustc_public/src/mir/pretty.rs
index d80e227..08e4e0c 100644
--- a/compiler/rustc_public/src/mir/pretty.rs
+++ b/compiler/rustc_public/src/mir/pretty.rs
@@ -412,7 +412,7 @@ fn pretty_aggregate<W: Write>(
         }
         AggregateKind::Adt(def, var, _, _, _) => {
             if def.kind() == AdtKind::Enum {
-                write!(writer, "{}::{}", def.name(), def.variant(*var).unwrap().name())?;
+                write!(writer, "{}::{}", def.trimmed_name(), def.variant(*var).unwrap().name())?;
             } else {
                 write!(writer, "{}", def.variant(*var).unwrap().name())?;
             }
diff --git a/compiler/rustc_public/src/ty.rs b/compiler/rustc_public/src/ty.rs
index f24d98f..14656a2 100644
--- a/compiler/rustc_public/src/ty.rs
+++ b/compiler/rustc_public/src/ty.rs
@@ -876,6 +876,9 @@ pub struct VariantDef {
 }
 
 impl VariantDef {
+    /// The name of the variant, struct or union.
+    ///
+    /// This will not include the name of the enum or qualified path.
     pub fn name(&self) -> Symbol {
         with(|cx| cx.variant_name(*self))
     }
diff --git a/compiler/rustc_public_bridge/src/context/impls.rs b/compiler/rustc_public_bridge/src/context/impls.rs
index cbb00d6..26728a3 100644
--- a/compiler/rustc_public_bridge/src/context/impls.rs
+++ b/compiler/rustc_public_bridge/src/context/impls.rs
@@ -10,7 +10,9 @@
 use rustc_middle::mir::interpret::{AllocId, ConstAllocation, ErrorHandled, GlobalAlloc, Scalar};
 use rustc_middle::mir::{BinOp, Body, Const as MirConst, ConstValue, UnOp};
 use rustc_middle::ty::layout::{FnAbiOf, LayoutOf};
-use rustc_middle::ty::print::{with_forced_trimmed_paths, with_no_trimmed_paths};
+use rustc_middle::ty::print::{
+    with_forced_trimmed_paths, with_no_trimmed_paths, with_resolve_crate_name,
+};
 use rustc_middle::ty::util::Discr;
 use rustc_middle::ty::{
     AdtDef, AdtKind, AssocItem, Binder, ClosureKind, CoroutineArgsExt, EarlyBinder,
@@ -264,7 +266,8 @@ pub fn def_name(&self, def_id: DefId, trimmed: bool) -> String {
         if trimmed {
             with_forced_trimmed_paths!(self.tcx.def_path_str(def_id))
         } else {
-            with_no_trimmed_paths!(self.tcx.def_path_str(def_id))
+            // For local definitions, we need to prepend with crate name.
+            with_resolve_crate_name!(with_no_trimmed_paths!(self.tcx.def_path_str(def_id)))
         }
     }
 
@@ -724,9 +727,9 @@ pub fn instance_name(&self, instance: ty::Instance<'tcx>, trimmed: bool) -> Stri
                 self.tcx.def_path_str_with_args(instance.def_id(), instance.args)
             )
         } else {
-            with_no_trimmed_paths!(
+            with_resolve_crate_name!(with_no_trimmed_paths!(
                 self.tcx.def_path_str_with_args(instance.def_id(), instance.args)
-            )
+            ))
         }
     }
 
diff --git a/compiler/rustc_span/src/lib.rs b/compiler/rustc_span/src/lib.rs
index 2e03ccb..31f8286 100644
--- a/compiler/rustc_span/src/lib.rs
+++ b/compiler/rustc_span/src/lib.rs
@@ -17,8 +17,8 @@
 
 // tidy-alphabetical-start
 #![allow(internal_features)]
+#![cfg_attr(bootstrap, feature(array_windows))]
 #![cfg_attr(target_arch = "loongarch64", feature(stdarch_loongarch))]
-#![feature(array_windows)]
 #![feature(cfg_select)]
 #![feature(core_io_borrowed_buf)]
 #![feature(if_let_guard)]
diff --git a/library/alloc/src/lib.rs b/library/alloc/src/lib.rs
index bf73deb..8097e43 100644
--- a/library/alloc/src/lib.rs
+++ b/library/alloc/src/lib.rs
@@ -89,7 +89,6 @@
 #![feature(alloc_layout_extra)]
 #![feature(allocator_api)]
 #![feature(array_into_iter_constructors)]
-#![feature(array_windows)]
 #![feature(ascii_char)]
 #![feature(assert_matches)]
 #![feature(async_fn_traits)]
diff --git a/library/alloc/src/slice.rs b/library/alloc/src/slice.rs
index a83b51c..e7d0fc3 100644
--- a/library/alloc/src/slice.rs
+++ b/library/alloc/src/slice.rs
@@ -18,7 +18,7 @@
 use core::mem::MaybeUninit;
 #[cfg(not(no_global_oom_handling))]
 use core::ptr;
-#[unstable(feature = "array_windows", issue = "75027")]
+#[stable(feature = "array_windows", since = "CURRENT_RUSTC_VERSION")]
 pub use core::slice::ArrayWindows;
 #[stable(feature = "inherent_ascii_escape", since = "1.60.0")]
 pub use core::slice::EscapeAscii;
diff --git a/library/core/src/alloc/mod.rs b/library/core/src/alloc/mod.rs
index 9d608d5..680b1ec 100644
--- a/library/core/src/alloc/mod.rs
+++ b/library/core/src/alloc/mod.rs
@@ -421,3 +421,58 @@ unsafe fn shrink(
         unsafe { (**self).shrink(ptr, old_layout, new_layout) }
     }
 }
+
+#[unstable(feature = "allocator_api", issue = "32838")]
+unsafe impl<A> Allocator for &mut A
+where
+    A: Allocator + ?Sized,
+{
+    #[inline]
+    fn allocate(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
+        (**self).allocate(layout)
+    }
+
+    #[inline]
+    fn allocate_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError> {
+        (**self).allocate_zeroed(layout)
+    }
+
+    #[inline]
+    unsafe fn deallocate(&self, ptr: NonNull<u8>, layout: Layout) {
+        // SAFETY: the safety contract must be upheld by the caller
+        unsafe { (**self).deallocate(ptr, layout) }
+    }
+
+    #[inline]
+    unsafe fn grow(
+        &self,
+        ptr: NonNull<u8>,
+        old_layout: Layout,
+        new_layout: Layout,
+    ) -> Result<NonNull<[u8]>, AllocError> {
+        // SAFETY: the safety contract must be upheld by the caller
+        unsafe { (**self).grow(ptr, old_layout, new_layout) }
+    }
+
+    #[inline]
+    unsafe fn grow_zeroed(
+        &self,
+        ptr: NonNull<u8>,
+        old_layout: Layout,
+        new_layout: Layout,
+    ) -> Result<NonNull<[u8]>, AllocError> {
+        // SAFETY: the safety contract must be upheld by the caller
+        unsafe { (**self).grow_zeroed(ptr, old_layout, new_layout) }
+    }
+
+    #[inline]
+    unsafe fn shrink(
+        &self,
+        ptr: NonNull<u8>,
+        old_layout: Layout,
+        new_layout: Layout,
+    ) -> Result<NonNull<[u8]>, AllocError> {
+        // SAFETY: the safety contract must be upheld by the caller
+        unsafe { (**self).shrink(ptr, old_layout, new_layout) }
+    }
+}
diff --git a/library/core/src/option.rs b/library/core/src/option.rs
index 57098b9..0345ec4 100644
--- a/library/core/src/option.rs
+++ b/library/core/src/option.rs
@@ -2008,6 +2008,30 @@ pub fn reduce<U, R, F>(self, other: Option<U>, f: F) -> Option<R>
     }
 }
 
+impl<T: IntoIterator> Option<T> {
+    /// Transforms an optional iterator into an iterator.
+    ///
+    /// If `self` is `None`, the resulting iterator is empty.
+    /// Otherwise, an iterator is made from the `Some` value and returned.
+    /// # Examples
+    /// ```
+    /// #![feature(option_into_flat_iter)]
+    ///
+    /// let o1 = Some([1, 2]);
+    /// let o2 = None::<&[usize]>;
+    ///
+    /// assert_eq!(o1.into_flat_iter().collect::<Vec<_>>(), [1, 2]);
+    /// assert_eq!(o2.into_flat_iter().collect::<Vec<_>>(), Vec::<&usize>::new());
+    /// ```
+    #[unstable(feature = "option_into_flat_iter", issue = "148441")]
+    pub fn into_flat_iter<A>(self) -> OptionFlatten<A>
+    where
+        T: IntoIterator<IntoIter = A>,
+    {
+        OptionFlatten { iter: self.map(IntoIterator::into_iter) }
+    }
+}
+
 impl<T, U> Option<(T, U)> {
     /// Unzips an option containing a tuple of two options.
     ///
@@ -2575,6 +2599,42 @@ impl<A> FusedIterator for IntoIter<A> {}
 #[unstable(feature = "trusted_len", issue = "37572")]
 unsafe impl<A> TrustedLen for IntoIter<A> {}
 
+/// The iterator produced by [`Option::into_flat_iter`]. See its documentation for more.
+#[derive(Clone, Debug)]
+#[unstable(feature = "option_into_flat_iter", issue = "148441")]
+pub struct OptionFlatten<A> {
+    iter: Option<A>,
+}
+
+#[unstable(feature = "option_into_flat_iter", issue = "148441")]
+impl<A: Iterator> Iterator for OptionFlatten<A> {
+    type Item = A::Item;
+
+    fn next(&mut self) -> Option<Self::Item> {
+        self.iter.as_mut()?.next()
+    }
+
+    fn size_hint(&self) -> (usize, Option<usize>) {
+        self.iter.as_ref().map(|i| i.size_hint()).unwrap_or((0, Some(0)))
+    }
+}
+
+#[unstable(feature = "option_into_flat_iter", issue = "148441")]
+impl<A: DoubleEndedIterator> DoubleEndedIterator for OptionFlatten<A> {
+    fn next_back(&mut self) -> Option<Self::Item> {
+        self.iter.as_mut()?.next_back()
+    }
+}
+
+#[unstable(feature = "option_into_flat_iter", issue = "148441")]
+impl<A: ExactSizeIterator> ExactSizeIterator for OptionFlatten<A> {}
+
+#[unstable(feature = "option_into_flat_iter", issue = "148441")]
+impl<A: FusedIterator> FusedIterator for OptionFlatten<A> {}
+
+#[unstable(feature = "option_into_flat_iter", issue = "148441")]
+unsafe impl<A: TrustedLen> TrustedLen for OptionFlatten<A> {}
+
 /////////////////////////////////////////////////////////////////////////////
 // FromIterator
 /////////////////////////////////////////////////////////////////////////////
diff --git a/library/core/src/slice/iter.rs b/library/core/src/slice/iter.rs
index f10b26c..cfcb51d 100644
--- a/library/core/src/slice/iter.rs
+++ b/library/core/src/slice/iter.rs
@@ -2165,8 +2165,6 @@ unsafe impl<T> Sync for ChunksExactMut<'_, T> where T: Sync {}
 /// # Example
 ///
 /// ```
-/// #![feature(array_windows)]
-///
 /// let slice = [0, 1, 2, 3];
 /// let mut iter = slice.array_windows::<2>();
 /// assert_eq!(iter.next(), Some(&[0, 1]));
@@ -2178,7 +2176,7 @@ unsafe impl<T> Sync for ChunksExactMut<'_, T> where T: Sync {}
 /// [`array_windows`]: slice::array_windows
 /// [slices]: slice
 #[derive(Debug, Clone, Copy)]
-#[unstable(feature = "array_windows", issue = "75027")]
+#[stable(feature = "array_windows", since = "CURRENT_RUSTC_VERSION")]
 #[must_use = "iterators are lazy and do nothing unless consumed"]
 pub struct ArrayWindows<'a, T: 'a, const N: usize> {
     v: &'a [T],
@@ -2191,7 +2189,7 @@ pub(super) const fn new(slice: &'a [T]) -> Self {
     }
 }
 
-#[unstable(feature = "array_windows", issue = "75027")]
+#[stable(feature = "array_windows", since = "CURRENT_RUSTC_VERSION")]
 impl<'a, T, const N: usize> Iterator for ArrayWindows<'a, T, N> {
     type Item = &'a [T; N];
 
@@ -2228,7 +2226,7 @@ fn last(self) -> Option<Self::Item> {
     }
 }
 
-#[unstable(feature = "array_windows", issue = "75027")]
+#[stable(feature = "array_windows", since = "CURRENT_RUSTC_VERSION")]
 impl<'a, T, const N: usize> DoubleEndedIterator for ArrayWindows<'a, T, N> {
     #[inline]
     fn next_back(&mut self) -> Option<&'a [T; N]> {
@@ -2247,7 +2245,7 @@ impl<'a, T, const N: usize> DoubleEndedIterator for ArrayWindows<'a, T, N> {
     }
 }
 
-#[unstable(feature = "array_windows", issue = "75027")]
+#[stable(feature = "array_windows", since = "CURRENT_RUSTC_VERSION")]
 impl<T, const N: usize> ExactSizeIterator for ArrayWindows<'_, T, N> {
     fn is_empty(&self) -> bool {
         self.v.len() < N
diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs
index f03f204..dc34d2a 100644
--- a/library/core/src/slice/mod.rs
+++ b/library/core/src/slice/mod.rs
@@ -51,7 +51,7 @@
 pub use index::SliceIndex;
 #[unstable(feature = "slice_range", issue = "76393")]
 pub use index::{range, try_range};
-#[unstable(feature = "array_windows", issue = "75027")]
+#[stable(feature = "array_windows", since = "CURRENT_RUSTC_VERSION")]
 pub use iter::ArrayWindows;
 #[stable(feature = "slice_group_by", since = "1.77.0")]
 pub use iter::{ChunkBy, ChunkByMut};
@@ -1620,13 +1620,15 @@ pub const fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_
     ///
     /// # Panics
     ///
-    /// Panics if `N` is zero. This check will most probably get changed to a compile time
-    /// error before this method gets stabilized.
+    /// Panics if `N` is zero.
+    ///
+    /// Note that this check is against a const generic parameter, not a runtime
+    /// value, and thus a particular monomorphization will either always panic
+    /// or it will never panic.
     ///
     /// # Examples
     ///
     /// ```
-    /// #![feature(array_windows)]
     /// let slice = [0, 1, 2, 3];
     /// let mut iter = slice.array_windows();
     /// assert_eq!(iter.next().unwrap(), &[0, 1]);
@@ -1636,7 +1638,7 @@ pub const fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_
     /// ```
     ///
     /// [`windows`]: slice::windows
-    #[unstable(feature = "array_windows", issue = "75027")]
+    #[stable(feature = "array_windows", since = "CURRENT_RUSTC_VERSION")]
     #[rustc_const_unstable(feature = "const_slice_make_iter", issue = "137737")]
     #[inline]
     #[track_caller]
diff --git a/library/coretests/tests/lib.rs b/library/coretests/tests/lib.rs
index eb2a216..1c1f2cd 100644
--- a/library/coretests/tests/lib.rs
+++ b/library/coretests/tests/lib.rs
@@ -5,7 +5,6 @@
 #![feature(array_ptr_get)]
 #![feature(array_try_from_fn)]
 #![feature(array_try_map)]
-#![feature(array_windows)]
 #![feature(ascii_char)]
 #![feature(ascii_char_variants)]
 #![feature(async_iter_from_iter)]
diff --git a/src/doc/rustc/src/platform-support/arm-none-eabi.md b/src/doc/rustc/src/platform-support/arm-none-eabi.md
index aaa80e4..81545db 100644
--- a/src/doc/rustc/src/platform-support/arm-none-eabi.md
+++ b/src/doc/rustc/src/platform-support/arm-none-eabi.md
@@ -16,6 +16,7 @@
 - Arm R-Profile Architectures
   - [`armv7r-none-eabi` and `armv7r-none-eabihf`](armv7r-none-eabi.md)
   - [`armebv7r-none-eabi` and `armebv7r-none-eabihf`](armebv7r-none-eabi.md)
+  - [`armv8r-none-eabihf`](armv8r-none-eabihf.md)
 - Arm M-Profile Architectures
   - [`thumbv6m-none-eabi`](thumbv6m-none-eabi.md)
   - [`thumbv7m-none-eabi`](thumbv7m-none-eabi.md)
@@ -30,7 +31,7 @@
 - Arm A-Profile Architectures
   - [`armv7a-none-eabihf`](armv7a-none-eabi.md)
 - Arm R-Profile Architectures
-  - [`armv8r-none-eabihf`](armv8r-none-eabihf.md)
+  - None
 - Arm M-Profile Architectures
   - None
 - *Legacy* Arm Architectures
diff --git a/src/tools/clippy/clippy_lints/src/lib.rs b/src/tools/clippy/clippy_lints/src/lib.rs
index 230d83d..bc62d9b 100644
--- a/src/tools/clippy/clippy_lints/src/lib.rs
+++ b/src/tools/clippy/clippy_lints/src/lib.rs
@@ -1,4 +1,4 @@
-#![feature(array_windows)]
+#![cfg_attr(bootstrap, feature(array_windows))]
 #![feature(box_patterns)]
 #![feature(macro_metavar_expr_concat)]
 #![feature(f128)]
diff --git a/src/tools/clippy/clippy_utils/src/lib.rs b/src/tools/clippy/clippy_utils/src/lib.rs
index ed164fc..409f130 100644
--- a/src/tools/clippy/clippy_utils/src/lib.rs
+++ b/src/tools/clippy/clippy_utils/src/lib.rs
@@ -5,7 +5,7 @@
 #![feature(rustc_private)]
 #![feature(assert_matches)]
 #![feature(unwrap_infallible)]
-#![feature(array_windows)]
+#![cfg_attr(bootstrap, feature(array_windows))]
 #![recursion_limit = "512"]
 #![allow(
     clippy::missing_errors_doc,
diff --git a/tests/ui-fulldeps/rustc_public/check_abi.rs b/tests/ui-fulldeps/rustc_public/check_abi.rs
index 57c8377..b3519a2 100644
--- a/tests/ui-fulldeps/rustc_public/check_abi.rs
+++ b/tests/ui-fulldeps/rustc_public/check_abi.rs
@@ -9,10 +9,10 @@
 #![feature(assert_matches)]
 #![feature(ascii_char, ascii_char_variants)]
 
-extern crate rustc_hir;
-extern crate rustc_middle;
 extern crate rustc_driver;
+extern crate rustc_hir;
 extern crate rustc_interface;
+extern crate rustc_middle;
 #[macro_use]
 extern crate rustc_public;
 
@@ -39,7 +39,7 @@ fn test_stable_mir() -> ControlFlow<()> {
     let items = rustc_public::all_local_items();
 
     // Test fn_abi
-    let target_fn = *get_item(&items, (ItemKind::Fn, "fn_abi")).unwrap();
+    let target_fn = *get_item(&items, (ItemKind::Fn, "input::fn_abi")).unwrap();
     let instance = Instance::try_from(target_fn).unwrap();
     let fn_abi = instance.fn_abi().unwrap();
     assert_eq!(fn_abi.conv, CallConvention::Rust);
@@ -51,11 +51,11 @@ fn test_stable_mir() -> ControlFlow<()> {
     check_result(&fn_abi.ret);
 
     // Test variadic function.
-    let variadic_fn = *get_item(&items, (ItemKind::Fn, "variadic_fn")).unwrap();
+    let variadic_fn = *get_item(&items, (ItemKind::Fn, "input::variadic_fn")).unwrap();
     check_variadic(variadic_fn);
 
     // Extract function pointers.
-    let fn_ptr_holder = *get_item(&items, (ItemKind::Fn, "fn_ptr_holder")).unwrap();
+    let fn_ptr_holder = *get_item(&items, (ItemKind::Fn, "input::fn_ptr_holder")).unwrap();
     let fn_ptr_holder_instance = Instance::try_from(fn_ptr_holder).unwrap();
     let body = fn_ptr_holder_instance.body().unwrap();
     let args = body.arg_locals();
diff --git a/tests/ui-fulldeps/rustc_public/check_allocation.rs b/tests/ui-fulldeps/rustc_public/check_allocation.rs
index 70e4ee3..3a0a238 100644
--- a/tests/ui-fulldeps/rustc_public/check_allocation.rs
+++ b/tests/ui-fulldeps/rustc_public/check_allocation.rs
@@ -40,11 +40,11 @@
 fn test_stable_mir() -> ControlFlow<()> {
     // Find items in the local crate.
     let items = rustc_public::all_local_items();
-    check_foo(*get_item(&items, (ItemKind::Static, "FOO")).unwrap());
-    check_bar(*get_item(&items, (ItemKind::Static, "BAR")).unwrap());
-    check_len(*get_item(&items, (ItemKind::Static, "LEN")).unwrap());
-    check_cstr(*get_item(&items, (ItemKind::Static, "C_STR")).unwrap());
-    check_other_consts(*get_item(&items, (ItemKind::Fn, "other_consts")).unwrap());
+    check_foo(*get_item(&items, (ItemKind::Static, "input::FOO")).unwrap());
+    check_bar(*get_item(&items, (ItemKind::Static, "input::BAR")).unwrap());
+    check_len(*get_item(&items, (ItemKind::Static, "input::LEN")).unwrap());
+    check_cstr(*get_item(&items, (ItemKind::Static, "input::C_STR")).unwrap());
+    check_other_consts(*get_item(&items, (ItemKind::Fn, "input::other_consts")).unwrap());
     ControlFlow::Continue(())
 }
 
diff --git a/tests/ui-fulldeps/rustc_public/check_assoc_items.rs b/tests/ui-fulldeps/rustc_public/check_assoc_items.rs
index 1557991..194d6be 100644
--- a/tests/ui-fulldeps/rustc_public/check_assoc_items.rs
+++ b/tests/ui-fulldeps/rustc_public/check_assoc_items.rs
@@ -77,7 +77,7 @@ fn test_assoc_items() -> ControlFlow<()> {
 /// Note that order doesn't matter.
 fn check_items<T: CrateDef>(items: &[T], expected: &[&str]) {
     let expected: HashSet<_> = expected.iter().map(|s| s.to_string()).collect();
-    let item_names: HashSet<_> = items.iter().map(|item| item.name()).collect();
+    let item_names: HashSet<_> = items.iter().map(|item| item.trimmed_name()).collect();
     assert_eq!(item_names, expected);
 }
 
diff --git a/tests/ui-fulldeps/rustc_public/check_attribute.rs b/tests/ui-fulldeps/rustc_public/check_attribute.rs
index 0c34ac4..393ff4c 100644
--- a/tests/ui-fulldeps/rustc_public/check_attribute.rs
+++ b/tests/ui-fulldeps/rustc_public/check_attribute.rs
@@ -38,16 +38,13 @@ fn test_tool(items: &CrateItems) {
     assert_eq!(rustfmt_attrs[0].as_str(), "#[rustfmt::skip]\n");
 
     let clippy_fn = *get_item(&items, "complex_fn").unwrap();
-    let clippy_attrs = clippy_fn.tool_attrs(&["clippy".to_string(),
-                                               "cyclomatic_complexity".to_string()]);
+    let clippy_attrs =
+        clippy_fn.tool_attrs(&["clippy".to_string(), "cyclomatic_complexity".to_string()]);
     assert_eq!(clippy_attrs[0].as_str(), "#[clippy::cyclomatic_complexity = \"100\"]\n");
 }
 
-fn get_item<'a>(
-    items: &'a CrateItems,
-    name: &str,
-) -> Option<&'a rustc_public::CrateItem> {
-    items.iter().find(|crate_item| crate_item.name() == name)
+fn get_item<'a>(items: &'a CrateItems, name: &str) -> Option<&'a rustc_public::CrateItem> {
+    items.iter().find(|crate_item| crate_item.trimmed_name() == name)
 }
 
 /// This test will generate and analyze a dummy crate using the stable mir.
diff --git a/tests/ui-fulldeps/rustc_public/check_coroutine_body.rs b/tests/ui-fulldeps/rustc_public/check_coroutine_body.rs
index 725b538..75f4f1f 100644
--- a/tests/ui-fulldeps/rustc_public/check_coroutine_body.rs
+++ b/tests/ui-fulldeps/rustc_public/check_coroutine_body.rs
@@ -29,11 +29,7 @@ fn test_coroutine_body() -> ControlFlow<()> {
     if let Some(body) = crate_items.iter().find_map(|item| {
         let item_ty = item.ty();
         if let TyKind::RigidTy(RigidTy::Coroutine(def, ..)) = &item_ty.kind() {
-            if def.0.name() == "gbc::{closure#0}".to_string() {
-                def.body()
-            } else {
-                None
-            }
+            if def.0.trimmed_name() == "gbc::{closure#0}".to_string() { def.body() } else { None }
         } else {
             None
         }
@@ -51,26 +47,23 @@ fn check_coroutine_body(body: Body) {
     let local_3 = &body.locals()[3].ty;
     let local_4 = &body.locals()[4].ty;
 
-    let TyKind::RigidTy(RigidTy::Adt(def, ..)) = &ret_ty.kind()
-    else {
+    let TyKind::RigidTy(RigidTy::Adt(def, ..)) = &ret_ty.kind() else {
         panic!("Expected RigidTy::Adt, got: {:#?}", ret_ty);
     };
 
     assert_eq!("std::task::Poll", def.0.name());
 
-    let TyKind::RigidTy(RigidTy::Coroutine(def, ..)) = &local_3.kind()
-    else {
+    let TyKind::RigidTy(RigidTy::Coroutine(def, ..)) = &local_3.kind() else {
         panic!("Expected RigidTy::Coroutine, got: {:#?}", local_3);
     };
 
-    assert_eq!("gbc::{closure#0}::{closure#0}", def.0.name());
+    assert_eq!("crate_coroutine_body::gbc::{closure#0}::{closure#0}", def.0.name());
 
-    let TyKind::RigidTy(RigidTy::Coroutine(def, ..)) = &local_4.kind()
-    else {
+    let TyKind::RigidTy(RigidTy::Coroutine(def, ..)) = &local_4.kind() else {
         panic!("Expected RigidTy::Coroutine, got: {:#?}", local_4);
     };
 
-    assert_eq!("gbc::{closure#0}::{closure#0}", def.0.name());
+    assert_eq!("crate_coroutine_body::gbc::{closure#0}::{closure#0}", def.0.name());
 }
 
 fn main() {
diff --git a/tests/ui-fulldeps/rustc_public/check_crate_defs.rs b/tests/ui-fulldeps/rustc_public/check_crate_defs.rs
index 3ca8b66..7d949ea 100644
--- a/tests/ui-fulldeps/rustc_public/check_crate_defs.rs
+++ b/tests/ui-fulldeps/rustc_public/check_crate_defs.rs
@@ -27,17 +27,20 @@
 fn test_stable_mir() -> ControlFlow<()> {
     // Find items in the local crate.
     let local = rustc_public::local_crate();
-    check_items(&local.statics(), &["PRIVATE_STATIC", "dummy::PUBLIC_STATIC"]);
+    check_items(
+        &local.statics(),
+        &["crate_defs::PRIVATE_STATIC", "crate_defs::dummy::PUBLIC_STATIC"],
+    );
     check_items(
         &local.fn_defs(),
         &[
-            "top_level",
-            "dummy::public_fn",
-            "dummy::private_fn",
-            "dummy::PrivateStruct::new",
-            "<dummy::PrivateStruct as std::ops::Drop>::drop",
-            "DummyTrait::method",
-            "<T as DummyTrait>::method",
+            "crate_defs::top_level",
+            "crate_defs::dummy::public_fn",
+            "crate_defs::dummy::private_fn",
+            "crate_defs::dummy::PrivateStruct::new",
+            "<crate_defs::dummy::PrivateStruct as std::ops::Drop>::drop",
+            "crate_defs::DummyTrait::method",
+            "<T as crate_defs::DummyTrait>::method",
         ],
     );
 
diff --git a/tests/ui-fulldeps/rustc_public/check_def_parent.rs b/tests/ui-fulldeps/rustc_public/check_def_parent.rs
index 192ad47..7f633a6 100644
--- a/tests/ui-fulldeps/rustc_public/check_def_parent.rs
+++ b/tests/ui-fulldeps/rustc_public/check_def_parent.rs
@@ -47,44 +47,47 @@ fn set_once<T: Debug + PartialEq>(slot: &mut Option<T>, val: T) {
     let krate = rustc_public::local_crate();
     for it in rustc_public::all_local_items() {
         match &*it.0.name() {
-            "wrapper_mod::CONST_ITEM" => {
+            "input::wrapper_mod::CONST_ITEM" => {
                 set_once(&mut const_item, it.0);
             }
-            "wrapper_mod::STATIC_ITEM" => {
+            "input::wrapper_mod::STATIC_ITEM" => {
                 set_once(&mut static_item, it.0);
             }
-            "<wrapper_mod::MyStruct as wrapper_mod::MyTrait>::trait_method" => {
+            "<input::wrapper_mod::MyStruct as input::wrapper_mod::MyTrait>::trait_method" => {
                 set_once(&mut trait_method, it.0);
             }
-            "<wrapper_mod::MyStruct as wrapper_mod::MyTrait>::trait_method::trait_method_helper" => {
+            "<input::wrapper_mod::MyStruct as input::wrapper_mod::MyTrait>::trait_method::trait_method_helper" =>
+            {
                 set_once(&mut trait_method_helper, it.0);
             }
-            "wrapper_mod::MyStruct::inherent_method" => {
+            "input::wrapper_mod::MyStruct::inherent_method" => {
                 set_once(&mut inherent_method, it.0);
             }
-            "wrapper_mod::MyStruct::inherent_method::inherent_method_helper" => {
+            "input::wrapper_mod::MyStruct::inherent_method::inherent_method_helper" => {
                 set_once(&mut inherent_method_helper, it.0);
             }
-            "main" => {
+            "input::main" => {
                 set_once(&mut main, it.0);
             }
-            "wrapper_mod::MyStruct" => {
+            "input::wrapper_mod::MyStruct" => {
                 set_once(&mut mystruct_ctor, it.0);
                 mystruct_ctor_ty = Some(it.ty());
             }
-            _ => (),
+            name => panic!("Unexpected item: `{name}`"),
         }
     }
     for it in krate.trait_decls() {
         match &*it.0.name() {
-            "wrapper_mod::MyTrait" => set_once(&mut trait_decl, it.0),
+            "input::wrapper_mod::MyTrait" => set_once(&mut trait_decl, it.0),
             _ => (),
         }
     }
     for it in krate.trait_impls() {
         match &*it.0.name() {
-            "<wrapper_mod::MyStruct as wrapper_mod::MyTrait>" => set_once(&mut trait_impl, it.0),
-            _ => (),
+            "<input::wrapper_mod::MyStruct as input::wrapper_mod::MyTrait>" => {
+                set_once(&mut trait_impl, it.0)
+            }
+            name => panic!("Unexpected trait impl: `{name}`"),
         }
     }
 
@@ -106,9 +109,10 @@ fn set_once<T: Debug + PartialEq>(slot: &mut Option<T>, val: T) {
     let inherent_impl = inherent_method.parent().unwrap();
     let wrapper_mod = const_item.parent().unwrap();
     let crate_root = wrapper_mod.parent().unwrap();
-    assert_eq!(&*wrapper_mod.name(), "wrapper_mod");
+    assert_eq!(&*wrapper_mod.name(), "input::wrapper_mod");
 
     // Check that each def-id has the correct parent
+    assert_eq!(crate_root.name(), "input");
     assert_eq!(crate_root.parent(), None);
     assert_eq!(inherent_impl.parent(), Some(wrapper_mod));
     assert_eq!(const_item.parent(), Some(wrapper_mod));
diff --git a/tests/ui-fulldeps/rustc_public/check_def_ty.rs b/tests/ui-fulldeps/rustc_public/check_def_ty.rs
index 4a45bb6..5984d6f 100644
--- a/tests/ui-fulldeps/rustc_public/check_def_ty.rs
+++ b/tests/ui-fulldeps/rustc_public/check_def_ty.rs
@@ -15,9 +15,12 @@
 extern crate rustc_driver;
 extern crate rustc_interface;
 extern crate rustc_public;
+extern crate rustc_public_bridge;
 
-use rustc_public::ty::{Ty, ForeignItemKind};
+use rustc_public::ty::VariantIdx;
+use rustc_public::ty::{ForeignItemKind, RigidTy, Ty};
 use rustc_public::*;
+use rustc_public_bridge::IndexedVal;
 use std::io::Write;
 use std::ops::ControlFlow;
 
@@ -29,11 +32,19 @@ fn test_def_tys() -> ControlFlow<()> {
     for item in &items {
         // Type from crate items.
         let ty = item.ty();
-        match item.name().as_str() {
+        match item.trimmed_name().as_str() {
             "STATIC_STR" => assert!(ty.kind().is_ref()),
             "CONST_U32" => assert!(ty.kind().is_integral()),
-            "main" => { check_fn_def(ty) }
-            _ => unreachable!("Unexpected item: `{item:?}`")
+            "NONE" => {
+                let RigidTy::Adt(adt, _) = *ty.kind().rigid().unwrap() else { panic!() };
+                // Definition names include the entire path.
+                assert_eq!(adt.name(), "std::option::Option");
+                // Variant name only includes the actual variant name.
+                // I know, probably not the best name schema. o.O
+                assert_eq!(adt.variant(VariantIdx::to_val(0)).unwrap().name(), "None");
+            }
+            "main" => check_fn_def(ty),
+            _ => unreachable!("Unexpected item: `{item:?}`"),
         }
     }
 
@@ -42,7 +53,7 @@ fn test_def_tys() -> ControlFlow<()> {
         // Type from foreign items.
         let ty = item.ty();
         let item_kind = item.kind();
-        let name = item.name();
+        let name = item.trimmed_name();
         match item_kind {
             ForeignItemKind::Fn(fn_def) => {
                 assert_eq!(&name, "extern_fn");
@@ -54,7 +65,7 @@ fn test_def_tys() -> ControlFlow<()> {
                 assert_eq!(ty, def.ty());
                 assert!(ty.kind().is_integral())
             }
-            _ => unreachable!("Unexpected kind: {item_kind:?}")
+            _ => unreachable!("Unexpected kind: {item_kind:?}"),
         };
     }
 
@@ -92,6 +103,7 @@ fn generate_input(path: &str) -> std::io::Result<()> {
         r#"
         static STATIC_STR: &str = "foo";
         const CONST_U32: u32 = 0u32;
+        static NONE: Option<i32> = Option::None;
 
         fn main() {{
             let _c = core::char::from_u32(99);
diff --git a/tests/ui-fulldeps/rustc_public/check_defs.rs b/tests/ui-fulldeps/rustc_public/check_defs.rs
index 0c45859..e6f9fb9 100644
--- a/tests/ui-fulldeps/rustc_public/check_defs.rs
+++ b/tests/ui-fulldeps/rustc_public/check_defs.rs
@@ -15,11 +15,11 @@
 extern crate rustc_interface;
 extern crate rustc_public;
 
-use std::assert_matches::assert_matches;
-use mir::{mono::Instance, TerminatorKind::*};
+use mir::{TerminatorKind::*, mono::Instance};
 use rustc_public::mir::mono::InstanceKind;
-use rustc_public::ty::{RigidTy, TyKind, Ty, UintTy};
+use rustc_public::ty::{RigidTy, Ty, TyKind, UintTy};
 use rustc_public::*;
+use std::assert_matches::assert_matches;
 use std::io::Write;
 use std::ops::ControlFlow;
 
@@ -29,7 +29,7 @@
 fn test_stable_mir() -> ControlFlow<()> {
     let entry = rustc_public::entry_fn().unwrap();
     let main_fn = Instance::try_from(entry).unwrap();
-    assert_eq!(main_fn.name(), "main");
+    assert_eq!(main_fn.name(), "input::main");
     assert_eq!(main_fn.trimmed_name(), "main");
 
     let instances = get_instances(main_fn.body().unwrap());
@@ -65,10 +65,8 @@ fn test_fn(instance: Instance, expected_trimmed: &str, expected_qualified: &str,
 
 fn extract_elem_ty(ty: Ty) -> Ty {
     match ty.kind() {
-        TyKind::RigidTy(RigidTy::Adt(_, args)) => {
-            *args.0[0].expect_ty()
-        }
-        _ => unreachable!("Expected Vec ADT, but found: {ty:?}")
+        TyKind::RigidTy(RigidTy::Adt(_, args)) => *args.0[0].expect_ty(),
+        _ => unreachable!("Expected Vec ADT, but found: {ty:?}"),
     }
 }
 
@@ -89,19 +87,19 @@ fn test_vec_new(instance: mir::mono::Instance) {
 
 /// Inspect the instance body
 fn get_instances(body: mir::Body) -> Vec<Instance> {
-    body.blocks.iter().filter_map(|bb| {
-        match &bb.terminator.kind {
+    body.blocks
+        .iter()
+        .filter_map(|bb| match &bb.terminator.kind {
             Call { func, .. } => {
-                let TyKind::RigidTy(ty) = func.ty(body.locals()).unwrap().kind() else { unreachable!
-                () };
+                let TyKind::RigidTy(ty) = func.ty(body.locals()).unwrap().kind() else {
+                    unreachable!()
+                };
                 let RigidTy::FnDef(def, args) = ty else { unreachable!() };
                 Instance::resolve(def, &args).ok()
             }
-            _ => {
-                None
-            }
-        }
-    }).collect::<Vec<_>>()
+            _ => None,
+        })
+        .collect::<Vec<_>>()
 }
 
 /// This test will generate and analyze a dummy crate using the stable mir.
diff --git a/tests/ui-fulldeps/rustc_public/check_foreign.rs b/tests/ui-fulldeps/rustc_public/check_foreign.rs
index 78b6259..bd34fb5 100644
--- a/tests/ui-fulldeps/rustc_public/check_foreign.rs
+++ b/tests/ui-fulldeps/rustc_public/check_foreign.rs
@@ -13,8 +13,8 @@
 
 extern crate rustc_driver;
 extern crate rustc_interface;
-extern crate rustc_span;
 extern crate rustc_public;
+extern crate rustc_span;
 
 use rustc_public::{
     ty::{Abi, ForeignItemKind},
@@ -40,7 +40,7 @@ fn test_foreign() -> ControlFlow<()> {
     assert_eq!(c_items.len(), 3);
     for item in c_items {
         let kind = item.kind();
-        match item.name().as_str() {
+        match item.trimmed_name().as_str() {
             "foo" => assert_matches!(kind, ForeignItemKind::Fn(..)),
             "bar" => assert_matches!(kind, ForeignItemKind::Static(..)),
             "Baz" => assert_matches!(kind, ForeignItemKind::Type(..)),
diff --git a/tests/ui-fulldeps/rustc_public/check_item_kind.rs b/tests/ui-fulldeps/rustc_public/check_item_kind.rs
index b759628..c687b3a 100644
--- a/tests/ui-fulldeps/rustc_public/check_item_kind.rs
+++ b/tests/ui-fulldeps/rustc_public/check_item_kind.rs
@@ -27,7 +27,7 @@ fn test_item_kind() -> ControlFlow<()> {
     assert_eq!(items.len(), 4);
     // Constructor item.
     for item in items {
-        let expected_kind = match item.name().as_str() {
+        let expected_kind = match item.trimmed_name().as_str() {
             "Dummy" => ItemKind::Ctor(CtorKind::Fn),
             "dummy" => ItemKind::Fn,
             "unit" => ItemKind::Fn,
diff --git a/tests/ui-fulldeps/rustc_public/check_trait_queries.rs b/tests/ui-fulldeps/rustc_public/check_trait_queries.rs
index 0dd1304..5603add 100644
--- a/tests/ui-fulldeps/rustc_public/check_trait_queries.rs
+++ b/tests/ui-fulldeps/rustc_public/check_trait_queries.rs
@@ -28,19 +28,20 @@ fn test_traits() -> ControlFlow<()> {
     let local_crate = rustc_public::local_crate();
     let local_traits = local_crate.trait_decls();
     assert_eq!(local_traits.len(), 1, "Expected `Max` trait, but found {:?}", local_traits);
-    assert_eq!(&local_traits[0].name(), "Max");
+    assert_eq!(&local_traits[0].trimmed_name(), "Max");
 
     let local_impls = local_crate.trait_impls();
-    let impl_names = local_impls.iter().map(|trait_impl| trait_impl.name()).collect::<HashSet<_>>();
+    let impl_names =
+        local_impls.iter().map(|trait_impl| trait_impl.trimmed_name()).collect::<HashSet<_>>();
     assert_impl(&impl_names, "<Positive as Max>");
-    assert_impl(&impl_names, "<Positive as std::marker::Copy>");
-    assert_impl(&impl_names, "<Positive as std::clone::Clone>");
-    assert_impl(&impl_names, "<Positive as std::fmt::Debug>");
-    assert_impl(&impl_names, "<Positive as std::cmp::PartialEq>");
-    assert_impl(&impl_names, "<Positive as std::cmp::Eq>");
-    assert_impl(&impl_names, "<Positive as std::convert::TryFrom<u64>>");
+    assert_impl(&impl_names, "<Positive as Copy>");
+    assert_impl(&impl_names, "<Positive as Clone>");
+    assert_impl(&impl_names, "<Positive as Debug>");
+    assert_impl(&impl_names, "<Positive as PartialEq>");
+    assert_impl(&impl_names, "<Positive as Eq>");
+    assert_impl(&impl_names, "<Positive as TryFrom<u64>>");
     assert_impl(&impl_names, "<u64 as Max>");
-    assert_impl(&impl_names, "<impl std::convert::From<Positive> for u64>");
+    assert_impl(&impl_names, "<impl From<Positive> for u64>");
 
     let all_traits = rustc_public::all_trait_decls();
     assert!(all_traits.len() > local_traits.len());
diff --git a/tests/ui-fulldeps/rustc_public/check_transform.rs b/tests/ui-fulldeps/rustc_public/check_transform.rs
index b30d98c..900bb40 100644
--- a/tests/ui-fulldeps/rustc_public/check_transform.rs
+++ b/tests/ui-fulldeps/rustc_public/check_transform.rs
@@ -34,7 +34,7 @@ fn test_transform() -> ControlFlow<()> {
     let items = rustc_public::all_local_items();
 
     // Test fn_abi
-    let target_fn = *get_item(&items, (ItemKind::Fn, "dummy")).unwrap();
+    let target_fn = *get_item(&items, (ItemKind::Fn, "input::dummy")).unwrap();
     let instance = Instance::try_from(target_fn).unwrap();
     let body = instance.body().unwrap();
     check_msg(&body, "oops");
diff --git a/tests/ui-fulldeps/rustc_public/check_variant.rs b/tests/ui-fulldeps/rustc_public/check_variant.rs
index 9ed16f2..9bdd0c9 100644
--- a/tests/ui-fulldeps/rustc_public/check_variant.rs
+++ b/tests/ui-fulldeps/rustc_public/check_variant.rs
@@ -97,7 +97,7 @@ fn check_adt_poly2() {
 }
 
 fn get_fn(name: &str) -> CrateItem {
-    rustc_public::all_local_items().into_iter().find(|it| it.name().eq(name)).unwrap()
+    rustc_public::all_local_items().into_iter().find(|it| it.trimmed_name().eq(name)).unwrap()
 }
 
 fn check_statement_is_aggregate_assign(
diff --git a/tests/ui-fulldeps/rustc_public/closure-generic-body.rs b/tests/ui-fulldeps/rustc_public/closure-generic-body.rs
index e5f910f..46aeca7 100644
--- a/tests/ui-fulldeps/rustc_public/closure-generic-body.rs
+++ b/tests/ui-fulldeps/rustc_public/closure-generic-body.rs
@@ -52,7 +52,7 @@ fn check_incr_closure_body(body: Body) {
         panic!("expected FnDef");
     };
 
-    assert_eq!(def_id.name(), "id");
+    assert_eq!(def_id.trimmed_name(), "id");
 }
 
 fn main() {
diff --git a/tests/ui-fulldeps/rustc_public/closure_body.rs b/tests/ui-fulldeps/rustc_public/closure_body.rs
index f5f9f23..43cbca8 100644
--- a/tests/ui-fulldeps/rustc_public/closure_body.rs
+++ b/tests/ui-fulldeps/rustc_public/closure_body.rs
@@ -52,7 +52,7 @@ fn check_incr_closure_body(body: Body) {
         panic!("expected FnDef");
     };
 
-    assert_eq!(def_id.name(), "incr");
+    assert_eq!(def_id.name(), "crate_closure_body::incr");
 }
 
 fn main() {
diff --git a/tests/ui-fulldeps/rustc_public/crate-info.rs b/tests/ui-fulldeps/rustc_public/crate-info.rs
index 19082d7..06cbbfc 100644
--- a/tests/ui-fulldeps/rustc_public/crate-info.rs
+++ b/tests/ui-fulldeps/rustc_public/crate-info.rs
@@ -38,12 +38,12 @@ fn test_stable_mir() -> ControlFlow<()> {
 
     // Find items in the local crate.
     let items = rustc_public::all_local_items();
-    assert!(get_item(&items, (DefKind::Fn, "foo::bar")).is_some());
+    assert!(get_item(&items, (DefKind::Fn, "input::foo::bar")).is_some());
 
     // Find the `std` crate and assert that there is only one of it.
     assert!(rustc_public::find_crates("std").len() == 1);
 
-    let bar = get_item(&items, (DefKind::Fn, "bar")).unwrap();
+    let bar = get_item(&items, (DefKind::Fn, "input::bar")).unwrap();
     let body = bar.expect_body();
     assert_eq!(body.locals().len(), 2);
     assert_eq!(body.blocks.len(), 1);
@@ -58,7 +58,7 @@ fn test_stable_mir() -> ControlFlow<()> {
         other => panic!("{other:?}"),
     }
 
-    let foo_bar = get_item(&items, (DefKind::Fn, "foo_bar")).unwrap();
+    let foo_bar = get_item(&items, (DefKind::Fn, "input::foo_bar")).unwrap();
     let body = foo_bar.expect_body();
     assert_eq!(body.locals().len(), 5);
     assert_eq!(body.blocks.len(), 4);
@@ -68,7 +68,7 @@ fn test_stable_mir() -> ControlFlow<()> {
         other => panic!("{other:?}"),
     }
 
-    let types = get_item(&items, (DefKind::Fn, "types")).unwrap();
+    let types = get_item(&items, (DefKind::Fn, "input::types")).unwrap();
     let body = types.expect_body();
     assert_eq!(body.locals().len(), 6);
     assert_matches!(
@@ -85,15 +85,15 @@ fn test_stable_mir() -> ControlFlow<()> {
     );
     assert_matches!(
         body.locals()[3].ty.kind(),
-        rustc_public::ty::TyKind::RigidTy(
-            rustc_public::ty::RigidTy::Int(rustc_public::ty::IntTy::I32)
-        )
+        rustc_public::ty::TyKind::RigidTy(rustc_public::ty::RigidTy::Int(
+            rustc_public::ty::IntTy::I32
+        ))
     );
     assert_matches!(
         body.locals()[4].ty.kind(),
-        rustc_public::ty::TyKind::RigidTy(
-            rustc_public::ty::RigidTy::Uint(rustc_public::ty::UintTy::U64)
-        )
+        rustc_public::ty::TyKind::RigidTy(rustc_public::ty::RigidTy::Uint(
+            rustc_public::ty::UintTy::U64
+        ))
     );
     assert_matches!(
         body.locals()[5].ty.kind(),
@@ -102,7 +102,7 @@ fn test_stable_mir() -> ControlFlow<()> {
         ))
     );
 
-    let drop = get_item(&items, (DefKind::Fn, "drop")).unwrap();
+    let drop = get_item(&items, (DefKind::Fn, "input::drop")).unwrap();
     let body = drop.expect_body();
     assert_eq!(body.blocks.len(), 2);
     let block = &body.blocks[0];
@@ -111,7 +111,7 @@ fn test_stable_mir() -> ControlFlow<()> {
         other => panic!("{other:?}"),
     }
 
-    let assert = get_item(&items, (DefKind::Fn, "assert")).unwrap();
+    let assert = get_item(&items, (DefKind::Fn, "input::assert")).unwrap();
     let body = assert.expect_body();
     assert_eq!(body.blocks.len(), 2);
     let block = &body.blocks[0];
@@ -120,7 +120,7 @@ fn test_stable_mir() -> ControlFlow<()> {
         other => panic!("{other:?}"),
     }
 
-    let monomorphic = get_item(&items, (DefKind::Fn, "monomorphic")).unwrap();
+    let monomorphic = get_item(&items, (DefKind::Fn, "input::monomorphic")).unwrap();
     let instance = Instance::try_from(monomorphic.clone()).unwrap();
     for block in instance.body().unwrap().blocks {
         match &block.terminator.kind {
@@ -140,11 +140,11 @@ fn test_stable_mir() -> ControlFlow<()> {
         }
     }
 
-    let foo_const = get_item(&items, (DefKind::Const, "FOO")).unwrap();
+    let foo_const = get_item(&items, (DefKind::Const, "input::FOO")).unwrap();
     // Ensure we don't panic trying to get the body of a constant.
     foo_const.expect_body();
 
-    let locals_fn = get_item(&items, (DefKind::Fn, "locals")).unwrap();
+    let locals_fn = get_item(&items, (DefKind::Fn, "input::locals")).unwrap();
     let body = locals_fn.expect_body();
     assert_eq!(body.locals().len(), 4);
     assert_matches!(
@@ -154,15 +154,15 @@ fn test_stable_mir() -> ControlFlow<()> {
     assert_eq!(body.arg_locals().len(), 2);
     assert_matches!(
         body.arg_locals()[0].ty.kind(),
-        rustc_public::ty::TyKind::RigidTy(
-            rustc_public::ty::RigidTy::Int(rustc_public::ty::IntTy::I32)
-        )
+        rustc_public::ty::TyKind::RigidTy(rustc_public::ty::RigidTy::Int(
+            rustc_public::ty::IntTy::I32
+        ))
     );
     assert_matches!(
         body.arg_locals()[1].ty.kind(),
-        rustc_public::ty::TyKind::RigidTy(
-            rustc_public::ty::RigidTy::Uint(rustc_public::ty::UintTy::U64)
-        )
+        rustc_public::ty::TyKind::RigidTy(rustc_public::ty::RigidTy::Uint(
+            rustc_public::ty::UintTy::U64
+        ))
     );
     assert_eq!(body.inner_locals().len(), 1);
     // If conditions have an extra inner local to hold their results
diff --git a/tests/ui-fulldeps/rustc_public/projections.rs b/tests/ui-fulldeps/rustc_public/projections.rs
index e0213b4..c1cdb53 100644
--- a/tests/ui-fulldeps/rustc_public/projections.rs
+++ b/tests/ui-fulldeps/rustc_public/projections.rs
@@ -136,7 +136,9 @@ fn get_item<'a>(
     items: &'a rustc_public::CrateItems,
     item: (ItemKind, &str),
 ) -> Option<&'a rustc_public::CrateItem> {
-    items.iter().find(|crate_item| crate_item.kind() == item.0 && crate_item.name() == item.1)
+    items
+        .iter()
+        .find(|crate_item| crate_item.kind() == item.0 && crate_item.trimmed_name() == item.1)
 }
 
 /// This test will generate and analyze a dummy crate using the stable mir.
diff --git a/tests/ui/rustc_public-ir-print/async-closure.stdout b/tests/ui/rustc_public-ir-print/async-closure.stdout
index 3ec816b..8df31e2 100644
--- a/tests/ui/rustc_public-ir-print/async-closure.stdout
+++ b/tests/ui/rustc_public-ir-print/async-closure.stdout
@@ -56,7 +56,7 @@
         _3 = (*_4);
         _5 = ();
         StorageDead(_3);
-        _0 = std::task::Poll::Ready(move _5);
+        _0 = Poll::Ready(move _5);
         discriminant((*_7)) = 1;
         return;
     }
@@ -88,7 +88,7 @@
         _3 = (*_4);
         _5 = ();
         StorageDead(_3);
-        _0 = std::task::Poll::Ready(move _5);
+        _0 = Poll::Ready(move _5);
         discriminant((*_7)) = 1;
         return;
     }
diff --git a/tests/ui/rustc_public-ir-print/operands.stdout b/tests/ui/rustc_public-ir-print/operands.stdout
index b777541..58f229b 100644
--- a/tests/ui/rustc_public-ir-print/operands.stdout
+++ b/tests/ui/rustc_public-ir-print/operands.stdout
@@ -206,7 +206,7 @@
         StorageDead(_19);
         StorageDead(_18);
         StorageLive(_21);
-        _21 = core::panicking::AssertKind::Eq;
+        _21 = AssertKind::Eq;
         StorageLive(_22);
         StorageLive(_23);
         _23 = move _21;
@@ -219,7 +219,7 @@
         _27 = &(*_16);
         _26 = &(*_27);
         StorageLive(_28);
-        _28 = std::option::Option::None;
+        _28 = Option::None;
         _22 = core::panicking::assert_failed::<u8, u8>(move _23, move _24, move _26, move _28) -> unwind unreachable;
     }
     bb6: {
@@ -268,7 +268,7 @@
         StorageDead(_39);
         StorageDead(_38);
         StorageLive(_41);
-        _41 = core::panicking::AssertKind::Eq;
+        _41 = AssertKind::Eq;
         StorageLive(_42);
         StorageLive(_43);
         _43 = move _41;
@@ -281,7 +281,7 @@
         _47 = &(*_36);
         _46 = &(*_47);
         StorageLive(_48);
-        _48 = std::option::Option::None;
+        _48 = Option::None;
         _42 = core::panicking::assert_failed::<u8, u8>(move _43, move _44, move _46, move _48) -> unwind unreachable;
     }
     bb8: {
@@ -305,7 +305,7 @@
         StorageDead(_62);
         StorageDead(_61);
         StorageLive(_64);
-        _64 = core::panicking::AssertKind::Eq;
+        _64 = AssertKind::Eq;
         StorageLive(_65);
         StorageLive(_66);
         _66 = move _64;
@@ -318,7 +318,7 @@
         _70 = &(*_59);
         _69 = &(*_70);
         StorageLive(_71);
-        _71 = std::option::Option::None;
+        _71 = Option::None;
         _65 = core::panicking::assert_failed::<u8, u8>(move _66, move _67, move _69, move _71) -> unwind unreachable;
     }
     bb10: {
@@ -380,7 +380,7 @@
         StorageDead(_86);
         StorageDead(_85);
         StorageLive(_88);
-        _88 = core::panicking::AssertKind::Eq;
+        _88 = AssertKind::Eq;
         StorageLive(_89);
         StorageLive(_90);
         _90 = move _88;
@@ -393,7 +393,7 @@
         _94 = &(*_83);
         _93 = &(*_94);
         StorageLive(_95);
-        _95 = std::option::Option::None;
+        _95 = Option::None;
         _89 = core::panicking::assert_failed::<usize, usize>(move _90, move _91, move _93, move _95) -> unwind unreachable;
     }
 }