Skip to content

Create Ty type alias in rustc_type_ir#154270

Draft
Jamesbarford wants to merge 1 commit intorust-lang:mainfrom
Jamesbarford:chore/move-ty-pt1
Draft

Create Ty type alias in rustc_type_ir#154270
Jamesbarford wants to merge 1 commit intorust-lang:mainfrom
Jamesbarford:chore/move-ty-pt1

Conversation

@Jamesbarford
Copy link
Contributor

@Jamesbarford Jamesbarford commented Mar 23, 2026

r? lcnr

Anywhere that required the use of the trait Ty I used ty::Ty<I> otherwise it should be Ty<I>

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Mar 23, 2026
@rust-bors

This comment has been minimized.

/// We can simply cache based on the ty itself, because we use
/// `ty::BoundVarIndexKind::Canonical`.
cache: HashMap<I::Ty, I::Ty>,
cache: HashMap<ty::Ty<I>, ty::Ty<I>>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you also add the lint that we should use Ty without any prefix to the type alias? it should be some attribute on struct Ty, idk if it already works with type aliases.

anyways, please import ty::Ty. There isn't really a good reason for that outside of consistency

Comment on lines +1 to +2
// This type is temporary and exists to cut down the bloat of further Pr's
// moving `struct Ty` from `rustc_middle` to `rustc_type_ir`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// This type is temporary and exists to cut down the bloat of further Pr's
// moving `struct Ty` from `rustc_middle` to `rustc_type_ir`.
/// This type is temporary and exists to cut down the bloat of further PR's
/// moving `struct Ty` from `rustc_middle` to `rustc_type_ir`.

Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 nice

please also do so for all uses of <whatever as Interner>::Ty

View changes since this review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants