about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-05-03 13:51:34 +0000
committerbors <bors@rust-lang.org>2025-05-03 13:51:34 +0000
commit097cd98869cf07a2860bef16c0d4a2b3b019b23a (patch)
tree5a10509ed35420ca63dd5de7dbf8582e93e28d79
parentd7df5bdf2986e596aeaeec38e732711c69ebbce1 (diff)
parent4360fd7f342943b3d25a3eb7064fd3ef7599274e (diff)
downloadrust-097cd98869cf07a2860bef16c0d4a2b3b019b23a.tar.gz
rust-097cd98869cf07a2860bef16c0d4a2b3b019b23a.zip
Auto merge of #140613 - matthiaskrgr:rollup-yag6z7w, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #138712 (resolve: Support imports of associated types and glob imports from traits)
 - #140395 (organize and extend forbidden target feature tests)
 - #140576 (Remove fragile equal-pointers-unequal tests.)
 - #140582 (Update sysinfo to `0.35.0` in bootstrap and `tools/opt-dist`)
 - #140595 (doc(std): fix typo lchown -> lchmod)
 - #140597 (zkvm: remove schmerik as target maintainer)
 - #140604 (yet another small borrowck cleanup )

r? `@ghost`
`@rustbot` modify labels: rollup
-rw-r--r--Cargo.lock101
-rw-r--r--compiler/rustc_borrowck/src/region_infer/reverse_sccs.rs45
-rw-r--r--compiler/rustc_borrowck/src/type_check/free_region_relations.rs8
-rw-r--r--compiler/rustc_borrowck/src/type_check/mod.rs16
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0253.md6
-rw-r--r--compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs34
-rw-r--r--compiler/rustc_resolve/messages.ftl7
-rw-r--r--compiler/rustc_resolve/src/diagnostics.rs8
-rw-r--r--compiler/rustc_resolve/src/errors.rs16
-rw-r--r--compiler/rustc_resolve/src/imports.rs43
-rw-r--r--compiler/rustc_resolve/src/lib.rs10
-rw-r--r--library/std/src/fs.rs2
-rw-r--r--src/bootstrap/Cargo.lock145
-rw-r--r--src/bootstrap/Cargo.toml2
-rw-r--r--src/doc/rustc/src/platform-support/riscv32im-risc0-zkvm-elf.md1
-rw-r--r--src/tools/opt-dist/Cargo.toml2
-rw-r--r--tests/ui/codegen/equal-pointers-unequal/as-cast/basic.rs21
-rw-r--r--tests/ui/codegen/equal-pointers-unequal/as-cast/function.rs22
-rw-r--r--tests/ui/codegen/equal-pointers-unequal/as-cast/print.rs20
-rw-r--r--tests/ui/codegen/equal-pointers-unequal/exposed-provenance/basic.rs23
-rw-r--r--tests/ui/codegen/equal-pointers-unequal/exposed-provenance/function.rs24
-rw-r--r--tests/ui/codegen/equal-pointers-unequal/exposed-provenance/print.rs22
-rw-r--r--tests/ui/codegen/equal-pointers-unequal/strict-provenance/basic.rs23
-rw-r--r--tests/ui/codegen/equal-pointers-unequal/strict-provenance/function.rs24
-rw-r--r--tests/ui/codegen/equal-pointers-unequal/strict-provenance/print.rs22
-rw-r--r--tests/ui/error-codes/E0253.rs10
-rw-r--r--tests/ui/error-codes/E0253.stderr9
-rw-r--r--tests/ui/feature-gates/feature-gate-import-trait-associated-functions.rs3
-rw-r--r--tests/ui/feature-gates/feature-gate-import-trait-associated-functions.stderr12
-rw-r--r--tests/ui/imports/issue-30560.rs3
-rw-r--r--tests/ui/imports/issue-30560.stderr8
-rw-r--r--tests/ui/target-feature/abi-incompatible-target-feature-attribute.riscv.stderr8
-rw-r--r--tests/ui/target-feature/abi-incompatible-target-feature-attribute.rs17
-rw-r--r--tests/ui/target-feature/abi-incompatible-target-feature-attribute.x86.stderr8
-rw-r--r--tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.riscv.stderr19
-rw-r--r--tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.rs22
-rw-r--r--tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.x86.stderr (renamed from tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.stderr)0
-rw-r--r--tests/ui/target-feature/abi-irrelevant-target-feature-flag-disable.rs (renamed from tests/ui/target-feature/allowed-softfloat-target-feature-flag-disable.rs)3
-rw-r--r--tests/ui/target-feature/abi-irrelevant-target-feature-flag-disable.stderr (renamed from tests/ui/target-feature/allowed-softfloat-target-feature-flag-disable.stderr)0
-rw-r--r--tests/ui/target-feature/abi-required-target-feature-attribute.rs (renamed from tests/ui/target-feature/allowed-softfloat-target-feature-attribute.rs)2
-rw-r--r--tests/ui/target-feature/abi-required-target-feature-flag-disable.aarch64.stderr (renamed from tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-neon.stderr)0
-rw-r--r--tests/ui/target-feature/abi-required-target-feature-flag-disable.loongarch.stderr11
-rw-r--r--tests/ui/target-feature/abi-required-target-feature-flag-disable.riscv.stderr11
-rw-r--r--tests/ui/target-feature/abi-required-target-feature-flag-disable.rs27
-rw-r--r--tests/ui/target-feature/abi-required-target-feature-flag-disable.x86-implied.stderr (renamed from tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-implied.stderr)0
-rw-r--r--tests/ui/target-feature/abi-required-target-feature-flag-disable.x86.stderr (renamed from tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable.stderr)0
-rw-r--r--tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-implied.rs15
-rw-r--r--tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-neon.rs13
-rw-r--r--tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable.rs15
-rw-r--r--tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.rs15
-rw-r--r--tests/ui/use/import_trait_associated_item_bad.rs18
-rw-r--r--tests/ui/use/import_trait_associated_item_bad.stderr49
-rw-r--r--tests/ui/use/import_trait_associated_item_glob.rs17
-rw-r--r--tests/ui/use/use-from-trait-xc.rs2
-rw-r--r--tests/ui/use/use-from-trait-xc.stderr12
-rw-r--r--tests/ui/use/use-from-trait.rs2
-rw-r--r--tests/ui/use/use-from-trait.stderr12
57 files changed, 502 insertions, 488 deletions
diff --git a/Cargo.lock b/Cargo.lock
index b141729a126..4097c0cc0a9 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -744,7 +744,7 @@ dependencies = [
  "tracing-subscriber",
  "unified-diff",
  "walkdir",
- "windows 0.59.0",
+ "windows",
 ]
 
 [[package]]
@@ -2464,6 +2464,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3"
 
 [[package]]
+name = "objc2-core-foundation"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1c10c2894a6fed806ade6027bcd50662746363a9589d3ec9d9bef30a4e4bc166"
+dependencies = [
+ "bitflags",
+]
+
+[[package]]
+name = "objc2-io-kit"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "71c1c64d6120e51cd86033f67176b1cb66780c2efe34dec55176f77befd93c0a"
+dependencies = [
+ "libc",
+ "objc2-core-foundation",
+]
+
+[[package]]
 name = "object"
 version = "0.32.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3466,7 +3485,7 @@ dependencies = [
  "thorin-dwp",
  "tracing",
  "wasm-encoder 0.219.2",
- "windows 0.59.0",
+ "windows",
 ]
 
 [[package]]
@@ -3525,7 +3544,7 @@ dependencies = [
  "tempfile",
  "thin-vec",
  "tracing",
- "windows 0.59.0",
+ "windows",
 ]
 
 [[package]]
@@ -3588,7 +3607,7 @@ dependencies = [
  "serde_json",
  "shlex",
  "tracing",
- "windows 0.59.0",
+ "windows",
 ]
 
 [[package]]
@@ -3643,7 +3662,7 @@ dependencies = [
  "termcolor",
  "termize",
  "tracing",
- "windows 0.59.0",
+ "windows",
 ]
 
 [[package]]
@@ -4386,7 +4405,7 @@ dependencies = [
  "smallvec",
  "termize",
  "tracing",
- "windows 0.59.0",
+ "windows",
 ]
 
 [[package]]
@@ -5068,13 +5087,14 @@ dependencies = [
 
 [[package]]
 name = "sysinfo"
-version = "0.31.4"
+version = "0.35.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "355dbe4f8799b304b05e1b0f05fc59b2a18d36645cf169607da45bde2f69a1be"
+checksum = "b897c8ea620e181c7955369a31be5f48d9a9121cb59fd33ecef9ff2a34323422"
 dependencies = [
- "core-foundation-sys",
  "libc",
- "windows 0.57.0",
+ "objc2-core-foundation",
+ "objc2-io-kit",
+ "windows",
 ]
 
 [[package]]
@@ -5951,16 +5971,6 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
 
 [[package]]
 name = "windows"
-version = "0.57.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143"
-dependencies = [
- "windows-core 0.57.0",
- "windows-targets 0.52.6",
-]
-
-[[package]]
-name = "windows"
 version = "0.59.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "7f919aee0a93304be7f62e8e5027811bbba96bcb1de84d6618be56e43f8a32a1"
@@ -5982,25 +5992,13 @@ dependencies = [
 
 [[package]]
 name = "windows-core"
-version = "0.57.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d"
-dependencies = [
- "windows-implement 0.57.0",
- "windows-interface 0.57.0",
- "windows-result 0.1.2",
- "windows-targets 0.52.6",
-]
-
-[[package]]
-name = "windows-core"
 version = "0.59.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "810ce18ed2112484b0d4e15d022e5f598113e220c53e373fb31e67e21670c1ce"
 dependencies = [
  "windows-implement 0.59.0",
- "windows-interface 0.59.1",
- "windows-result 0.3.2",
+ "windows-interface",
+ "windows-result",
  "windows-strings 0.3.1",
  "windows-targets 0.53.0",
 ]
@@ -6012,25 +6010,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980"
 dependencies = [
  "windows-implement 0.60.0",
- "windows-interface 0.59.1",
+ "windows-interface",
  "windows-link",
- "windows-result 0.3.2",
+ "windows-result",
  "windows-strings 0.4.0",
 ]
 
 [[package]]
 name = "windows-implement"
-version = "0.57.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.100",
-]
-
-[[package]]
-name = "windows-implement"
 version = "0.59.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "83577b051e2f49a058c308f17f273b570a6a758386fc291b5f6a934dd84e48c1"
@@ -6053,17 +6040,6 @@ dependencies = [
 
 [[package]]
 name = "windows-interface"
-version = "0.57.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn 2.0.100",
-]
-
-[[package]]
-name = "windows-interface"
 version = "0.59.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8"
@@ -6081,15 +6057,6 @@ checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38"
 
 [[package]]
 name = "windows-result"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8"
-dependencies = [
- "windows-targets 0.52.6",
-]
-
-[[package]]
-name = "windows-result"
 version = "0.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252"
diff --git a/compiler/rustc_borrowck/src/region_infer/reverse_sccs.rs b/compiler/rustc_borrowck/src/region_infer/reverse_sccs.rs
index b2ed8a35827..8e04791461b 100644
--- a/compiler/rustc_borrowck/src/region_infer/reverse_sccs.rs
+++ b/compiler/rustc_borrowck/src/region_infer/reverse_sccs.rs
@@ -7,6 +7,8 @@ use rustc_middle::ty::RegionVid;
 
 use crate::RegionInferenceContext;
 use crate::constraints::ConstraintSccIndex;
+use crate::region_infer::ConstraintSccs;
+use crate::universal_regions::UniversalRegions;
 
 pub(crate) struct ReverseSccGraph {
     graph: VecGraph<ConstraintSccIndex>,
@@ -19,6 +21,29 @@ pub(crate) struct ReverseSccGraph {
 }
 
 impl ReverseSccGraph {
+    pub(super) fn compute(
+        constraint_sccs: &ConstraintSccs,
+        universal_regions: &UniversalRegions<'_>,
+    ) -> Self {
+        let graph = constraint_sccs.reverse();
+        let mut paired_scc_regions = universal_regions
+            .universal_regions_iter()
+            .map(|region| (constraint_sccs.scc(region), region))
+            .collect::<Vec<_>>();
+        paired_scc_regions.sort();
+        let universal_regions = paired_scc_regions.iter().map(|&(_, region)| region).collect();
+
+        let mut scc_regions = FxIndexMap::default();
+        let mut start = 0;
+        for chunk in paired_scc_regions.chunk_by(|&(scc1, _), &(scc2, _)| scc1 == scc2) {
+            let (scc, _) = chunk[0];
+
+            scc_regions.insert(scc, start..start + chunk.len());
+            start += chunk.len();
+        }
+        ReverseSccGraph { graph, scc_regions, universal_regions }
+    }
+
     /// Find all universal regions that are required to outlive the given SCC.
     pub(super) fn upper_bounds(&self, scc0: ConstraintSccIndex) -> impl Iterator<Item = RegionVid> {
         let mut duplicates = FxIndexSet::default();
@@ -40,23 +65,7 @@ impl RegionInferenceContext<'_> {
             return;
         }
 
-        let graph = self.constraint_sccs.reverse();
-        let mut paired_scc_regions = self
-            .universal_regions()
-            .universal_regions_iter()
-            .map(|region| (self.constraint_sccs.scc(region), region))
-            .collect::<Vec<_>>();
-        paired_scc_regions.sort();
-        let universal_regions = paired_scc_regions.iter().map(|&(_, region)| region).collect();
-
-        let mut scc_regions = FxIndexMap::default();
-        let mut start = 0;
-        for chunk in paired_scc_regions.chunk_by(|&(scc1, _), &(scc2, _)| scc1 == scc2) {
-            let (scc, _) = chunk[0];
-            scc_regions.insert(scc, start..start + chunk.len());
-            start += chunk.len();
-        }
-
-        self.rev_scc_graph = Some(ReverseSccGraph { graph, scc_regions, universal_regions });
+        self.rev_scc_graph =
+            Some(ReverseSccGraph::compute(&self.constraint_sccs, self.universal_regions()));
     }
 }
diff --git a/compiler/rustc_borrowck/src/type_check/free_region_relations.rs b/compiler/rustc_borrowck/src/type_check/free_region_relations.rs
index 536a27763d2..92732aba29b 100644
--- a/compiler/rustc_borrowck/src/type_check/free_region_relations.rs
+++ b/compiler/rustc_borrowck/src/type_check/free_region_relations.rs
@@ -41,8 +41,8 @@ type NormalizedInputsAndOutput<'tcx> = Vec<Ty<'tcx>>;
 
 pub(crate) struct CreateResult<'tcx> {
     pub(crate) universal_region_relations: Frozen<UniversalRegionRelations<'tcx>>,
-    pub(crate) region_bound_pairs: RegionBoundPairs<'tcx>,
-    pub(crate) known_type_outlives_obligations: Vec<ty::PolyTypeOutlivesPredicate<'tcx>>,
+    pub(crate) region_bound_pairs: Frozen<RegionBoundPairs<'tcx>>,
+    pub(crate) known_type_outlives_obligations: Frozen<Vec<ty::PolyTypeOutlivesPredicate<'tcx>>>,
     pub(crate) normalized_inputs_and_output: NormalizedInputsAndOutput<'tcx>,
 }
 
@@ -333,8 +333,8 @@ impl<'tcx> UniversalRegionRelationsBuilder<'_, 'tcx> {
                 outlives: self.outlives.freeze(),
                 inverse_outlives: self.inverse_outlives.freeze(),
             }),
-            known_type_outlives_obligations,
-            region_bound_pairs: self.region_bound_pairs,
+            known_type_outlives_obligations: Frozen::freeze(known_type_outlives_obligations),
+            region_bound_pairs: Frozen::freeze(self.region_bound_pairs),
             normalized_inputs_and_output,
         }
     }
diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs
index 99a544279b9..8c512257120 100644
--- a/compiler/rustc_borrowck/src/type_check/mod.rs
+++ b/compiler/rustc_borrowck/src/type_check/mod.rs
@@ -151,8 +151,8 @@ pub(crate) fn type_check<'a, 'tcx>(
         body,
         promoted,
         user_type_annotations: &body.user_type_annotations,
-        region_bound_pairs,
-        known_type_outlives_obligations,
+        region_bound_pairs: &region_bound_pairs,
+        known_type_outlives_obligations: &known_type_outlives_obligations,
         reported_errors: Default::default(),
         universal_regions: &universal_region_relations.universal_regions,
         location_table,
@@ -216,8 +216,8 @@ struct TypeChecker<'a, 'tcx> {
     /// User type annotations are shared between the main MIR and the MIR of
     /// all of the promoted items.
     user_type_annotations: &'a CanonicalUserTypeAnnotations<'tcx>,
-    region_bound_pairs: RegionBoundPairs<'tcx>,
-    known_type_outlives_obligations: Vec<ty::PolyTypeOutlivesPredicate<'tcx>>,
+    region_bound_pairs: &'a RegionBoundPairs<'tcx>,
+    known_type_outlives_obligations: &'a [ty::PolyTypeOutlivesPredicate<'tcx>],
     reported_errors: FxIndexSet<(Ty<'tcx>, Span)>,
     universal_regions: &'a UniversalRegions<'tcx>,
     location_table: &'a PoloniusLocationTable,
@@ -412,9 +412,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
         constraint_conversion::ConstraintConversion::new(
             self.infcx,
             self.universal_regions,
-            &self.region_bound_pairs,
+            self.region_bound_pairs,
             self.infcx.param_env,
-            &self.known_type_outlives_obligations,
+            self.known_type_outlives_obligations,
             locations,
             locations.span(self.body),
             category,
@@ -2506,9 +2506,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
             constraint_conversion::ConstraintConversion::new(
                 self.infcx,
                 self.universal_regions,
-                &self.region_bound_pairs,
+                self.region_bound_pairs,
                 self.infcx.param_env,
-                &self.known_type_outlives_obligations,
+                self.known_type_outlives_obligations,
                 locations,
                 self.body.span,             // irrelevant; will be overridden.
                 ConstraintCategory::Boring, // same as above.
diff --git a/compiler/rustc_error_codes/src/error_codes/E0253.md b/compiler/rustc_error_codes/src/error_codes/E0253.md
index 705d1bfc53e..628f5e252fb 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0253.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0253.md
@@ -1,9 +1,13 @@
+#### Note: this error code is no longer emitted by the compiler.
+
 Attempt was made to import an unimportable type. This can happen when trying
 to import a type from a trait.
 
 Erroneous code example:
 
-```compile_fail,E0253
+```
+#![feature(import_trait_associated_functions)]
+
 mod foo {
     pub trait MyTrait {
         type SomeType;
diff --git a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs
index fcb7382549f..5e79e932015 100644
--- a/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs
+++ b/compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs
@@ -1770,7 +1770,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
         span: Span,
         opt_self_ty: Option<Ty<'tcx>>,
         item_def_id: DefId,
-        trait_segment: &hir::PathSegment<'tcx>,
+        trait_segment: Option<&hir::PathSegment<'tcx>>,
         item_segment: &hir::PathSegment<'tcx>,
     ) -> Ty<'tcx> {
         match self.lower_qpath_shared(
@@ -1795,7 +1795,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
         span: Span,
         opt_self_ty: Option<Ty<'tcx>>,
         item_def_id: DefId,
-        trait_segment: &hir::PathSegment<'tcx>,
+        trait_segment: Option<&hir::PathSegment<'tcx>>,
         item_segment: &hir::PathSegment<'tcx>,
     ) -> Const<'tcx> {
         match self.lower_qpath_shared(
@@ -1820,7 +1820,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
         span: Span,
         opt_self_ty: Option<Ty<'tcx>>,
         item_def_id: DefId,
-        trait_segment: &hir::PathSegment<'tcx>,
+        trait_segment: Option<&hir::PathSegment<'tcx>>,
         item_segment: &hir::PathSegment<'tcx>,
         assoc_tag: ty::AssocTag,
     ) -> Result<(DefId, GenericArgsRef<'tcx>), ErrorGuaranteed> {
@@ -1840,7 +1840,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
         debug!(?self_ty);
 
         let trait_ref =
-            self.lower_mono_trait_ref(span, trait_def_id, self_ty, trait_segment, false);
+            self.lower_mono_trait_ref(span, trait_def_id, self_ty, trait_segment.unwrap(), false);
         debug!(?trait_ref);
 
         let item_args =
@@ -2196,16 +2196,17 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
                 }
             }
             Res::Def(DefKind::AssocTy, def_id) => {
-                debug_assert!(path.segments.len() >= 2);
-                let _ = self.prohibit_generic_args(
-                    path.segments[..path.segments.len() - 2].iter(),
-                    GenericsArgsErrExtend::None,
-                );
+                let trait_segment = if let [modules @ .., trait_, _item] = path.segments {
+                    let _ = self.prohibit_generic_args(modules.iter(), GenericsArgsErrExtend::None);
+                    Some(trait_)
+                } else {
+                    None
+                };
                 self.lower_qpath_ty(
                     span,
                     opt_self_ty,
                     def_id,
-                    &path.segments[path.segments.len() - 2],
+                    trait_segment,
                     path.segments.last().unwrap(),
                 )
             }
@@ -2413,16 +2414,17 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
                 ty::Const::new_unevaluated(tcx, ty::UnevaluatedConst::new(did, args))
             }
             Res::Def(DefKind::AssocConst, did) => {
-                debug_assert!(path.segments.len() >= 2);
-                let _ = self.prohibit_generic_args(
-                    path.segments[..path.segments.len() - 2].iter(),
-                    GenericsArgsErrExtend::None,
-                );
+                let trait_segment = if let [modules @ .., trait_, _item] = path.segments {
+                    let _ = self.prohibit_generic_args(modules.iter(), GenericsArgsErrExtend::None);
+                    Some(trait_)
+                } else {
+                    None
+                };
                 self.lower_qpath_const(
                     span,
                     opt_self_ty,
                     did,
-                    &path.segments[path.segments.len() - 2],
+                    trait_segment,
                     path.segments.last().unwrap(),
                 )
             }
diff --git a/compiler/rustc_resolve/messages.ftl b/compiler/rustc_resolve/messages.ftl
index 558a01713dc..38cdfa72a14 100644
--- a/compiler/rustc_resolve/messages.ftl
+++ b/compiler/rustc_resolve/messages.ftl
@@ -218,10 +218,6 @@ resolve_invalid_asm_sym =
     .label = is a local variable
     .help = `sym` operands must refer to either a function or a static
 
-resolve_is_not_directly_importable =
-    `{$target}` is not directly importable
-    .label = cannot be imported directly
-
 resolve_is_private =
     {$ident_descr} `{$ident}` is private
     .label = private {$ident_descr}
@@ -231,9 +227,6 @@ resolve_item_was_behind_feature =
 
 resolve_item_was_cfg_out = the item is gated here
 
-resolve_items_in_traits_are_not_importable =
-    items in traits are not importable
-
 resolve_label_with_similar_name_reachable =
     a label with a similar name is reachable
 
diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs
index 363a75911ad..74daad08394 100644
--- a/compiler/rustc_resolve/src/diagnostics.rs
+++ b/compiler/rustc_resolve/src/diagnostics.rs
@@ -1181,11 +1181,9 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
         } {
             let in_module_is_extern = !in_module.def_id().is_local();
             in_module.for_each_child(self, |this, ident, ns, name_binding| {
-                // avoid non-importable candidates
-                if !name_binding.is_importable()
-                    // FIXME(import_trait_associated_functions): remove this when `import_trait_associated_functions` is stable
-                    || name_binding.is_assoc_const_or_fn()
-                        && !this.tcx.features().import_trait_associated_functions()
+                // Avoid non-importable candidates.
+                if name_binding.is_assoc_item()
+                    && !this.tcx.features().import_trait_associated_functions()
                 {
                     return;
                 }
diff --git a/compiler/rustc_resolve/src/errors.rs b/compiler/rustc_resolve/src/errors.rs
index e26b300f13e..7fe74378b67 100644
--- a/compiler/rustc_resolve/src/errors.rs
+++ b/compiler/rustc_resolve/src/errors.rs
@@ -781,22 +781,6 @@ pub(crate) struct CannotGlobImportAllCrates {
     pub(crate) span: Span,
 }
 
-#[derive(Diagnostic)]
-#[diag(resolve_items_in_traits_are_not_importable)]
-pub(crate) struct ItemsInTraitsAreNotImportable {
-    #[primary_span]
-    pub(crate) span: Span,
-}
-
-#[derive(Diagnostic)]
-#[diag(resolve_is_not_directly_importable, code = E0253)]
-pub(crate) struct IsNotDirectlyImportable {
-    #[primary_span]
-    #[label]
-    pub(crate) span: Span,
-    pub(crate) target: Ident,
-}
-
 #[derive(Subdiagnostic)]
 #[suggestion(
     resolve_unexpected_res_change_ty_to_const_param_sugg,
diff --git a/compiler/rustc_resolve/src/imports.rs b/compiler/rustc_resolve/src/imports.rs
index 762e08b2be5..816efd0d5fa 100644
--- a/compiler/rustc_resolve/src/imports.rs
+++ b/compiler/rustc_resolve/src/imports.rs
@@ -30,8 +30,7 @@ use crate::diagnostics::{DiagMode, Suggestion, import_candidates};
 use crate::errors::{
     CannotBeReexportedCratePublic, CannotBeReexportedCratePublicNS, CannotBeReexportedPrivate,
     CannotBeReexportedPrivateNS, CannotDetermineImportResolution, CannotGlobImportAllCrates,
-    ConsiderAddingMacroExport, ConsiderMarkingAsPub, IsNotDirectlyImportable,
-    ItemsInTraitsAreNotImportable,
+    ConsiderAddingMacroExport, ConsiderMarkingAsPub,
 };
 use crate::{
     AmbiguityError, AmbiguityKind, BindingKey, Finalize, ImportSuggestion, Module,
@@ -835,11 +834,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
 
                 let parent = import.parent_scope.module;
                 match source_bindings[ns].get() {
-                    Err(Undetermined) => indeterminate_count += 1,
-                    // Don't update the resolution, because it was never added.
-                    Err(Determined) if target.name == kw::Underscore => {}
-                    Ok(binding) if binding.is_importable() => {
-                        if binding.is_assoc_const_or_fn()
+                    Ok(binding) => {
+                        if binding.is_assoc_item()
                             && !this.tcx.features().import_trait_associated_functions()
                         {
                             feature_err(
@@ -850,21 +846,21 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
                             )
                             .emit();
                         }
+
                         let imported_binding = this.import(binding, import);
                         target_bindings[ns].set(Some(imported_binding));
                         this.define(parent, target, ns, imported_binding);
                     }
-                    source_binding @ (Ok(..) | Err(Determined)) => {
-                        if source_binding.is_ok() {
-                            this.dcx()
-                                .create_err(IsNotDirectlyImportable { span: import.span, target })
-                                .emit();
+                    Err(Determined) => {
+                        // Don't update the resolution for underscores, because it was never added.
+                        if target.name != kw::Underscore {
+                            let key = BindingKey::new(target, ns);
+                            this.update_resolution(parent, key, false, |_, resolution| {
+                                resolution.single_imports.swap_remove(&import);
+                            });
                         }
-                        let key = BindingKey::new(target, ns);
-                        this.update_resolution(parent, key, false, |_, resolution| {
-                            resolution.single_imports.swap_remove(&import);
-                        });
                     }
+                    Err(Undetermined) => indeterminate_count += 1,
                 }
             }
         });
@@ -1428,10 +1424,17 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
             return;
         };
 
-        if module.is_trait() {
-            self.dcx().emit_err(ItemsInTraitsAreNotImportable { span: import.span });
-            return;
-        } else if module == import.parent_scope.module {
+        if module.is_trait() && !self.tcx.features().import_trait_associated_functions() {
+            feature_err(
+                self.tcx.sess,
+                sym::import_trait_associated_functions,
+                import.span,
+                "`use` associated items of traits is unstable",
+            )
+            .emit();
+        }
+
+        if module == import.parent_scope.module {
             return;
         } else if is_prelude {
             self.prelude = Some(module);
diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs
index d2da3ac7d86..d23e588e2e3 100644
--- a/compiler/rustc_resolve/src/lib.rs
+++ b/compiler/rustc_resolve/src/lib.rs
@@ -949,14 +949,8 @@ impl<'ra> NameBindingData<'ra> {
         }
     }
 
-    fn is_importable(&self) -> bool {
-        !matches!(self.res(), Res::Def(DefKind::AssocTy, _))
-    }
-
-    // FIXME(import_trait_associated_functions): associate `const` or `fn` are not importable unless
-    // the feature `import_trait_associated_functions` is enable
-    fn is_assoc_const_or_fn(&self) -> bool {
-        matches!(self.res(), Res::Def(DefKind::AssocConst | DefKind::AssocFn, _))
+    fn is_assoc_item(&self) -> bool {
+        matches!(self.res(), Res::Def(DefKind::AssocConst | DefKind::AssocFn | DefKind::AssocTy, _))
     }
 
     fn macro_kind(&self) -> Option<MacroKind> {
diff --git a/library/std/src/fs.rs b/library/std/src/fs.rs
index 3ff08e3a566..11f439b9996 100644
--- a/library/std/src/fs.rs
+++ b/library/std/src/fs.rs
@@ -3043,7 +3043,7 @@ pub fn read_dir<P: AsRef<Path>>(path: P) -> io::Result<ReadDir> {
 /// When possible, permissions should be set at creation time instead.
 ///
 /// # Rationale
-/// POSIX does not specify an `lchown` function,
+/// POSIX does not specify an `lchmod` function,
 /// and symlinks can be followed regardless of what permission bits are set.
 ///
 /// # Errors
diff --git a/src/bootstrap/Cargo.lock b/src/bootstrap/Cargo.lock
index d415668f54a..cdad3bd46fa 100644
--- a/src/bootstrap/Cargo.lock
+++ b/src/bootstrap/Cargo.lock
@@ -64,7 +64,7 @@ dependencies = [
  "tracing-subscriber",
  "tracing-tree",
  "walkdir",
- "windows",
+ "windows 0.57.0",
  "xz2",
 ]
 
@@ -159,12 +159,6 @@ dependencies = [
 ]
 
 [[package]]
-name = "core-foundation-sys"
-version = "0.8.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
-
-[[package]]
 name = "cpufeatures"
 version = "0.2.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -441,6 +435,25 @@ dependencies = [
 ]
 
 [[package]]
+name = "objc2-core-foundation"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1c10c2894a6fed806ade6027bcd50662746363a9589d3ec9d9bef30a4e4bc166"
+dependencies = [
+ "bitflags",
+]
+
+[[package]]
+name = "objc2-io-kit"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "71c1c64d6120e51cd86033f67176b1cb66780c2efe34dec55176f77befd93c0a"
+dependencies = [
+ "libc",
+ "objc2-core-foundation",
+]
+
+[[package]]
 name = "object"
 version = "0.36.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -700,15 +713,16 @@ dependencies = [
 
 [[package]]
 name = "sysinfo"
-version = "0.33.0"
+version = "0.35.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "948512566b1895f93b1592c7574baeb2de842f224f2aab158799ecadb8ebbb46"
+checksum = "b897c8ea620e181c7955369a31be5f48d9a9121cb59fd33ecef9ff2a34323422"
 dependencies = [
- "core-foundation-sys",
  "libc",
  "memchr",
  "ntapi",
- "windows",
+ "objc2-core-foundation",
+ "objc2-io-kit",
+ "windows 0.61.1",
 ]
 
 [[package]]
@@ -927,23 +941,68 @@ version = "0.57.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143"
 dependencies = [
- "windows-core",
+ "windows-core 0.57.0",
  "windows-targets",
 ]
 
 [[package]]
+name = "windows"
+version = "0.61.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c5ee8f3d025738cb02bad7868bbb5f8a6327501e870bf51f1b455b0a2454a419"
+dependencies = [
+ "windows-collections",
+ "windows-core 0.61.0",
+ "windows-future",
+ "windows-link",
+ "windows-numerics",
+]
+
+[[package]]
+name = "windows-collections"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8"
+dependencies = [
+ "windows-core 0.61.0",
+]
+
+[[package]]
 name = "windows-core"
 version = "0.57.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d"
 dependencies = [
- "windows-implement",
- "windows-interface",
- "windows-result",
+ "windows-implement 0.57.0",
+ "windows-interface 0.57.0",
+ "windows-result 0.1.2",
  "windows-targets",
 ]
 
 [[package]]
+name = "windows-core"
+version = "0.61.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980"
+dependencies = [
+ "windows-implement 0.60.0",
+ "windows-interface 0.59.1",
+ "windows-link",
+ "windows-result 0.3.2",
+ "windows-strings",
+]
+
+[[package]]
+name = "windows-future"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7a1d6bbefcb7b60acd19828e1bc965da6fcf18a7e39490c5f8be71e54a19ba32"
+dependencies = [
+ "windows-core 0.61.0",
+ "windows-link",
+]
+
+[[package]]
 name = "windows-implement"
 version = "0.57.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -955,6 +1014,17 @@ dependencies = [
 ]
 
 [[package]]
+name = "windows-implement"
+version = "0.60.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
 name = "windows-interface"
 version = "0.57.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -966,6 +1036,33 @@ dependencies = [
 ]
 
 [[package]]
+name = "windows-interface"
+version = "0.59.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "windows-link"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38"
+
+[[package]]
+name = "windows-numerics"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1"
+dependencies = [
+ "windows-core 0.61.0",
+ "windows-link",
+]
+
+[[package]]
 name = "windows-result"
 version = "0.1.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -975,6 +1072,24 @@ dependencies = [
 ]
 
 [[package]]
+name = "windows-result"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252"
+dependencies = [
+ "windows-link",
+]
+
+[[package]]
+name = "windows-strings"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97"
+dependencies = [
+ "windows-link",
+]
+
+[[package]]
 name = "windows-sys"
 version = "0.52.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml
index 712a9b04c1a..e34de924cc1 100644
--- a/src/bootstrap/Cargo.toml
+++ b/src/bootstrap/Cargo.toml
@@ -58,7 +58,7 @@ walkdir = "2.4"
 xz2 = "0.1"
 
 # Dependencies needed by the build-metrics feature
-sysinfo = { version = "0.33.0", default-features = false, optional = true, features = ["system"] }
+sysinfo = { version = "0.35.0", default-features = false, optional = true, features = ["system"] }
 
 # Dependencies needed by the `tracing` feature
 tracing = { version = "0.1", optional = true, features = ["attributes"] }
diff --git a/src/doc/rustc/src/platform-support/riscv32im-risc0-zkvm-elf.md b/src/doc/rustc/src/platform-support/riscv32im-risc0-zkvm-elf.md
index 09b42da26e7..1d02a7cfbc0 100644
--- a/src/doc/rustc/src/platform-support/riscv32im-risc0-zkvm-elf.md
+++ b/src/doc/rustc/src/platform-support/riscv32im-risc0-zkvm-elf.md
@@ -8,7 +8,6 @@ RISC Zero's Zero Knowledge Virtual Machine (zkVM) implementing the RV32IM instru
 
 [@flaub](https://github.com/flaub)
 [@jbruestle](https://github.com/jbruestle)
-[@SchmErik](https://github.com/SchmErik)
 
 ## Background
 
diff --git a/src/tools/opt-dist/Cargo.toml b/src/tools/opt-dist/Cargo.toml
index cea234cc74c..b0db8346f7e 100644
--- a/src/tools/opt-dist/Cargo.toml
+++ b/src/tools/opt-dist/Cargo.toml
@@ -10,7 +10,7 @@ log = "0.4"
 anyhow = "1"
 humantime = "2"
 humansize = "2"
-sysinfo = { version = "0.31.2", default-features = false, features = ["disk"] }
+sysinfo = { version = "0.35.0", default-features = false, features = ["disk"] }
 fs_extra = "1"
 camino = "1"
 tar = "0.4"
diff --git a/tests/ui/codegen/equal-pointers-unequal/as-cast/basic.rs b/tests/ui/codegen/equal-pointers-unequal/as-cast/basic.rs
deleted file mode 100644
index e2a00ce173d..00000000000
--- a/tests/ui/codegen/equal-pointers-unequal/as-cast/basic.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-//@ known-bug: #107975
-//@ compile-flags: -Copt-level=2
-//@ run-pass
-
-fn main() {
-    let a: usize = {
-        let v = 0u8;
-        &v as *const _ as usize
-    };
-    let b: usize = {
-        let v = 0u8;
-        &v as *const _ as usize
-    };
-
-    // `a` and `b` are not equal.
-    assert_ne!(a, b);
-    // But they are the same number.
-    assert_eq!(format!("{a}"), format!("{b}"));
-    // And they are equal.
-    assert_eq!(a, b);
-}
diff --git a/tests/ui/codegen/equal-pointers-unequal/as-cast/function.rs b/tests/ui/codegen/equal-pointers-unequal/as-cast/function.rs
deleted file mode 100644
index 15434de50f7..00000000000
--- a/tests/ui/codegen/equal-pointers-unequal/as-cast/function.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-//@ known-bug: #107975
-//@ compile-flags: -Copt-level=2
-//@ run-pass
-
-// Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1434203908
-
-fn f() -> usize {
-    let v = 0;
-    &v as *const _ as usize
-}
-
-fn main() {
-    let a = f();
-    let b = f();
-
-    // `a` and `b` are not equal.
-    assert_ne!(a, b);
-    // But they are the same number.
-    assert_eq!(format!("{a}"), format!("{b}"));
-    // And they are equal.
-    assert_eq!(a, b);
-}
diff --git a/tests/ui/codegen/equal-pointers-unequal/as-cast/print.rs b/tests/ui/codegen/equal-pointers-unequal/as-cast/print.rs
deleted file mode 100644
index f33a9e511b6..00000000000
--- a/tests/ui/codegen/equal-pointers-unequal/as-cast/print.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-//@ known-bug: #107975
-//@ compile-flags: -Copt-level=2
-//@ run-pass
-
-// https://github.com/rust-lang/rust/issues/107975#issuecomment-1430704499
-
-fn main() {
-    let a = {
-        let v = 0;
-        &v as *const _ as usize
-    };
-    let b = {
-        let v = 0;
-        &v as *const _ as usize
-    };
-
-    assert_ne!(a, b);
-    println!("{a}"); // or b
-    assert_eq!(a, b);
-}
diff --git a/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/basic.rs b/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/basic.rs
deleted file mode 100644
index b2b4934aa5f..00000000000
--- a/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/basic.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-//@ known-bug: #107975
-//@ compile-flags: -Copt-level=2
-//@ run-pass
-
-use std::ptr;
-
-fn main() {
-    let a: usize = {
-        let v = 0u8;
-        ptr::from_ref(&v).expose_provenance()
-    };
-    let b: usize = {
-        let v = 0u8;
-        ptr::from_ref(&v).expose_provenance()
-    };
-
-    // `a` and `b` are not equal.
-    assert_ne!(a, b);
-    // But they are the same number.
-    assert_eq!(format!("{a}"), format!("{b}"));
-    // And they are equal.
-    assert_eq!(a, b);
-}
diff --git a/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/function.rs b/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/function.rs
deleted file mode 100644
index bf130c9f759..00000000000
--- a/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/function.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-//@ known-bug: #107975
-//@ compile-flags: -Copt-level=2
-//@ run-pass
-
-// Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1434203908
-
-use std::ptr;
-
-fn f() -> usize {
-    let v = 0;
-    ptr::from_ref(&v).expose_provenance()
-}
-
-fn main() {
-    let a = f();
-    let b = f();
-
-    // `a` and `b` are not equal.
-    assert_ne!(a, b);
-    // But they are the same number.
-    assert_eq!(format!("{a}"), format!("{b}"));
-    // And they are equal.
-    assert_eq!(a, b);
-}
diff --git a/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/print.rs b/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/print.rs
deleted file mode 100644
index 0baf8886395..00000000000
--- a/tests/ui/codegen/equal-pointers-unequal/exposed-provenance/print.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-//@ known-bug: #107975
-//@ compile-flags: -Copt-level=2
-//@ run-pass
-
-// https://github.com/rust-lang/rust/issues/107975#issuecomment-1430704499
-
-use std::ptr;
-
-fn main() {
-    let a: usize = {
-        let v = 0;
-        ptr::from_ref(&v).expose_provenance()
-    };
-    let b: usize = {
-        let v = 0;
-        ptr::from_ref(&v).expose_provenance()
-    };
-
-    assert_ne!(a, b);
-    println!("{a}"); // or b
-    assert_eq!(a, b);
-}
diff --git a/tests/ui/codegen/equal-pointers-unequal/strict-provenance/basic.rs b/tests/ui/codegen/equal-pointers-unequal/strict-provenance/basic.rs
deleted file mode 100644
index 4602ec654d1..00000000000
--- a/tests/ui/codegen/equal-pointers-unequal/strict-provenance/basic.rs
+++ /dev/null
@@ -1,23 +0,0 @@
-//@ known-bug: #107975
-//@ compile-flags: -Copt-level=2
-//@ run-pass
-
-use std::ptr;
-
-fn main() {
-    let a: usize = {
-        let v = 0u8;
-        ptr::from_ref(&v).addr()
-    };
-    let b: usize = {
-        let v = 0u8;
-        ptr::from_ref(&v).addr()
-    };
-
-    // `a` and `b` are not equal.
-    assert_ne!(a, b);
-    // But they are the same number.
-    assert_eq!(format!("{a}"), format!("{b}"));
-    // And they are equal.
-    assert_eq!(a, b);
-}
diff --git a/tests/ui/codegen/equal-pointers-unequal/strict-provenance/function.rs b/tests/ui/codegen/equal-pointers-unequal/strict-provenance/function.rs
deleted file mode 100644
index 789a78c15b4..00000000000
--- a/tests/ui/codegen/equal-pointers-unequal/strict-provenance/function.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-//@ known-bug: #107975
-//@ compile-flags: -Copt-level=2
-//@ run-pass
-
-// Based on https://github.com/rust-lang/rust/issues/107975#issuecomment-1434203908
-
-use std::ptr;
-
-fn f() -> usize {
-    let v = 0;
-    ptr::from_ref(&v).addr()
-}
-
-fn main() {
-    let a = f();
-    let b = f();
-
-    // `a` and `b` are not equal.
-    assert_ne!(a, b);
-    // But they are the same number.
-    assert_eq!(format!("{a}"), format!("{b}"));
-    // And they are equal.
-    assert_eq!(a, b);
-}
diff --git a/tests/ui/codegen/equal-pointers-unequal/strict-provenance/print.rs b/tests/ui/codegen/equal-pointers-unequal/strict-provenance/print.rs
deleted file mode 100644
index b7165ce1e5c..00000000000
--- a/tests/ui/codegen/equal-pointers-unequal/strict-provenance/print.rs
+++ /dev/null
@@ -1,22 +0,0 @@
-//@ known-bug: #107975
-//@ compile-flags: -Copt-level=2
-//@ run-pass
-
-// https://github.com/rust-lang/rust/issues/107975#issuecomment-1430704499
-
-use std::ptr;
-
-fn main() {
-    let a: usize = {
-        let v = 0;
-        ptr::from_ref(&v).addr()
-    };
-    let b: usize = {
-        let v = 0;
-        ptr::from_ref(&v).addr()
-    };
-
-    assert_ne!(a, b);
-    println!("{a}"); // or b
-    assert_eq!(a, b);
-}
diff --git a/tests/ui/error-codes/E0253.rs b/tests/ui/error-codes/E0253.rs
deleted file mode 100644
index 8284f791c64..00000000000
--- a/tests/ui/error-codes/E0253.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-mod foo {
-    pub trait MyTrait {
-        type SomeType;
-    }
-}
-
-use foo::MyTrait::SomeType;
-    //~^ ERROR E0253
-
-fn main() {}
diff --git a/tests/ui/error-codes/E0253.stderr b/tests/ui/error-codes/E0253.stderr
deleted file mode 100644
index 954dbc81693..00000000000
--- a/tests/ui/error-codes/E0253.stderr
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0253]: `SomeType` is not directly importable
-  --> $DIR/E0253.rs:7:5
-   |
-LL | use foo::MyTrait::SomeType;
-   |     ^^^^^^^^^^^^^^^^^^^^^^ cannot be imported directly
-
-error: aborting due to 1 previous error
-
-For more information about this error, try `rustc --explain E0253`.
diff --git a/tests/ui/feature-gates/feature-gate-import-trait-associated-functions.rs b/tests/ui/feature-gates/feature-gate-import-trait-associated-functions.rs
index aec13fb0202..c2c010eaba6 100644
--- a/tests/ui/feature-gates/feature-gate-import-trait-associated-functions.rs
+++ b/tests/ui/feature-gates/feature-gate-import-trait-associated-functions.rs
@@ -60,4 +60,7 @@ fn f() {
     let t: Option<S> = DEFAULT;
 }
 
+trait Glob {}
+use Glob::*; //~ ERROR `use` associated items of traits is unstable
+
 fn main() {}
diff --git a/tests/ui/feature-gates/feature-gate-import-trait-associated-functions.stderr b/tests/ui/feature-gates/feature-gate-import-trait-associated-functions.stderr
index d342f5bd551..fca3cef3e20 100644
--- a/tests/ui/feature-gates/feature-gate-import-trait-associated-functions.stderr
+++ b/tests/ui/feature-gates/feature-gate-import-trait-associated-functions.stderr
@@ -48,6 +48,16 @@ LL |     use super::A::{self, DEFAULT, new};
    = help: add `#![feature(import_trait_associated_functions)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error: aborting due to 5 previous errors
+error[E0658]: `use` associated items of traits is unstable
+  --> $DIR/feature-gate-import-trait-associated-functions.rs:64:5
+   |
+LL | use Glob::*;
+   |     ^^^^^^^
+   |
+   = note: see issue #134691 <https://github.com/rust-lang/rust/issues/134691> for more information
+   = help: add `#![feature(import_trait_associated_functions)]` to the crate attributes to enable
+   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
+
+error: aborting due to 6 previous errors
 
 For more information about this error, try `rustc --explain E0658`.
diff --git a/tests/ui/imports/issue-30560.rs b/tests/ui/imports/issue-30560.rs
index d8d4ca608f1..fe5d17c1873 100644
--- a/tests/ui/imports/issue-30560.rs
+++ b/tests/ui/imports/issue-30560.rs
@@ -3,7 +3,4 @@ use Alias::*; //~ ERROR unresolved import `Alias` [E0432]
 
 use std::io::Result::*; //~ ERROR unresolved import `std::io::Result` [E0432]
 
-trait T {}
-use T::*; //~ ERROR items in traits are not importable
-
 fn main() {}
diff --git a/tests/ui/imports/issue-30560.stderr b/tests/ui/imports/issue-30560.stderr
index 69cfd4c06a8..89492261cba 100644
--- a/tests/ui/imports/issue-30560.stderr
+++ b/tests/ui/imports/issue-30560.stderr
@@ -1,9 +1,3 @@
-error: items in traits are not importable
-  --> $DIR/issue-30560.rs:7:5
-   |
-LL | use T::*;
-   |     ^^^^
-
 error[E0432]: unresolved import `Alias`
   --> $DIR/issue-30560.rs:2:5
    |
@@ -16,6 +10,6 @@ error[E0432]: unresolved import `std::io::Result`
 LL | use std::io::Result::*;
    |              ^^^^^^ `Result` is a type alias, not a module
 
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
 
 For more information about this error, try `rustc --explain E0432`.
diff --git a/tests/ui/target-feature/abi-incompatible-target-feature-attribute.riscv.stderr b/tests/ui/target-feature/abi-incompatible-target-feature-attribute.riscv.stderr
new file mode 100644
index 00000000000..49c5479275f
--- /dev/null
+++ b/tests/ui/target-feature/abi-incompatible-target-feature-attribute.riscv.stderr
@@ -0,0 +1,8 @@
+error: target feature `d` cannot be enabled with `#[target_feature]`: this feature is incompatible with the target ABI
+  --> $DIR/abi-incompatible-target-feature-attribute.rs:15:90
+   |
+LL | #[cfg_attr(x86, target_feature(enable = "soft-float"))] #[cfg_attr(riscv, target_feature(enable = "d"))]
+   |                                                                                          ^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/target-feature/abi-incompatible-target-feature-attribute.rs b/tests/ui/target-feature/abi-incompatible-target-feature-attribute.rs
new file mode 100644
index 00000000000..a8733440759
--- /dev/null
+++ b/tests/ui/target-feature/abi-incompatible-target-feature-attribute.rs
@@ -0,0 +1,17 @@
+//! Ensure ABI-incompatible features cannot be enabled via `#[target_feature]`.
+// ignore-tidy-linelength
+//@ compile-flags: --crate-type=lib
+//@ revisions: x86 riscv
+//@[x86] compile-flags: --target=x86_64-unknown-linux-gnu
+//@[x86] needs-llvm-components: x86
+//@[riscv] compile-flags: --target=riscv32e-unknown-none-elf
+//@[riscv] needs-llvm-components: riscv
+#![feature(no_core, lang_items, riscv_target_feature, x87_target_feature)]
+#![no_core]
+
+#[lang = "sized"]
+pub trait Sized {}
+
+#[cfg_attr(x86, target_feature(enable = "soft-float"))] #[cfg_attr(riscv, target_feature(enable = "d"))]
+//~^ERROR: cannot be enabled with
+pub unsafe fn my_fun() {}
diff --git a/tests/ui/target-feature/abi-incompatible-target-feature-attribute.x86.stderr b/tests/ui/target-feature/abi-incompatible-target-feature-attribute.x86.stderr
new file mode 100644
index 00000000000..81471fd7e30
--- /dev/null
+++ b/tests/ui/target-feature/abi-incompatible-target-feature-attribute.x86.stderr
@@ -0,0 +1,8 @@
+error: target feature `soft-float` cannot be enabled with `#[target_feature]`: this feature is incompatible with the target ABI
+  --> $DIR/abi-incompatible-target-feature-attribute.rs:15:32
+   |
+LL | #[cfg_attr(x86, target_feature(enable = "soft-float"))] #[cfg_attr(riscv, target_feature(enable = "d"))]
+   |                                ^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.riscv.stderr b/tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.riscv.stderr
new file mode 100644
index 00000000000..2dca0c22033
--- /dev/null
+++ b/tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.riscv.stderr
@@ -0,0 +1,19 @@
+warning: target feature `d` must be disabled to ensure that the ABI of the current target can be implemented correctly
+   |
+   = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #116344 <https://github.com/rust-lang/rust/issues/116344>
+
+warning: unstable feature specified for `-Ctarget-feature`: `d`
+   |
+   = note: this feature is not stably supported; its behavior can change in the future
+
+warning: unstable feature specified for `-Ctarget-feature`: `f`
+   |
+   = note: this feature is not stably supported; its behavior can change in the future
+
+warning: unstable feature specified for `-Ctarget-feature`: `zicsr`
+   |
+   = note: this feature is not stably supported; its behavior can change in the future
+
+warning: 4 warnings emitted
+
diff --git a/tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.rs b/tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.rs
new file mode 100644
index 00000000000..68e1d3b9ddc
--- /dev/null
+++ b/tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.rs
@@ -0,0 +1,22 @@
+//! Ensure ABI-incompatible features cannot be enabled via `-Ctarget-feature`.
+// These are just warnings for now.
+//@ check-pass
+//@ compile-flags: --crate-type=lib
+//@ revisions: x86 riscv
+//@[x86] compile-flags: --target=x86_64-unknown-linux-gnu -Ctarget-feature=+soft-float
+//@[x86] needs-llvm-components: x86
+//@[riscv] compile-flags: --target=riscv32e-unknown-none-elf -Ctarget-feature=+d
+//@[riscv] needs-llvm-components: riscv
+
+#![feature(no_core, lang_items, riscv_target_feature)]
+#![no_core]
+
+#[lang = "sized"]
+pub trait Sized {}
+#[lang = "freeze"]
+pub trait Freeze {}
+
+//~? WARN must be disabled to ensure that the ABI of the current target can be implemented correctly
+//~? WARN unstable feature specified for `-Ctarget-feature`
+//[riscv]~? WARN unstable feature specified for `-Ctarget-feature`
+//[riscv]~? WARN unstable feature specified for `-Ctarget-feature`
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.stderr b/tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.x86.stderr
index e49672f33b9..e49672f33b9 100644
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.stderr
+++ b/tests/ui/target-feature/abi-incompatible-target-feature-flag-enable.x86.stderr
diff --git a/tests/ui/target-feature/allowed-softfloat-target-feature-flag-disable.rs b/tests/ui/target-feature/abi-irrelevant-target-feature-flag-disable.rs
index 7368ef120fa..0013d033b9c 100644
--- a/tests/ui/target-feature/allowed-softfloat-target-feature-flag-disable.rs
+++ b/tests/ui/target-feature/abi-irrelevant-target-feature-flag-disable.rs
@@ -1,3 +1,6 @@
+//! `x87` is a required target feature on some x86 targets, but not on this one as this one
+//! uses soft-floats. So ensure disabling the target feature here (which is a NOP) does
+//! not trigger a warning.
 //@ compile-flags: --target=x86_64-unknown-none --crate-type=lib
 //@ needs-llvm-components: x86
 //@ compile-flags: -Ctarget-feature=-x87
diff --git a/tests/ui/target-feature/allowed-softfloat-target-feature-flag-disable.stderr b/tests/ui/target-feature/abi-irrelevant-target-feature-flag-disable.stderr
index 309b64afd92..309b64afd92 100644
--- a/tests/ui/target-feature/allowed-softfloat-target-feature-flag-disable.stderr
+++ b/tests/ui/target-feature/abi-irrelevant-target-feature-flag-disable.stderr
diff --git a/tests/ui/target-feature/allowed-softfloat-target-feature-attribute.rs b/tests/ui/target-feature/abi-required-target-feature-attribute.rs
index 8b60820cc9b..95723c57f94 100644
--- a/tests/ui/target-feature/allowed-softfloat-target-feature-attribute.rs
+++ b/tests/ui/target-feature/abi-required-target-feature-attribute.rs
@@ -1,3 +1,5 @@
+//! Enabling a target feature that is anyway required changes nothing, so this is allowed
+//! for `#[target_feature]`.
 //@ compile-flags: --target=x86_64-unknown-none --crate-type=lib
 //@ needs-llvm-components: x86
 //@ build-pass
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-neon.stderr b/tests/ui/target-feature/abi-required-target-feature-flag-disable.aarch64.stderr
index b1186d5d5dc..b1186d5d5dc 100644
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-neon.stderr
+++ b/tests/ui/target-feature/abi-required-target-feature-flag-disable.aarch64.stderr
diff --git a/tests/ui/target-feature/abi-required-target-feature-flag-disable.loongarch.stderr b/tests/ui/target-feature/abi-required-target-feature-flag-disable.loongarch.stderr
new file mode 100644
index 00000000000..35102e0571f
--- /dev/null
+++ b/tests/ui/target-feature/abi-required-target-feature-flag-disable.loongarch.stderr
@@ -0,0 +1,11 @@
+warning: target feature `d` must be enabled to ensure that the ABI of the current target can be implemented correctly
+   |
+   = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #116344 <https://github.com/rust-lang/rust/issues/116344>
+
+warning: unstable feature specified for `-Ctarget-feature`: `d`
+   |
+   = note: this feature is not stably supported; its behavior can change in the future
+
+warning: 2 warnings emitted
+
diff --git a/tests/ui/target-feature/abi-required-target-feature-flag-disable.riscv.stderr b/tests/ui/target-feature/abi-required-target-feature-flag-disable.riscv.stderr
new file mode 100644
index 00000000000..35102e0571f
--- /dev/null
+++ b/tests/ui/target-feature/abi-required-target-feature-flag-disable.riscv.stderr
@@ -0,0 +1,11 @@
+warning: target feature `d` must be enabled to ensure that the ABI of the current target can be implemented correctly
+   |
+   = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
+   = note: for more information, see issue #116344 <https://github.com/rust-lang/rust/issues/116344>
+
+warning: unstable feature specified for `-Ctarget-feature`: `d`
+   |
+   = note: this feature is not stably supported; its behavior can change in the future
+
+warning: 2 warnings emitted
+
diff --git a/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs b/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs
new file mode 100644
index 00000000000..c3ce05baa64
--- /dev/null
+++ b/tests/ui/target-feature/abi-required-target-feature-flag-disable.rs
@@ -0,0 +1,27 @@
+//! Ensure ABI-required features cannot be disabled via `-Ctarget-feature`.
+//! Also covers the case of a feature indirectly disabling another via feature implications.
+//@ compile-flags: --crate-type=lib
+//@ revisions: x86 x86-implied aarch64 riscv loongarch
+//@[x86] compile-flags: --target=x86_64-unknown-linux-gnu -Ctarget-feature=-x87
+//@[x86] needs-llvm-components: x86
+//@[x86-implied] compile-flags: --target=x86_64-unknown-linux-gnu -Ctarget-feature=-sse
+//@[x86-implied] needs-llvm-components: x86
+//@[aarch64] compile-flags: --target=aarch64-unknown-linux-gnu -Ctarget-feature=-neon
+//@[aarch64] needs-llvm-components: aarch64
+//@[riscv] compile-flags: --target=riscv64gc-unknown-none-elf -Ctarget-feature=-d
+//@[riscv] needs-llvm-components: riscv
+//@[loongarch] compile-flags: --target=loongarch64-unknown-none -Ctarget-feature=-d
+//@[loongarch] needs-llvm-components: loongarch
+// For now this is just a warning.
+//@ build-pass
+// Remove some LLVM warnings that only show up sometimes.
+//@ normalize-stderr: "\n[^\n]*(target-abi|lp64f)[^\n]*" -> ""
+
+#![feature(no_core, lang_items)]
+#![no_core]
+
+#[lang = "sized"]
+pub trait Sized {}
+
+//~? WARN must be enabled to ensure that the ABI of the current target can be implemented correctly
+//[x86,riscv,loongarch]~? WARN unstable feature specified for `-Ctarget-feature`
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-implied.stderr b/tests/ui/target-feature/abi-required-target-feature-flag-disable.x86-implied.stderr
index 7ec8b04cfce..7ec8b04cfce 100644
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-implied.stderr
+++ b/tests/ui/target-feature/abi-required-target-feature-flag-disable.x86-implied.stderr
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable.stderr b/tests/ui/target-feature/abi-required-target-feature-flag-disable.x86.stderr
index 02398d27501..02398d27501 100644
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable.stderr
+++ b/tests/ui/target-feature/abi-required-target-feature-flag-disable.x86.stderr
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-implied.rs b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-implied.rs
deleted file mode 100644
index 12e7e3bc45b..00000000000
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-implied.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-//! Ensure that if disabling a target feature implies disabling an ABI-required target feature,
-//! we complain.
-//@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=lib
-//@ needs-llvm-components: x86
-//@ compile-flags: -Ctarget-feature=-sse
-// For now this is just a warning.
-//@ build-pass
-
-#![feature(no_core, lang_items)]
-#![no_core]
-
-#[lang = "sized"]
-pub trait Sized {}
-
-//~? WARN target feature `sse2` must be enabled to ensure that the ABI of the current target can be implemented correctly
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-neon.rs b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-neon.rs
deleted file mode 100644
index 33e4f12694f..00000000000
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable-neon.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-//@ compile-flags: --target=aarch64-unknown-linux-gnu --crate-type=lib
-//@ needs-llvm-components: aarch64
-//@ compile-flags: -Ctarget-feature=-neon
-// For now this is just a warning.
-//@ build-pass
-
-#![feature(no_core, lang_items)]
-#![no_core]
-
-#[lang = "sized"]
-pub trait Sized {}
-
-//~? WARN target feature `neon` must be enabled to ensure that the ABI of the current target can be implemented correctly
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable.rs b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable.rs
deleted file mode 100644
index e1bd25ffad1..00000000000
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag-disable.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-//! Ensure ABI-required features cannot be disabled via `-Ctarget-feature`.
-//@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=lib
-//@ needs-llvm-components: x86
-//@ compile-flags: -Ctarget-feature=-x87
-// For now this is just a warning.
-//@ build-pass
-
-#![feature(no_core, lang_items)]
-#![no_core]
-
-#[lang = "sized"]
-pub trait Sized {}
-
-//~? WARN target feature `x87` must be enabled to ensure that the ABI of the current target can be implemented correctly
-//~? WARN unstable feature specified for `-Ctarget-feature`: `x87`
diff --git a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.rs b/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.rs
deleted file mode 100644
index 4ccc6e0e941..00000000000
--- a/tests/ui/target-feature/forbidden-hardfloat-target-feature-flag.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-//! Ensure ABI-incompatible features cannot be enabled via `-Ctarget-feature`.
-//@ compile-flags: --target=x86_64-unknown-linux-gnu --crate-type=lib
-//@ needs-llvm-components: x86
-//@ compile-flags: -Ctarget-feature=+soft-float
-// For now this is just a warning.
-//@ build-pass
-
-#![feature(no_core, lang_items, riscv_target_feature)]
-#![no_core]
-
-#[lang = "sized"]
-pub trait Sized {}
-
-//~? WARN target feature `soft-float` must be disabled to ensure that the ABI of the current target can be implemented correctl
-//~? WARN unstable feature specified for `-Ctarget-feature`: `soft-float`
diff --git a/tests/ui/use/import_trait_associated_item_bad.rs b/tests/ui/use/import_trait_associated_item_bad.rs
new file mode 100644
index 00000000000..d3d2a8e83cd
--- /dev/null
+++ b/tests/ui/use/import_trait_associated_item_bad.rs
@@ -0,0 +1,18 @@
+#![feature(import_trait_associated_functions)]
+#![feature(min_generic_const_args)]
+#![allow(incomplete_features)]
+
+trait Trait {
+    type AssocTy;
+    const CONST: usize;
+}
+
+use Trait::AssocTy;
+type Alias1 = AssocTy; //~ ERROR ambiguous associated type
+type Alias2 = self::AssocTy; //~ ERROR ambiguous associated type
+
+use Trait::CONST;
+type Alias3 = [u8; CONST]; //~ ERROR ambiguous associated constant
+type Alias4 = [u8; self::CONST]; //~ ERROR ambiguous associated constant
+
+fn main() {}
diff --git a/tests/ui/use/import_trait_associated_item_bad.stderr b/tests/ui/use/import_trait_associated_item_bad.stderr
new file mode 100644
index 00000000000..d5cd5d37bd7
--- /dev/null
+++ b/tests/ui/use/import_trait_associated_item_bad.stderr
@@ -0,0 +1,49 @@
+error[E0223]: ambiguous associated type
+  --> $DIR/import_trait_associated_item_bad.rs:11:15
+   |
+LL | type Alias1 = AssocTy;
+   |               ^^^^^^^
+   |
+help: if there were a type named `Example` that implemented `Trait`, you could use the fully-qualified path
+   |
+LL | type Alias1 = <Example as Trait>::AssocTy;
+   |               ++++++++++++++++++++
+
+error[E0223]: ambiguous associated type
+  --> $DIR/import_trait_associated_item_bad.rs:12:15
+   |
+LL | type Alias2 = self::AssocTy;
+   |               ^^^^^^^^^^^^^
+   |
+help: if there were a type named `Example` that implemented `Trait`, you could use the fully-qualified path
+   |
+LL - type Alias2 = self::AssocTy;
+LL + type Alias2 = <Example as Trait>::AssocTy;
+   |
+
+error[E0223]: ambiguous associated constant
+  --> $DIR/import_trait_associated_item_bad.rs:15:20
+   |
+LL | type Alias3 = [u8; CONST];
+   |                    ^^^^^
+   |
+help: if there were a type named `Example` that implemented `Trait`, you could use the fully-qualified path
+   |
+LL | type Alias3 = [u8; <Example as Trait>::CONST];
+   |                    ++++++++++++++++++++
+
+error[E0223]: ambiguous associated constant
+  --> $DIR/import_trait_associated_item_bad.rs:16:20
+   |
+LL | type Alias4 = [u8; self::CONST];
+   |                    ^^^^^^^^^^^
+   |
+help: if there were a type named `Example` that implemented `Trait`, you could use the fully-qualified path
+   |
+LL - type Alias4 = [u8; self::CONST];
+LL + type Alias4 = [u8; <Example as Trait>::CONST];
+   |
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0223`.
diff --git a/tests/ui/use/import_trait_associated_item_glob.rs b/tests/ui/use/import_trait_associated_item_glob.rs
new file mode 100644
index 00000000000..8a712514ed5
--- /dev/null
+++ b/tests/ui/use/import_trait_associated_item_glob.rs
@@ -0,0 +1,17 @@
+//@ check-pass
+
+#![feature(import_trait_associated_functions)]
+
+trait Trait: Default {
+    fn f() -> Self { Default::default() }
+    fn g() -> Self { Default::default() }
+}
+
+impl Trait for u8 {}
+
+use Trait::*;
+
+fn main() {
+    let _: u8 = f();
+    let _: u8 = g();
+}
diff --git a/tests/ui/use/use-from-trait-xc.rs b/tests/ui/use/use-from-trait-xc.rs
index b030892aa26..220bf8cad46 100644
--- a/tests/ui/use/use-from-trait-xc.rs
+++ b/tests/ui/use/use-from-trait-xc.rs
@@ -6,7 +6,7 @@ use use_from_trait_xc::Trait::foo;
 //~^ ERROR `use` associated items of traits is unstable [E0658]
 
 use use_from_trait_xc::Trait::Assoc;
-//~^ ERROR `Assoc` is not directly importable
+//~^ ERROR `use` associated items of traits is unstable [E0658]
 
 use use_from_trait_xc::Trait::CONST;
 //~^ ERROR `use` associated items of traits is unstable [E0658]
diff --git a/tests/ui/use/use-from-trait-xc.stderr b/tests/ui/use/use-from-trait-xc.stderr
index 0f8440aa530..c8ee29b18d0 100644
--- a/tests/ui/use/use-from-trait-xc.stderr
+++ b/tests/ui/use/use-from-trait-xc.stderr
@@ -8,11 +8,15 @@ LL | use use_from_trait_xc::Trait::foo;
    = help: add `#![feature(import_trait_associated_functions)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error[E0253]: `Assoc` is not directly importable
+error[E0658]: `use` associated items of traits is unstable
   --> $DIR/use-from-trait-xc.rs:8:5
    |
 LL | use use_from_trait_xc::Trait::Assoc;
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot be imported directly
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: see issue #134691 <https://github.com/rust-lang/rust/issues/134691> for more information
+   = help: add `#![feature(import_trait_associated_functions)]` to the crate attributes to enable
+   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: `use` associated items of traits is unstable
   --> $DIR/use-from-trait-xc.rs:11:5
@@ -74,5 +78,5 @@ LL | struct Foo;
 
 error: aborting due to 9 previous errors
 
-Some errors have detailed explanations: E0253, E0432, E0603, E0658.
-For more information about an error, try `rustc --explain E0253`.
+Some errors have detailed explanations: E0432, E0603, E0658.
+For more information about an error, try `rustc --explain E0432`.
diff --git a/tests/ui/use/use-from-trait.rs b/tests/ui/use/use-from-trait.rs
index 89b7aaa4ba3..cab661a29e8 100644
--- a/tests/ui/use/use-from-trait.rs
+++ b/tests/ui/use/use-from-trait.rs
@@ -1,5 +1,5 @@
 use Trait::foo; //~ ERROR `use` associated items of traits is unstable [E0658]
-use Trait::Assoc; //~ ERROR `Assoc` is not directly importable
+use Trait::Assoc; //~ ERROR `use` associated items of traits is unstable [E0658]
 use Trait::C; //~ ERROR `use` associated items of traits is unstable [E0658]
 
 use Foo::new; //~ ERROR unresolved import `Foo` [E0432]
diff --git a/tests/ui/use/use-from-trait.stderr b/tests/ui/use/use-from-trait.stderr
index 2dd78a35452..63cfcc20750 100644
--- a/tests/ui/use/use-from-trait.stderr
+++ b/tests/ui/use/use-from-trait.stderr
@@ -8,11 +8,15 @@ LL | use Trait::foo;
    = help: add `#![feature(import_trait_associated_functions)]` to the crate attributes to enable
    = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
-error[E0253]: `Assoc` is not directly importable
+error[E0658]: `use` associated items of traits is unstable
   --> $DIR/use-from-trait.rs:2:5
    |
 LL | use Trait::Assoc;
-   |     ^^^^^^^^^^^^ cannot be imported directly
+   |     ^^^^^^^^^^^^
+   |
+   = note: see issue #134691 <https://github.com/rust-lang/rust/issues/134691> for more information
+   = help: add `#![feature(import_trait_associated_functions)]` to the crate attributes to enable
+   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
 
 error[E0658]: `use` associated items of traits is unstable
   --> $DIR/use-from-trait.rs:3:5
@@ -38,5 +42,5 @@ LL | use Foo::C2;
 
 error: aborting due to 5 previous errors
 
-Some errors have detailed explanations: E0253, E0432, E0658.
-For more information about an error, try `rustc --explain E0253`.
+Some errors have detailed explanations: E0432, E0658.
+For more information about an error, try `rustc --explain E0432`.