Skip to content

Remove useless conditional compilation #1308

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jun 9, 2022
Merged

Conversation

Urgau
Copy link
Member

@Urgau Urgau commented Jun 9, 2022

Context: rustc added a few month ago --check-cfg support and enable it in the rust-lang/rust repo for every build.

I found out that stdarch had condition that were triggering the unstable unexpected_cfgs lint:

  • stdarch_intel_sde: Internal to stdarch, status unknown, never set as far as I can tell. bootstrap exception
  • dont_compile_me: Used on the _rbit_u32 test for armv7, with an outdated comment. bootstrap exception
  • core_arch_docs: Set in dox.sh and in the build.rs of core_arch, but never used in the codebase. no exception because never used

This PR removes every cfg usage of dont_compile_me and core_arch_docs because they are useless. I tested the modifications and nothing failed on my side, so I think it's good to go.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Amanieu (or someone else) soon.

Please see the contribution instructions for more information.

@Urgau
Copy link
Member Author

Urgau commented Jun 9, 2022

I would also like to remove stdarch_intel_sde. As far as I can tell it's only used with negative (#[cfg(not(stdarch_intel_sde))]) cfg and is never set by anything. Should I update the PR and also include it's removal ?

@Amanieu
Copy link
Member

Amanieu commented Jun 9, 2022

stdarch_intel_sde is set in .github/workflows/main.yml when running x86 tests under Intel's x86 emulator. This is used to test features that may not be available on the CPU used in CI.

@Amanieu
Copy link
Member

Amanieu commented Jun 9, 2022

The rest look fine to me.

@Amanieu Amanieu merged commit 6299dd0 into rust-lang:master Jun 9, 2022
Urgau added a commit to Urgau/rust that referenced this pull request Jan 19, 2023
 - `target_os=watchos`: no longer relevant because there are now proper
   targets `*-apple-watchos`
 - `target_arch=nvptx64`: `nvptx64-nvidia-cuda`
 - `target_arch=le32`: target was removed
   (rust-lang#45041)
 - `dont_compile_me`: was removed from stdarch
   (rust-lang/stdarch#1308)

Also made some external cfg exception mode clear and only activated for
rustc and rustc tools (as to not have the Standard Library
unintentionally depend on them).
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Jan 22, 2023
…k-cfgs, r=Mark-Simulacrum

bootstrap: cleanup the list of extra check cfgs

This PR performs some cleanups on the `EXTRA_CHECK_CFGS` list in bootstrap.

- `target_os=watchos`: no longer relevant because there are now proper targets `*-apple-watchos`
 - `target_arch=nvptx64`: target `nvptx64-nvidia-cuda` makes it useless
 - `target_arch=le32`: target was removed (rust-lang#45041)
 - ~~`release`: was removed from rustfmt (rust-lang/rustfmt#5375 and rust-lang/rustfmt#5449 (despite the changes being done more than 6 months ago there hasn't been any rustfmt subtree sync)
 - `dont_compile_me`: was removed from stdarch (rust-lang/stdarch#1308)

Also made some external cfg exception mode clear and only activated for rustc and rustc tools (as to not have the Standard Library unintentionally depend on them).
Urgau added a commit to Urgau/rust that referenced this pull request Jan 25, 2023
 - `target_os=watchos`: no longer relevant because there are now proper
   targets `*-apple-watchos`
 - `target_arch=nvptx64`: `nvptx64-nvidia-cuda`
 - `target_arch=le32`: target was removed
   (rust-lang#45041)
 - `release`: was removed from rustfmt
   (rust-lang/rustfmt#5375 and
   rust-lang/rustfmt#5449)
 - `dont_compile_me`: was removed from stdarch
   (rust-lang/stdarch#1308)

Also made some external cfg exception mode clear and only activated for
rustc and rustc tools (as to not have the Standard Library
unintentionally depend on them).
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Jan 29, 2023
…k-cfgs, r=Mark-Simulacrum

bootstrap: cleanup the list of extra check cfgs

This PR performs some cleanups on the `EXTRA_CHECK_CFGS` list in bootstrap.

- `target_os=watchos`: no longer relevant because there are now proper targets `*-apple-watchos`
 - `target_arch=nvptx64`: target `nvptx64-nvidia-cuda` makes it useless
 - `target_arch=le32`: target was removed (rust-lang#45041)
 - `release`: was removed from rustfmt (rust-lang/rustfmt#5375 and rust-lang/rustfmt#5449)
 - `dont_compile_me`: was removed from stdarch (rust-lang/stdarch#1308)

Also made some external cfg exception mode clear and only activated for rustc and rustc tools (as to not have the Standard Library unintentionally depend on them).
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 30, 2023
…cfgs, r=Mark-Simulacrum

bootstrap: cleanup the list of extra check cfgs

This PR performs some cleanups on the `EXTRA_CHECK_CFGS` list in bootstrap.

- `target_os=watchos`: no longer relevant because there are now proper targets `*-apple-watchos`
 - `target_arch=nvptx64`: target `nvptx64-nvidia-cuda` makes it useless
 - `target_arch=le32`: target was removed (rust-lang#45041)
 - `release`: was removed from rustfmt (rust-lang/rustfmt#5375 and rust-lang/rustfmt#5449)
 - `dont_compile_me`: was removed from stdarch (rust-lang/stdarch#1308)

Also made some external cfg exception mode clear and only activated for rustc and rustc tools (as to not have the Standard Library unintentionally depend on them).
bors added a commit to rust-lang/miri that referenced this pull request Jan 31, 2023
…ark-Simulacrum

bootstrap: cleanup the list of extra check cfgs

This PR performs some cleanups on the `EXTRA_CHECK_CFGS` list in bootstrap.

- `target_os=watchos`: no longer relevant because there are now proper targets `*-apple-watchos`
 - `target_arch=nvptx64`: target `nvptx64-nvidia-cuda` makes it useless
 - `target_arch=le32`: target was removed (rust-lang/rust#45041)
 - `release`: was removed from rustfmt (rust-lang/rustfmt#5375 and rust-lang/rustfmt#5449)
 - `dont_compile_me`: was removed from stdarch (rust-lang/stdarch#1308)

Also made some external cfg exception mode clear and only activated for rustc and rustc tools (as to not have the Standard Library unintentionally depend on them).
thomcc pushed a commit to tcdi/postgrestd that referenced this pull request May 31, 2023
…ark-Simulacrum

bootstrap: cleanup the list of extra check cfgs

This PR performs some cleanups on the `EXTRA_CHECK_CFGS` list in bootstrap.

- `target_os=watchos`: no longer relevant because there are now proper targets `*-apple-watchos`
 - `target_arch=nvptx64`: target `nvptx64-nvidia-cuda` makes it useless
 - `target_arch=le32`: target was removed (rust-lang/rust#45041)
 - `release`: was removed from rustfmt (rust-lang/rustfmt#5375 and rust-lang/rustfmt#5449)
 - `dont_compile_me`: was removed from stdarch (rust-lang/stdarch#1308)

Also made some external cfg exception mode clear and only activated for rustc and rustc tools (as to not have the Standard Library unintentionally depend on them).
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants