yeet alias new_from_def_id - #162760
yeet alias new_from_def_id#162760
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 🤔
0ace795 to
caedbd8
Compare
|
with the latest update, this bit in the PR description no longer applies, this PR is no longer perf-questionable:
well, there's still one or tw.o less calls to noting it here rather than just doing a strikethrough in the PR description since the PR description gets committed ✨ |
the review is no longer applicable - the rewording was because I redid the |
|
@bors r+ |
…oxyUwU yeet alias new_from_def_id this PR fixes the `// FIXME: remove in favor of explicit construction` on `alias_term_kind_from_def_id` vaguely related to rust-lang/project-const-generics#98 / rust-lang#152245 fyi @lcnr who didn't like `AliasConstInherentArgsKind` rust-lang#161929 (comment) (it gets yeeted in this PR) r? @BoxyUwU
…uwer Rollup of 24 pull requests Successful merges: - #161596 (coretests: Add more pattern tests.) - #162177 (Properly implement the gpu-kernel ABI for amdgpu) - #162411 (Make Receiver `#[rustc_dyn_incompatible_trait]`) - #162760 (yeet alias new_from_def_id) - #162796 (libtest: do not early exit from test runners) - #162844 (Add loan reachability traces to polonius MIR dumps) - #162876 (Move operations out of `rustc_middle::query::job`) - #160108 (Stabilize `windows_process_extensions_main_thread_handle`) - #160212 (traits: Fix rigid alias liveness matching) - #160544 (Stabilize `feature(trim_prefix_suffix)` (`{str, [T], Path}::trim_prefix` and `{str, [T]}::trim_suffix`)) - #161305 (Use the entire type of a dropped local to compute variance (edge direction) for Polonius alpha) - #161838 (tests: accept LLVM 24 optimization in this test) - #162312 (core: Rewrite docs for try_as_dyn) - #162785 (Avoid creating overlapping assignments in MatchBranchSimplification) - #162805 (Add `must_use` lint to `ExitCode`) - #162825 (core: Add examples for `debug_closure_helpers`) - #162841 (enable asm tests for xtensa targets) - #162842 (reintroduce check RibKind::ConstParamTy did in direct consts) - #162845 (mgca: fix issue with mismatched array valtree/valtree tys) - #162856 (Stabilize CommandExt::show_window) - #162865 (Complex conjugate, negation and default) - #162874 (Add support for `annotate_snippets::snippet::AnnotationKind::Visible`) - #162881 (Simplify the macro for forwarding Decoder methods ) - #162888 (Fix a typo on the Armv7-R platform docs page)
…uwer Rollup of 23 pull requests Successful merges: - #161596 (coretests: Add more pattern tests.) - #162411 (Make Receiver `#[rustc_dyn_incompatible_trait]`) - #162760 (yeet alias new_from_def_id) - #162796 (libtest: do not early exit from test runners) - #162844 (Add loan reachability traces to polonius MIR dumps) - #162876 (Move operations out of `rustc_middle::query::job`) - #160108 (Stabilize `windows_process_extensions_main_thread_handle`) - #160212 (traits: Fix rigid alias liveness matching) - #160544 (Stabilize `feature(trim_prefix_suffix)` (`{str, [T], Path}::trim_prefix` and `{str, [T]}::trim_suffix`)) - #161305 (Use the entire type of a dropped local to compute variance (edge direction) for Polonius alpha) - #161838 (tests: accept LLVM 24 optimization in this test) - #162312 (core: Rewrite docs for try_as_dyn) - #162785 (Avoid creating overlapping assignments in MatchBranchSimplification) - #162805 (Add `must_use` lint to `ExitCode`) - #162825 (core: Add examples for `debug_closure_helpers`) - #162841 (enable asm tests for xtensa targets) - #162842 (reintroduce check RibKind::ConstParamTy did in direct consts) - #162845 (mgca: fix issue with mismatched array valtree/valtree tys) - #162856 (Stabilize CommandExt::show_window) - #162865 (Complex conjugate, negation and default) - #162874 (Add support for `annotate_snippets::snippet::AnnotationKind::Visible`) - #162881 (Simplify the macro for forwarding Decoder methods ) - #162888 (Fix a typo on the Armv7-R platform docs page)
Rollup merge of #162760 - khyperia:yeet-new_from_def_id, r=BoxyUwU yeet alias new_from_def_id this PR fixes the `// FIXME: remove in favor of explicit construction` on `alias_term_kind_from_def_id` vaguely related to rust-lang/project-const-generics#98 / #152245 fyi @lcnr who didn't like `AliasConstInherentArgsKind` #161929 (comment) (it gets yeeted in this PR) r? @BoxyUwU
| } | ||
| } | ||
| DefKind::Const => ty::AliasConstKind::Free { def_id }, | ||
| _ => unreachable!(), |
There was a problem hiding this comment.
reachable via #162923
Its always better here to print the actual Defkind or whatever we are not expecting to be reachable as this makes categorizing the ICE a bit easier imho :)
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
fyi @lcnr who didn't like
AliasConstInherentArgsKind#161929 (comment) (it gets yeeted in this PR)r? @BoxyUwU