yeet alias new_from_def_id - #162760
Open
khyperia wants to merge 1 commit into
Open
yeet alias new_from_def_id#162760khyperia wants to merge 1 commit into
khyperia wants to merge 1 commit into
Conversation
Collaborator
|
|
khyperia
marked this pull request as ready for review
September 14, 2026 10:56
Collaborator
|
Some changes occurred in compiler/rustc_sanitizers cc @rcvalle Some changes occurred in match checking cc @Nadrieril Some changes occurred in cc @BoxyUwU HIR ty lowering was modified cc @fmease |
khyperia
commented
Sep 14, 2026
| ct: ty::AliasConst::new( | ||
| self.tcx, | ||
| ty::AliasConstKind::Anon { def_id: did }, | ||
| self.tcx.mk_args(&[]), |
Member
Author
There was a problem hiding this comment.
debating if I should pull this change out into another PR:
this changes the args from the ADT's args to []. This is because discriminant anon consts have no generics, but we were passing the ADT's generics to it here. This is wrong, and with this change, the debug assert in AliasConst::new for correct generic args triggers. Before, we were simply harmlessly ignoring the extra generic args.
bit-aloo
reviewed
Sep 14, 2026
Comment on lines
73
to
76
| let user_ty = user_ty.as_ref().and_then(push_cuta); | ||
| // Under generic_const_args, `def_id` might be a regular const declared in a trait, but | ||
| // is `impl`d as a directly represented const. We do not know whether it is here, so we | ||
| // must use type system normalization for all consts under generic_const_args. |
khyperia
force-pushed
the
yeet-new_from_def_id
branch
from
September 14, 2026 19:22
7e8f2a3 to
7fc2f33
Compare
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.
this PR fixes the
// FIXME: remove in favor of explicit constructiononalias_term_kind_from_def_idvaguely related to rust-lang/project-const-generics#98 / #152245
this PR might be slightly perf-positive due to calling
def_kindless. the change to THIR ExprKind is maybe very tiny bit different perf characteristics too but highly unlikely.fyi @lcnr who didn't like
AliasConstInherentArgsKind#161929 (comment) (it gets yeeted in this PR)r? @BoxyUwU