Remove unused features#152469
Conversation
|
Some changes occurred in exhaustiveness checking cc @Nadrieril Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead. cc @rust-lang/rust-analyzer The Miri subtree was changed cc @rust-lang/miri |
|
rustbot has assigned @jdonszelmann. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
Hi, thanks for your contribution! We should not remove these feature gates from tests. Features in tests sometimes test very subtle interactions and we don't want to break that. Also for tools and rustdoc we generally don't touch these directories unless strictly necessary; we're not running their whole test suite in CI so we could be removing a feature they actually use. I'm also of the opinion that replacing a feature with The rest looks good to me, that's some nice cleanups. |
|
@Nadrieril Make sense, I will keep the removal in compiler and replace the rest with just allowing |
aa64776 to
b391897
Compare
This comment has been minimized.
This comment has been minimized.
b391897 to
2833eea
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
2833eea to
41b83c2
Compare
|
Wait, is the plan to enable This should at least not be enabled in tests, just like we pass |
I think the plan is warn-by-default, at least for me
|
41b83c2 to
73c42c1
Compare
|
Considering that |
| use crate::sys::cmath; | ||
|
|
||
| #[cfg(not(test))] | ||
| #[doc(test(attr(allow(unused_features))))] |
There was a problem hiding this comment.
What's that syntax? I've not seen this attribute before
There was a problem hiding this comment.
See https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html#pre-processing-examples, and after #140560, we can use it everywhere.
|
@bors r=nadriril,jdonszelmann |
|
@bors r=nadrieril,jdonszelmann |
…atures, r=nadrieril,jdonszelmann Remove unused features Detected by rust-lang#152164. ~~Only allow `unused_features` if there are complex platform-specific features enabled.~~
…atures, r=nadrieril,jdonszelmann Remove unused features Detected by rust-lang#152164. ~~Only allow `unused_features` if there are complex platform-specific features enabled.~~
…atures, r=nadrieril,jdonszelmann Remove unused features Detected by rust-lang#152164. ~~Only allow `unused_features` if there are complex platform-specific features enabled.~~
…uwer Rollup of 14 pull requests Successful merges: - #152323 (Fix ICE in borrowck when recovering `fn_sig` for `-> _`) - #152469 (Remove unused features) - #152515 (Extract `DepKindVTable` constructors to their own module) - #152555 (Port `#[rustc_diagnostic_item]` to the new attribute parsers) - #152218 (Report unconstrained region in hidden types lazily) - #152356 (Improve the `inline_fluent!` macro) - #152392 (Fix ICE in supertrait_vtable_slot when supertrait has missing generics) - #152407 (Add regression test for type_const with unit struct ctor under mGCA) - #152440 (Fix typos and grammar in compiler and build documentation) - #152536 (bootstrap: add explicit UTF-8 encoding to text-mode open() calls) - #152554 (Remove `deprecated_safe` and its corresponding feature gate) - #152556 (doc: move riscv64a23-unknown-linux-gnu to tier 2) - #152563 (Replace "bug" with "issue" in triagebot ping messages) - #152565 (fix missleading error for tuple ctor) Failed merges: - #152512 (core: Implement feature `float_exact_integer_constants`) - #152296 (Port `rust_nonnull_optimization_guaranteed` and `rustc_do_not_const_check` to the new attribute parser)
…uwer Rollup of 14 pull requests Successful merges: - #152323 (Fix ICE in borrowck when recovering `fn_sig` for `-> _`) - #152469 (Remove unused features) - #152515 (Extract `DepKindVTable` constructors to their own module) - #152555 (Port `#[rustc_diagnostic_item]` to the new attribute parsers) - #152218 (Report unconstrained region in hidden types lazily) - #152356 (Improve the `inline_fluent!` macro) - #152392 (Fix ICE in supertrait_vtable_slot when supertrait has missing generics) - #152407 (Add regression test for type_const with unit struct ctor under mGCA) - #152440 (Fix typos and grammar in compiler and build documentation) - #152536 (bootstrap: add explicit UTF-8 encoding to text-mode open() calls) - #152554 (Remove `deprecated_safe` and its corresponding feature gate) - #152556 (doc: move riscv64a23-unknown-linux-gnu to tier 2) - #152563 (Replace "bug" with "issue" in triagebot ping messages) - #152565 (fix missleading error for tuple ctor) Failed merges: - #152512 (core: Implement feature `float_exact_integer_constants`) - #152296 (Port `rust_nonnull_optimization_guaranteed` and `rustc_do_not_const_check` to the new attribute parser)
…atures, r=nadrieril,jdonszelmann Remove unused features Detected by rust-lang#152164. ~~Only allow `unused_features` if there are complex platform-specific features enabled.~~
| #![feature(cfg_emscripten_wasm_eh)] | ||
| #![feature(cfg_select)] | ||
| #![feature(core_intrinsics)] | ||
| #![feature(lang_items)] |
There was a problem hiding this comment.
Emscripten needs this feature.
rust/library/panic_unwind/src/emcc.rs
Line 40 in 1ed4882
error[E0658]: lang items are subject to change
--> /rustc/1ed488274bec5bf5cfe6bf7a1cc089abcc4ebd68/library/panic_unwind/src/emcc.rs:40:1
|
40 | #[lang = "eh_catch_typeinfo"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(lang_items)]` to the crate attributes to enable
= note: this compiler was built on 2026-02-25; consider upgrading it if it is out of date
For more information about this error, try `rustc --explain E0658`.
error: could not compile `panic_unwind` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...There was a problem hiding this comment.
Oops, I will recover this for emscripten
There was a problem hiding this comment.
No worries, it's only needed when compiling with RUSTFLAGS="-Zemscripten-wasm-eh=false", which will be removed in the future.
…oboet Recover feature lang_items for emscripten Fixes rust-lang#152469 (comment)
…oboet Recover feature lang_items for emscripten Fixes rust-lang#152469 (comment)
…oboet Recover feature lang_items for emscripten Fixes rust-lang#152469 (comment)
…oboet Recover feature lang_items for emscripten Fixes rust-lang#152469 (comment)
…oboet Recover feature lang_items for emscripten Fixes rust-lang#152469 (comment)
Rollup merge of #153128 - mu001999-contrib:fix/features, r=joboet Recover feature lang_items for emscripten Fixes #152469 (comment)
…oboet Recover feature lang_items for emscripten Fixes rust-lang#152469 (comment) The previous rust-lang#153128 lacks of `feature`
Rollup merge of #153255 - mu001999-contrib:fix/features, r=joboet Recover feature lang_items for emscripten Fixes #152469 (comment) The previous #153128 lacks of `feature`
Detected by #152164.
Only allowunused_featuresif there are complex platform-specific features enabled.