about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/traits/mod.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-02-05 12:02:04 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2025-02-06 13:31:43 +1100
commitd28678e6216f63544cdea37deff4ca26158a67f5 (patch)
tree87d09ad1242dc4368065430d306a6abf11c0195a /compiler/rustc_middle/src/traits/mod.rs
parente5f11af042ad099102efd572743138df60764a4e (diff)
downloadrust-d28678e6216f63544cdea37deff4ca26158a67f5.tar.gz
rust-d28678e6216f63544cdea37deff4ca26158a67f5.zip
Clean up trivial traversal/lift impl generator macro calls.
We have four macros for generating trivial traversal (fold/visit) and
lift impls.
- `rustc_ir::TrivialTypeTraversalImpls`
- `rustc_middle::TrivialTypeTraversalImpls`
- `rustc_middle::TrivialLiftImpls`
- `rustc_middle::TrivialTypeTraversalAndLiftImpls`

The first two are very similar. The last one just combines the second
and third one.

The macros themselves are ok, but their use is a mess. This commit does
the following.
- Removes types that no longer need a lift and/or traversal impl from
  the macro calls.
- Consolidates the macro calls into the smallest number of calls
  possible, with each one mentioning as many types as possible.
- Orders the types within those macro calls alphabetically, and makes
  the module qualification more consistent.
- Eliminates `rustc_middle::mir::type_foldable`, because the macro calls
  were merged and the manual `TypeFoldable` impls are better placed in
  `structural_impls.rs`, alongside all the other ones.

This makes the code more concise. Moving forward, it also makes it more
obvious where new types should be added.
Diffstat (limited to 'compiler/rustc_middle/src/traits/mod.rs')
-rw-r--r--compiler/rustc_middle/src/traits/mod.rs4
1 files changed, 0 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/traits/mod.rs b/compiler/rustc_middle/src/traits/mod.rs
index d0ce4e6242e..1314a235610 100644
--- a/compiler/rustc_middle/src/traits/mod.rs
+++ b/compiler/rustc_middle/src/traits/mod.rs
@@ -427,10 +427,6 @@ pub enum IsConstable {
     Ctor,
 }
 
-TrivialTypeTraversalAndLiftImpls! {
-    IsConstable,
-}
-
 /// The 'location' at which we try to perform HIR-based wf checking.
 /// This information is used to obtain an `hir::Ty`, which
 /// we can walk in order to obtain precise spans for any