-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Conversation
aa8bb59
to
0569db6
Compare
0569db6
to
7b3512f
Compare
7b3512f
to
dd334dd
Compare
@rfcbot fcp merge This PR adds a future-incompat warning for the use of The main focus of this FCP is insta-stabilizing support for raw identifiers (e.g. |
Team member @epage has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
I'm not quite sure I understand the wording of the error message. Saying Would it be possible to change the wording to be something more like:
|
dd334dd
to
ff762d8
Compare
Yes, Changed the wording as suggest. |
0121d31
to
363c9b7
Compare
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Urgau !
363c9b7
to
e2028d4
Compare
Hmm… build-std seems to clobber each others after #14850. Let me check how to fix it. |
Got a PR up: #14861 |
Re-queuing as #14861 has been merged. |
Update cargo 8 commits in 4c39aaff66862cc0da52fe529aa1990bb8bb9a22..3908f64086a3d7b9af8d87b4da2bd100776c3e61 2024-11-25 16:36:17 +0000 to 2024-11-29 17:32:44 +0000 - chore(deps): update msrv (rust-lang/cargo#14867) - fix(fix): Migrate cargo script manifests across editions (rust-lang/cargo#14864) - feat(toml): Allow adding/removing from cargo scripts (rust-lang/cargo#14857) - Add future-incompat warning against keywords in cfgs and add raw-idents (rust-lang/cargo#14671) - test(build-std): download deps first (rust-lang/cargo#14861) - test(pgo): ensure PGO works (rust-lang/cargo#14859) - git-fetch-with-cli: Set `GIT_DIR` for bare repository compatibility (rust-lang/cargo#14860) - fix(build-std): always link to std when testing proc-macros (rust-lang/cargo#14850)
Update cargo 17 commits in 4c39aaff66862cc0da52fe529aa1990bb8bb9a22..05f54fdc34310f458033af8a63ce1d699fae8bf6 2024-11-25 16:36:17 +0000 to 2024-12-03 03:14:12 +0000 - test(pgo): only run on nightly (rust-lang/cargo#14887) - chore: Bump to 0.86.0; update changelog (rust-lang/cargo#14885) - docs(ref): Finish a sentence on rust-versions (rust-lang/cargo#14884) - chore(deps): update rust crate cargo_metadata to 0.19.0 (rust-lang/cargo#14878) - chore(deps): update rust crate gix to 0.68.0 (rust-lang/cargo#14879) - fix: Remove default registry reference in `info` cmd docs (rust-lang/cargo#14880) - test(pgo): determine test runnability at compile time (rust-lang/cargo#14874) - test: `requires` attribute accepts string literals for cmds (rust-lang/cargo#14875) - chore(deps): update msrv (3 versions) to v1.81 (rust-lang/cargo#14871) - chore(deps): update msrv (rust-lang/cargo#14867) - fix(fix): Migrate cargo script manifests across editions (rust-lang/cargo#14864) - feat(toml): Allow adding/removing from cargo scripts (rust-lang/cargo#14857) - Add future-incompat warning against keywords in cfgs and add raw-idents (rust-lang/cargo#14671) - test(build-std): download deps first (rust-lang/cargo#14861) - test(pgo): ensure PGO works (rust-lang/cargo#14859) - git-fetch-with-cli: Set `GIT_DIR` for bare repository compatibility (rust-lang/cargo#14860) - fix(build-std): always link to std when testing proc-macros (rust-lang/cargo#14850)
Update cargo 17 commits in 4c39aaff66862cc0da52fe529aa1990bb8bb9a22..05f54fdc34310f458033af8a63ce1d699fae8bf6 2024-11-25 16:36:17 +0000 to 2024-12-03 03:14:12 +0000 - test(pgo): only run on nightly (rust-lang/cargo#14887) - chore: Bump to 0.86.0; update changelog (rust-lang/cargo#14885) - docs(ref): Finish a sentence on rust-versions (rust-lang/cargo#14884) - chore(deps): update rust crate cargo_metadata to 0.19.0 (rust-lang/cargo#14878) - chore(deps): update rust crate gix to 0.68.0 (rust-lang/cargo#14879) - fix: Remove default registry reference in `info` cmd docs (rust-lang/cargo#14880) - test(pgo): determine test runnability at compile time (rust-lang/cargo#14874) - test: `requires` attribute accepts string literals for cmds (rust-lang/cargo#14875) - chore(deps): update msrv (3 versions) to v1.81 (rust-lang/cargo#14871) - chore(deps): update msrv (rust-lang/cargo#14867) - fix(fix): Migrate cargo script manifests across editions (rust-lang/cargo#14864) - feat(toml): Allow adding/removing from cargo scripts (rust-lang/cargo#14857) - Add future-incompat warning against keywords in cfgs and add raw-idents (rust-lang/cargo#14671) - test(build-std): download deps first (rust-lang/cargo#14861) - test(pgo): ensure PGO works (rust-lang/cargo#14859) - git-fetch-with-cli: Set `GIT_DIR` for bare repository compatibility (rust-lang/cargo#14860) - fix(build-std): always link to std when testing proc-macros (rust-lang/cargo#14850)
Pkgsrc changes relative to rust184: * patch reorganization to deal with new version of upstream vendored crates, checksum updates. Version 1.85.0 (2025-02-20) ========================== Language -------- - [The 2024 Edition is now stable.] (rust-lang/rust#133349) See [the edition guide] (https://doc.rust-lang.org/nightly/edition-guide/rust-2024/index.html) for more details. - [Stabilize async closures] (rust-lang/rust#132706) See [RFC 3668] (https://rust-lang.github.io/rfcs/3668-async-closures.html) for more details. - [Stabilize `#[diagnostic::do_not_recommend]`] (rust-lang/rust#132056) - [Add `unpredictable_function_pointer_comparisons` lint to warn against function pointer comparisons] (rust-lang/rust#118833) - [Lint on combining `#[no_mangle]` and `#[export_name]` attributes.] (rust-lang/rust#131558) Compiler -------- - [The unstable flag `-Zpolymorphize` has been removed] (rust-lang/rust#133883), see rust-lang/compiler-team#810 for some background. Platform Support ---------------- - [Promote `powerpc64le-unknown-linux-musl` to tier 2 with host tools] (rust-lang/rust#133801) Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support. Libraries --------- - [Panics in the standard library now have a leading `library/` in their path] (rust-lang/rust#132390) - [`std::env::home_dir()` on Windows now ignores the non-standard `$HOME` environment variable] (rust-lang/rust#132515) It will be un-deprecated in a subsequent release. - [Add `AsyncFn*` to the prelude in all editions.] (rust-lang/rust#132611) Stabilized APIs --------------- - [`BuildHasherDefault::new`] (https://doc.rust-lang.org/stable/std/hash/struct.BuildHasherDefault.html#method.new) - [`ptr::fn_addr_eq`] (https://doc.rust-lang.org/std/ptr/fn.fn_addr_eq.html) - [`io::ErrorKind::QuotaExceeded`] (https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.QuotaExceeded) - [`io::ErrorKind::CrossesDevices`] (https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.CrossesDevices) - [`{float}::midpoint`] (https://doc.rust-lang.org/core/primitive.f32.html#method.midpoint) - [Unsigned `{integer}::midpoint`] (https://doc.rust-lang.org/std/primitive.u64.html#method.midpoint) - [`NonZeroU*::midpoint`] (https://doc.rust-lang.org/std/num/type.NonZeroU32.html#method.midpoint) - [impl `std::iter::Extend` for tuples with arity 1 through 12] (https://doc.rust-lang.org/stable/std/iter/trait.Extend.html#impl-Extend%3C(A,)%3E-for-(EA,)) - [`FromIterator<(A, ...)>` for tuples with arity 1 through 12] (https://doc.rust-lang.org/stable/std/iter/trait.FromIterator.html#impl-FromIterator%3C(EA,)%3E-for-(A,)) - [`std::task::Waker::noop`] (https://doc.rust-lang.org/stable/std/task/struct.Waker.html#method.noop) These APIs are now stable in const contexts: - [`mem::size_of_val`] (https://doc.rust-lang.org/stable/std/mem/fn.size_of_val.html) - [`mem::align_of_val`] (https://doc.rust-lang.org/stable/std/mem/fn.align_of_val.html) - [`Layout::for_value`] (https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.for_value) - [`Layout::align_to`] (https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.align_to) - [`Layout::pad_to_align`] (https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.pad_to_align) - [`Layout::extend`] (https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.extend) - [`Layout::array`] (https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.array) - [`std::mem::swap`] (https://doc.rust-lang.org/stable/std/mem/fn.swap.html) - [`std::ptr::swap`] (https://doc.rust-lang.org/stable/std/ptr/fn.swap.html) - [`NonNull::new`] (https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.new) - [`HashMap::with_hasher`] (https://doc.rust-lang.org/stable/std/collections/struct.HashMap.html#method.with_hasher) - [`HashSet::with_hasher`] (https://doc.rust-lang.org/stable/std/collections/struct.HashSet.html#method.with_hasher) - [`BuildHasherDefault::new`] (https://doc.rust-lang.org/stable/std/hash/struct.BuildHasherDefault.html#method.new) - [`<float>::recip`] (https://doc.rust-lang.org/stable/std/primitive.f32.html#method.recip) - [`<float>::to_degrees`] (https://doc.rust-lang.org/stable/std/primitive.f32.html#method.to_degrees) - [`<float>::to_radians`] (https://doc.rust-lang.org/stable/std/primitive.f32.html#method.to_radians) - [`<float>::max`] (https://doc.rust-lang.org/stable/std/primitive.f32.html#method.max) - [`<float>::min`] (https://doc.rust-lang.org/stable/std/primitive.f32.html#method.min) - [`<float>::clamp`] (https://doc.rust-lang.org/stable/std/primitive.f32.html#method.clamp) - [`<float>::abs`] (https://doc.rust-lang.org/stable/std/primitive.f32.html#method.abs) - [`<float>::signum`] (https://doc.rust-lang.org/stable/std/primitive.f32.html#method.signum) - [`<float>::copysign`] (https://doc.rust-lang.org/stable/std/primitive.f32.html#method.copysign) - [`MaybeUninit::write`] (https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#method.write) Cargo ----- - [Add future-incompatibility warning against keywords in cfgs and add raw-idents] (rust-lang/cargo#14671) - [Stabilize higher precedence trailing flags] (rust-lang/cargo#14900) - [Pass `CARGO_CFG_FEATURE` to build scripts] (rust-lang/cargo#14902) Rustdoc ----- - [Doc comment on impl blocks shows the first line, even when the impl block is collapsed] (rust-lang/rust#132155) Compatibility Notes ------------------- - [`rustc` no longer treats the `test` cfg as a well known check-cfg] (rust-lang/rust#131729), instead it is up to the build systems and users of `--check-cfg`[^check-cfg] to set it as a well known cfg using `--check-cfg=cfg(test)`. This is done to enable build systems like Cargo to set it conditionally, as not all source files are suitable for unit tests. [Cargo (for now) unconditionally sets the `test` cfg as a well known cfg] (rust-lang/cargo#14963). [^check-cfg]: https://doc.rust-lang.org/nightly/rustc/check-cfg.html - [Disable potentially incorrect type inference if there are trivial and non-trivial where-clauses] (rust-lang/rust#132325) - `std::env::home_dir()` has been deprecated for years, because it can give surprising results in some Windows configurations if the `HOME` environment variable is set (which is not the normal configuration on Windows). We had previously avoided changing its behavior, out of concern for compatibility with code depending on this non-standard configuration. Given how long this function has been deprecated, we're now fixing its behavior as a bugfix. A subsequent release will remove the deprecation for this function. - [Make `core::ffi::c_char` signedness more closely match that of the platform-default `char`] (rust-lang/rust#132975) This changed `c_char` from an `i8` to `u8` or vice versa on many Tier 2 and 3 targets (mostly Arm and RISC-V embedded targets). The new definition may result in compilation failures but fixes compatibility issues with C. The `libc` crate matches this change as of its 0.2.169 release. - [When compiling a nested `macro_rules` macro from an external crate, the content of the inner `macro_rules` is now built with the edition of the external crate, not the local crate.] (rust-lang/rust#133274) - [Increase `sparcv9-sun-solaris` and `x86_64-pc-solaris` Solaris baseline to 11.4.] (rust-lang/rust#133293) - [Show `abi_unsupported_vector_types` lint in future breakage reports] (rust-lang/rust#133374) - [Error if multiple super-trait instantiations of `dyn Trait` need associated types to be specified but only one is provided] (rust-lang/rust#133392) - [Change `powerpc64-ibm-aix` default `codemodel` to large] (rust-lang/rust#133811) Internal Changes ---------------- These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools. - [Build `x86_64-unknown-linux-gnu` with LTO for C/C++ code (e.g., `jemalloc`)] (rust-lang/rust#134690)
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:
r#true
) add suggest-it in the warningHow 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
Ident
s which is rawness aware.Which implied updating
cargo-platform
to0.2.0
due to the API changes.r? @epage
Footnotes
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=ccfb9c894dbf14e791c8ae7e4798efd0 ↩