-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC3239: Implement cfg(target)
- Part 2
#96913
Conversation
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 |
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. |
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 |
Yes, once this change reaches bootstrap compiler. |
No, no, during I see that right now errors like
Could you perhaps leave this purely diagnostic change to a separate PR? |
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 |
Looks much better now. |
The implementation is now strangely clean and simple. 😄 @rustbot ready |
@bors r+ |
📌 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