Render the box pattern removal diagnostic more actionable & fully remove box expression recovery - #162008
Render the box pattern removal diagnostic more actionable & fully remove box expression recovery#162008fmease wants to merge 2 commits into
box pattern removal diagnostic more actionable & fully 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.
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)