-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
rustc_target: Remove some redundant target properties #98214
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rustbot
added
the
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
label
Jun 17, 2022
(rust-highfive has picked a reviewer for you, use r? to override) |
|
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Jun 17, 2022
|
@bors r+ |
📌 Commit 37fd294 has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Jun 24, 2022
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Jun 24, 2022
rustc_target: Remove some redundant target properties `is_like_emscripten` is equivalent to `os == "emscripten"`, so it's removed. `is_like_fuchsia` is equivalent to `os == "fuchsia"`, so it's removed. `is_like_osx` also falls into the same category and is equivalent to `vendor == "apple"`, but it's commonly used so I kept it as is for now. `is_like_(solaris,windows,wasm)` are combinations of different operating systems or architectures (see compiler/rustc_target/src/spec/tests/tests_impl.rs) so they are also kept as is. I think `is_like_wasm` (and maybe `is_like_osx`) are sufficiently closed sets, so we can remove these fields as well and replace them with methods like `fn is_like_wasm() { arch == "wasm32" || arch == "wasm64" }`. On other hand, `is_like_solaris` and `is_like_windows` are sufficiently open and I can imagine custom targets introducing other values for `os`. This is kind of a gray area.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 24, 2022
Rollup of 9 pull requests Successful merges: - rust-lang#91264 (Add macro support in jump to definition feature) - rust-lang#96955 (Remove (transitive) reliance on sorting by DefId in pretty-printer) - rust-lang#97633 (Session object: Set OS/ABI) - rust-lang#98039 (Fix `panic` message for `BTreeSet`'s `range` API and document `panic` cases) - rust-lang#98214 (rustc_target: Remove some redundant target properties) - rust-lang#98280 (Improve suggestion for calling fn-like expr on type mismatch) - rust-lang#98394 (Fixup missing renames from `#[main]` to `#[rustc_main]`) - rust-lang#98411 (Update tendril) - rust-lang#98419 (Remove excess rib while resolving closures) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
is_like_emscripten
is equivalent toos == "emscripten"
, so it's removed.is_like_fuchsia
is equivalent toos == "fuchsia"
, so it's removed.is_like_osx
also falls into the same category and is equivalent tovendor == "apple"
, but it's commonly used so I kept it as is for now.is_like_(solaris,windows,wasm)
are combinations of different operating systems or architectures (see compiler/rustc_target/src/spec/tests/tests_impl.rs) so they are also kept as is.I think
is_like_wasm
(and maybeis_like_osx
) are sufficiently closed sets, so we can remove these fields as well and replace them with methods likefn is_like_wasm() { arch == "wasm32" || arch == "wasm64" }
.On other hand,
is_like_solaris
andis_like_windows
are sufficiently open and I can imagine custom targets introducing other values foros
.This is kind of a gray area.