diagnostics: suggest generic_const_args for const ops#156968
diagnostics: suggest generic_const_args for const ops#156968Dnreikronos wants to merge 2 commits into
Conversation
|
HIR ty lowering was modified cc @fmease |
|
r? @wesleywiser rustbot has assigned @wesleywiser. Use Why was this reviewer chosen?The reviewer was selected based on:
|
a43c40b to
d890018
Compare
This comment has been minimized.
This comment has been minimized.
d890018 to
f883d0e
Compare
This comment has been minimized.
This comment has been minimized.
f883d0e to
a9b91d1
Compare
This comment has been minimized.
This comment has been minimized.
|
@wesleywiser, hi! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
c02ce98 to
bf4bad2
Compare
generic_const_args + type const items in const operation diagnostics|
@rustbot reroll |
|
@bors r+ |
…gnostic-156729, r=petrochenkov diagnostics: suggest generic_const_args for const ops fixes rust-lang#156729 when const ops hit generic params, like `[u8; size_of::<self>()]`, the diagnostic only points at `generic_const_exprs`. imo that's a stale nudge now that `generic_const_args` and `type const` items are the path we want people trying. add help for `generic_const_args` and `type const` items in the resolve and hir_ty_lowering paths. also skip the old gce suggestion once `min_generic_const_args` is enabled, and emit both suggestions for the `self` alias path so the "alternatively" wording doesn't hang there by itself. includes the regression test from the issue. lgtm.
Rollup of 8 pull requests Successful merges: - #156968 (diagnostics: suggest generic_const_args for const ops) - #158617 (allow mGCA const arguments to fall back to anon consts) - #158690 (delegation: support mapping of all arguments with `Self` type) - #158696 (Rename some `body_id` to `body_def_id`) - #158333 (Fix typetree generation for differentiated functions) - #158646 (powerpc64le_unknown_freebsd.rs: link with -lgcc) - #158802 (Use `ci-mirrors` in `armhf-gnu` for {busybox, ubuntu rootfs} artifacts) - #158905 (delegation: add constraints to new generic args)
…gnostic-156729, r=petrochenkov diagnostics: suggest generic_const_args for const ops fixes rust-lang#156729 when const ops hit generic params, like `[u8; size_of::<self>()]`, the diagnostic only points at `generic_const_exprs`. imo that's a stale nudge now that `generic_const_args` and `type const` items are the path we want people trying. add help for `generic_const_args` and `type const` items in the resolve and hir_ty_lowering paths. also skip the old gce suggestion once `min_generic_const_args` is enabled, and emit both suggestions for the `self` alias path so the "alternatively" wording doesn't hang there by itself. includes the regression test from the issue. lgtm.
|
💔 I suspect this PR failed tests as part of a rollup After fixing the problem, consider running a try job for the failed job before re-approving. Link to failure: #158909 (comment) |
|
This pull request was unapproved. This PR was contained in a rollup (#158909), which was unapproved. |
…stics Point users at `#![feature(generic_const_args)]` and `type const` items when they hit the "generic parameters may not be used in const operations" error, not just `generic_const_exprs`.
bf4bad2 to
7958796
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. |
|
@JonathanBrouwer @petrochenkov i pushed a fix for the rollup failure from the i rebased the pr on current imo this was just a stale ui fixture after the rollup picked up a newer test from main. the compiler output looked right to me, the expected stderr was the part that was out of date. i also ran could one of you re-trigger the failed job / try job for that same builder? i don't have permission to do it from here. ltm if you want anything else changed. |
|
This soft conflicts with #158617 which is in the current rollup, please rebase on that after it's merged |
fixes #156729
when const ops hit generic params, like
[u8; size_of::<self>()], the diagnostic only points atgeneric_const_exprs. imo that's a stale nudge now thatgeneric_const_argsandtype constitems are the path we want people trying.add help for
generic_const_argsandtype constitems in the resolve and hir_ty_lowering paths. also skip the old gce suggestion oncemin_generic_const_argsis enabled, and emit both suggestions for theselfalias path so the "alternatively" wording doesn't hang there by itself. includes the regression test from the issue. lgtm.