Uh oh!
There was an error while loading. Please reload this page.
RFC3239: Implement cfg(target) - Part 2 - #96913
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
petrochenkov
commented
May 21, 2022
The implementation looks significantly overcomplicated due to all the multi-spans and supporting #96913 (comment). I suggest to get rid of all of that, lower |
petrochenkov
commented
May 21, 2022
This part is not outright harmful like #96909, but I'd still be interested to see it dogfood-ed on the rust-lang/rust codebase to see how much useful it is, because I'm not sure whether it actually pulls its weight. |
Urgau
commented
May 23, 2022
As requested I have removed #96913 (comment) but I kept the multi-spans because without them the lint from the check cfg are confusing as they would just show the last part.
Isn't this what is already done ? Or you mean doing this in the parser or somewhere else ?
I suppose this would be for another PR, not this one, right ? @rustbot ready |
petrochenkov
commented
May 23, 2022
Yes, once this change reaches bootstrap compiler. |
petrochenkov
commented
May 23, 2022
No, no, during I see that right now errors like
Could you perhaps leave this purely diagnostic change to a separate PR? |
Urgau
commented
May 24, 2022
Sure, done.
Done, but the way it's done feels like a hack to me which is why I've put it in the last commit. This approach would also completely remove the possibility of having multi-spans or simply better diagnostics. Anyway If you prefer this approach I will squash the commits. @rustbot ready |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
petrochenkov
commented
May 24, 2022
Looks much better now. |
Urgau
commented
May 24, 2022
The implementation is now strangely clean and simple. 😄 @rustbot ready |
petrochenkov
commented
May 24, 2022
@bors r+ |
bors
commented
May 24, 2022
📌 Commit b9ae3db has been approved by |
Rollup of 5 pull requests Successful merges: - rust-lang#95953 (Modify MIR building to drop repeat expressions with length zero) - rust-lang#96913 (RFC3239: Implement `cfg(target)` - Part 2) - rust-lang#97233 ([RFC 2011] Library code) - rust-lang#97370 (Minor improvement on else-no-if diagnostic) - rust-lang#97384 (Fix metadata stats.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This pull-request implements the compact
cfg(target(..))part of RFC 3239.I recommend reviewing this PR on a per commit basics, because of some moving parts.
cc @GuillaumeGomez
r? @petrochenkov