Skip to content
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

Add future-incompat warning against keywords in cfgs and add raw-idents #14671

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Urgau
Copy link
Member

@Urgau Urgau commented Oct 11, 2024

What does this PR try to resolve?

This PR tries to address this thread #14649 (comment) in #14649 regarding cfg(true)/cfg(false) (and keywords more generally) which are wrongly accepted1 as ident.

To address this, this PR does two things:

  1. it introduce a future-incompatibility warning against those (wrongly) accepted keywords as ident
  2. it add parsing for raw-idents (r#true) add suggest-it in the warning

How should we test and review this PR?

This PR should be reviewed commit-by-commit.
Tests are included in preliminary commits.

Additional information

I added a new struct for representing Idents which is rawness aware.
Which implied updating cargo-platform to 0.2.0 due to the API changes.

r? @epage

Footnotes

  1. https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=ccfb9c894dbf14e791c8ae7e4798efd0

@rustbot rustbot added A-build-scripts Area: build.rs scripts A-cfg-expr Area: Platform cfg expressions A-manifest Area: Cargo.toml issues S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 11, 2024
@Urgau Urgau force-pushed the cfg-keyword-and-raw-idents branch 2 times, most recently from 89428c0 to a02fbf2 Compare October 11, 2024 12:04
@Urgau Urgau force-pushed the cfg-keyword-and-raw-idents branch 2 times, most recently from 0087199 to aa8bb59 Compare October 11, 2024 13:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-scripts Area: build.rs scripts A-cfg-expr Area: Platform cfg expressions A-manifest Area: Cargo.toml issues S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants