Create Ty type alias in rustc_type_ir#154270
Draft
Jamesbarford wants to merge 1 commit intorust-lang:mainfrom
Draft
Create Ty type alias in rustc_type_ir#154270Jamesbarford wants to merge 1 commit intorust-lang:mainfrom
Ty type alias in rustc_type_ir#154270Jamesbarford wants to merge 1 commit intorust-lang:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
f1f5c07 to
516daa1
Compare
lcnr
reviewed
Mar 24, 2026
| /// 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>>, |
Contributor
There was a problem hiding this comment.
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
lcnr
reviewed
Mar 24, 2026
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`. |
Contributor
There was a problem hiding this comment.
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`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
r? lcnr
Anywhere that required the use of the trait
TyI usedty::Ty<I>otherwise it should beTy<I>