Render the box pattern removal diagnostic more actionable & remove box expression recovery - #162008
Render the box pattern removal diagnostic more actionable & remove box expression recovery#162008fmease wants to merge 3 commits into
box pattern removal diagnostic more actionable & remove box expression recovery#162008Conversation
|
r? @fee1-dead rustbot has assigned @fee1-dead. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Maybe it's also time to just remove the suggestion for |
box pattern removal diagnostic more actionablebox pattern removal diagnostic more actionable & fully remove box expression recovery
| || [ | ||
| kw::Async, | ||
| kw::Do, | ||
| kw::Box, |
There was a problem hiding this comment.
Modifying can_begin* usually affects stable(!) macro rules matching behavior. In this case, it leads to code like the following to go from fail to pass:
macro_rules! mk {
($e:expr) => { compile_error!("expr"); };
(box $e:expr) => {};
}
mk!(box 0);Strictly speaking that's a new guarantee (in the sense that re-adding box exprs would be breaking). It's unclear if lang FCP #108471 (comment) covers this. If you don't want to involve T-lang at this time, we could also keep kw::Box in can_begin_expr for now and add a FIXME to revisit it in the future.
There was a problem hiding this comment.
I would prefer us to split this out of the suggestion / expression recovery remove, and nominate lang for it, this PR should just add a FIXME.
However, let's document that changing this function can change stable macro rules behavior too.
This comment has been minimized.
This comment has been minimized.
6933264 to
e292f3c
Compare
| || [ | ||
| kw::Async, | ||
| kw::Do, | ||
| kw::Box, |
There was a problem hiding this comment.
I would prefer us to split this out of the suggestion / expression recovery remove, and nominate lang for it, this PR should just add a FIXME.
However, let's document that changing this function can change stable macro rules behavior too.
e292f3c to
2f8aad1
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. |
|
Applied suggestions found in #162008 (comment).
@bors r=fee1-dead rollup |
2f8aad1 to
7a71a74
Compare
|
This pull request was unapproved. |
|
Oops, forgot to @bors r=fee1-dead |
box pattern removal diagnostic more actionable & fully remove box expression recoverybox pattern removal diagnostic more actionable & remove box expression recovery
…fee1-dead Render the `box` pattern removal diagnostic more actionable & remove `box` expression recovery Follow-up to rust-lang#156749. This way, users don't have to comb through (probably outdated) tracking issues trying to piece together how to fix their code (in the most idiomatic way). Lemme know if you think this is unnecessary. Re. `box` expression removal, see rust-lang#162008 (comment) (TL;DR: it's been 3 years). cc @cyrgani <sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
…fee1-dead Render the `box` pattern removal diagnostic more actionable & remove `box` expression recovery Follow-up to rust-lang#156749. This way, users don't have to comb through (probably outdated) tracking issues trying to piece together how to fix their code (in the most idiomatic way). Lemme know if you think this is unnecessary. Re. `box` expression removal, see rust-lang#162008 (comment) (TL;DR: it's been 3 years). cc @cyrgani <sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
…fee1-dead Render the `box` pattern removal diagnostic more actionable & remove `box` expression recovery Follow-up to rust-lang#156749. This way, users don't have to comb through (probably outdated) tracking issues trying to piece together how to fix their code (in the most idiomatic way). Lemme know if you think this is unnecessary. Re. `box` expression removal, see rust-lang#162008 (comment) (TL;DR: it's been 3 years). cc @cyrgani <sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
…fee1-dead Render the `box` pattern removal diagnostic more actionable & remove `box` expression recovery Follow-up to rust-lang#156749. This way, users don't have to comb through (probably outdated) tracking issues trying to piece together how to fix their code (in the most idiomatic way). Lemme know if you think this is unnecessary. Re. `box` expression removal, see rust-lang#162008 (comment) (TL;DR: it's been 3 years). cc @cyrgani <sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
…fee1-dead Render the `box` pattern removal diagnostic more actionable & remove `box` expression recovery Follow-up to rust-lang#156749. This way, users don't have to comb through (probably outdated) tracking issues trying to piece together how to fix their code (in the most idiomatic way). Lemme know if you think this is unnecessary. Re. `box` expression removal, see rust-lang#162008 (comment) (TL;DR: it's been 3 years). cc @cyrgani <sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
…fee1-dead Render the `box` pattern removal diagnostic more actionable & remove `box` expression recovery Follow-up to rust-lang#156749. This way, users don't have to comb through (probably outdated) tracking issues trying to piece together how to fix their code (in the most idiomatic way). Lemme know if you think this is unnecessary. Re. `box` expression removal, see rust-lang#162008 (comment) (TL;DR: it's been 3 years). cc @cyrgani <sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
…fee1-dead Render the `box` pattern removal diagnostic more actionable & remove `box` expression recovery Follow-up to rust-lang#156749. This way, users don't have to comb through (probably outdated) tracking issues trying to piece together how to fix their code (in the most idiomatic way). Lemme know if you think this is unnecessary. Re. `box` expression removal, see rust-lang#162008 (comment) (TL;DR: it's been 3 years). cc @cyrgani <sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
…uwer Rollup of 23 pull requests Successful merges: - #162164 (Revert "Implement Debug for C-like enums with a concatenated string") - #160564 (volatile: allow accesses to non-AM memory to trap) - #161579 (suggest calling a fn item used as the iterator of a `for` loop) - #162044 (coverage: Resolve spans to file-coordinates in a separate step) - #162120 (Introduce `PerOwnerLoweringState`) - #162151 (Test itanium mangling of `f16` and `f128`) - #162162 (Don't special-case `!` in stability checks anymore) - #162181 (Remove wrong UnusedBraces lint for iterator loop in edition 2024 ) - #162187 (Rename `thir::ExprKind::Use` to `ValueExpr`) - #158401 (mgca: Don't ICE when evaluating ValTrees that contain error constants) - #159873 (fuchsia: Add safestack as a supported sanitizer for x86_64 fuchsia) - #161847 (Preserve visibility in nested macro import suggestions) - #161972 (Improve tests for `#[track_caller]` in async) - #162008 (Render the `box` pattern removal diagnostic more actionable & remove `box` expression recovery) - #162065 (std: don't reference `libc::O_NOFOLLOW` on VxWorks in `set_perm_nofollow`) - #162076 (docs(num): clarify conditions under which error occurs in `impl TryFrom<int> for int`) - #162152 (Revert "retrieve supported GCC targets from the sysroot") - #162153 (Prefer `LLVMGetVersion` for runtime info) - #162168 (fix ICE in project_goals/inherent) - #162171 (Explain LoongArch f16 NaN-boxing in inline asm) - #162173 (fix supposedly unreachable `bug!` being reachable) - #162191 (core: mark float `ClampBounds` methods as `#[inline]`) - #162199 (docs(time): clarify exact seconds for hour and minute)
…fee1-dead Render the `box` pattern removal diagnostic more actionable & remove `box` expression recovery Follow-up to rust-lang#156749. This way, users don't have to comb through (probably outdated) tracking issues trying to piece together how to fix their code (in the most idiomatic way). Lemme know if you think this is unnecessary. Re. `box` expression removal, see rust-lang#162008 (comment) (TL;DR: it's been 3 years). cc @cyrgani <sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
Rollup of 23 pull requests Successful merges: - #157808 (sanitizers: Implement support for the sanitize ignorelist) - #160564 (volatile: allow accesses to non-AM memory to trap) - #161579 (suggest calling a fn item used as the iterator of a `for` loop) - #162044 (coverage: Resolve spans to file-coordinates in a separate step) - #162120 (Introduce `PerOwnerLoweringState`) - #162151 (Test itanium mangling of `f16` and `f128`) - #162162 (Don't special-case `!` in stability checks anymore) - #162181 (Remove wrong UnusedBraces lint for iterator loop in edition 2024 ) - #162187 (Rename `thir::ExprKind::Use` to `ValueExpr`) - #158401 (mgca: Don't ICE when evaluating ValTrees that contain error constants) - #159873 (fuchsia: Add safestack as a supported sanitizer for x86_64 fuchsia) - #161847 (Preserve visibility in nested macro import suggestions) - #161972 (Improve tests for `#[track_caller]` in async) - #162008 (Render the `box` pattern removal diagnostic more actionable & remove `box` expression recovery) - #162065 (std: don't reference `libc::O_NOFOLLOW` on VxWorks in `set_perm_nofollow`) - #162076 (docs(num): clarify conditions under which error occurs in `impl TryFrom<int> for int`) - #162152 (Revert "retrieve supported GCC targets from the sysroot") - #162153 (Prefer `LLVMGetVersion` for runtime info) - #162168 (fix ICE in project_goals/inherent) - #162171 (Explain LoongArch f16 NaN-boxing in inline asm) - #162173 (fix supposedly unreachable `bug!` being reachable) - #162191 (core: mark float `ClampBounds` methods as `#[inline]`) - #162199 (docs(time): clarify exact seconds for hour and minute)
…fee1-dead Render the `box` pattern removal diagnostic more actionable & remove `box` expression recovery Follow-up to rust-lang#156749. This way, users don't have to comb through (probably outdated) tracking issues trying to piece together how to fix their code (in the most idiomatic way). Lemme know if you think this is unnecessary. Re. `box` expression removal, see rust-lang#162008 (comment) (TL;DR: it's been 3 years). cc @cyrgani <sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
Rollup of 29 pull requests Successful merges: - #161694 (add `Complex` ABI run-make test) - #162014 (Move more `rustdoc-html` tests using `--test` into the right folder) - #162164 (Revert "Implement Debug for C-like enums with a concatenated string") - #160564 (volatile: allow accesses to non-AM memory to trap) - #161579 (suggest calling a fn item used as the iterator of a `for` loop) - #162044 (coverage: Resolve spans to file-coordinates in a separate step) - #162120 (Introduce `PerOwnerLoweringState`) - #162132 (std: improve safety documentation in UNIX stack overflow code) - #162151 (Test itanium mangling of `f16` and `f128`) - #162162 (Don't special-case `!` in stability checks anymore) - #162181 (Remove wrong UnusedBraces lint for iterator loop in edition 2024 ) - #162187 (Rename `thir::ExprKind::Use` to `ValueExpr`) - #158401 (mgca: Don't ICE when evaluating ValTrees that contain error constants) - #159873 (fuchsia: Add safestack as a supported sanitizer for x86_64 fuchsia) - #161847 (Preserve visibility in nested macro import suggestions) - #161951 (Windows: add fallback if `canonicalize` fails) - #161972 (Improve tests for `#[track_caller]` in async) - #162008 (Render the `box` pattern removal diagnostic more actionable & remove `box` expression recovery) - #162065 (std: don't reference `libc::O_NOFOLLOW` on VxWorks in `set_perm_nofollow`) - #162076 (docs(num): clarify conditions under which error occurs in `impl TryFrom<int> for int`) - #162152 (Revert "retrieve supported GCC targets from the sysroot") - #162153 (Prefer `LLVMGetVersion` for runtime info) - #162168 (fix ICE in project_goals/inherent) - #162171 (Explain LoongArch f16 NaN-boxing in inline asm) - #162173 (fix supposedly unreachable `bug!` being reachable) - #162180 (remove outdated next-solver FIXMEs) - #162191 (core: mark float `ClampBounds` methods as `#[inline]`) - #162195 (docs(time): clarify exact seconds for week and day) - #162199 (docs(time): clarify exact seconds for hour and minute)
…fee1-dead Render the `box` pattern removal diagnostic more actionable & remove `box` expression recovery Follow-up to rust-lang#156749. This way, users don't have to comb through (probably outdated) tracking issues trying to piece together how to fix their code (in the most idiomatic way). Lemme know if you think this is unnecessary. Re. `box` expression removal, see rust-lang#162008 (comment) (TL;DR: it's been 3 years). cc @cyrgani <sub>(No LLM was or will be used by me during the entire creation process of this PR)</sub>
Follow-up to #156749. This way, users don't have to comb through (probably outdated) tracking issues trying to piece together how to fix their code (in the most idiomatic way). Lemme know if you think this is unnecessary.
Re.
boxexpression removal, see #162008 (comment) (TL;DR: it's been 3 years).cc @cyrgani
(No LLM was or will be used by me during the entire creation process of this PR)