yeet alias new_from_def_id - #162760
yeet alias new_from_def_id#162760khyperia wants to merge 1 commit into
Conversation
|
|
|
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 |
| ct: ty::AliasConst::new( | ||
| self.tcx, | ||
| ty::AliasConstKind::Anon { def_id: did }, | ||
| self.tcx.mk_args(&[]), |
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.
| 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. |
7e8f2a3 to
7fc2f33
Compare
This comment has been minimized.
This comment has been minimized.
7fc2f33 to
0ace795
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
| def_id: DefId, | ||
| args: GenericArgsRef<'tcx>, |
There was a problem hiding this comment.
unsure about this change, we want to maintain a fairly clear distinction between type system consts and non-type-system contains and this blurs that a bit 🤔
There was a problem hiding this comment.
would quite like to not do this and then hand write the old logic into our handling of the THIR jank with a FIXME about how we don't want to be doing that 🤔
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