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

Cleanup rustc_features some more #116550

Merged
merged 2 commits into from
Oct 16, 2023
Merged

Conversation

nnethercote
Copy link
Contributor

The sequel to #116437.

r? @Nilstrieb

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 9, 2023
@rustbot
Copy link
Collaborator

rustbot commented Oct 9, 2023

These commits modify compiler targets.
(See the Target Tier Policy.)

@bors
Copy link
Contributor

bors commented Oct 14, 2023

☔ The latest upstream changes (presumably #116407) made this pull request unmergeable. Please resolve the merge conflicts.

@Noratrieb Noratrieb added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 15, 2023
`State` is used to distinguish active vs accepted vs removed features.
However, these can also be distinguished by their location, in
`ACTIVE_FEATURES`, `ACCEPTED_FEATURES`, and `REMOVED_FEATURES`.

So this commit removes `State` and moves the internals of its variants
next to the `Feature` in each element of `*_FEATURES`, introducing new
types `ActiveFeature` and `RemovedFeature`. (There is no need for
`AcceptedFeature` because `State::Accepted` had no fields.)

This is a tighter type representation, avoids the need for some runtime
checks, and makes the code a bit shorter.
It's a better name, and lets "active features" refer to the features
that are active in a particular program, due to being declared or
enabled by the edition.

The commit also renames `Features::enabled` as `Features::active` to
match this; I changed my mind and have decided that "active" is a little
better thatn "enabled" for this, particularly because a number of
pre-existing comments use "active" in this way.

Finally, the commit renames `Status::Stable` as `Status::Accepted`, to
match `ACCEPTED_FEATURES`.
@nnethercote
Copy link
Contributor Author

I have updated to remove the commit with the comment change.

@Noratrieb
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Oct 16, 2023

📌 Commit d284c8a has been approved by Nilstrieb

It is now in the queue for this repository.

@bors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 16, 2023
@bors
Copy link
Contributor

bors commented Oct 16, 2023

⌛ Testing commit d284c8a with merge 7d060b8...

bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 16, 2023
…ilstrieb

Cleanup `rustc_features` some more

The sequel to rust-lang#116437.

r? `@Nilstrieb`
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-msvc-ext failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
tests\ui-toml\undocumented_unsafe_blocks\undocumented_unsafe_blocks.rs (default) ... ok
tests\ui-toml\undocumented_unsafe_blocks\undocumented_unsafe_blocks.rs (disabled) ... ok

tests\ui-toml\doc_valid_idents_append\doc_markdown.rs FAILED:
command: "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\x86_64-pc-windows-msvc\\release\\clippy-driver.exe" "--error-format=json" "--emit=metadata" "-Aunused" "-Ainternal_features" "-Zui-testing" "-Dwarnings" "-Ldependency=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\x86_64-pc-windows-msvc\\release\\deps" "--extern=clippy_lints=\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\x86_64-pc-windows-msvc\\release\\deps\\libclippy_lints-5e8d785e054edb28.rlib" "--extern=clippy_utils=\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\x86_64-pc-windows-msvc\\release\\deps\\libclippy_utils-0cf228b0c1780fd5.rlib" "--extern=futures=\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\x86_64-pc-windows-msvc\\release\\deps\\libfutures-a074388a1bf2e009.rlib" "--extern=if_chain=\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\x86_64-pc-windows-msvc\\release\\deps\\libif_chain-ba0253edeba7a8f0.rlib" "--extern=itertools=\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\x86_64-pc-windows-msvc\\release\\deps\\libitertools-6894b4f3e8c5523f.rlib" "--extern=parking_lot=\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\x86_64-pc-windows-msvc\\release\\deps\\libparking_lot-f87e1900e520ff9b.rlib" "--extern=quote=\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\x86_64-pc-windows-msvc\\release\\deps\\libquote-3ebce4a1d5d43cf1.rlib" "--extern=regex=\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\x86_64-pc-windows-msvc\\release\\deps\\libregex-3e46ad2dfdd0c657.rlib" "--extern=serde=\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\x86_64-pc-windows-msvc\\release\\deps\\libserde-12500b7f802b2beb.rlib" "--extern=serde_derive=\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\release\\deps\\serde_derive-67ed154847593e2b.dll" "--extern=syn=\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\x86_64-pc-windows-msvc\\release\\deps\\libsyn-bc3ce53f417d339c.rlib" "--extern=tokio=\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\x86_64-pc-windows-msvc\\release\\deps\\libtokio-159ee9fbda356223.rlib" "-Ldependency=C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\release\\deps" "--out-dir" "\\\\?\\C:\\a\\rust\\rust\\build\\x86_64-pc-windows-msvc\\stage2-tools\\ui_test" "tests\\ui-toml\\doc_valid_idents_append\\doc_markdown.fixed" "--edition" "2021" "--crate-name" "doc_markdown"
rustfix failed with exit code: 1
thread 'main' panicked at src\tools\clippy\tests\compile-test.rs:247:6:
called `Result::unwrap()` on an `Err` value: tests failed


Location:
    C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ui_test-0.20.0\src\lib.rs:362:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

full stderr:
error: failed to write \\?\C:\a\rust\rust\build\x86_64-pc-windows-msvc\stage2-tools\ui_test\libdoc_markdown.rmeta: Access is denied. (os error 5)
error: aborting due to previous error


full stdout:

@bors
Copy link
Contributor

bors commented Oct 16, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 16, 2023
@Noratrieb
Copy link
Member

why do you need to make your access issues everyone's problem, rustfix
@bors retry

@bors 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 Oct 16, 2023
@bors
Copy link
Contributor

bors commented Oct 16, 2023

⌛ Testing commit d284c8a with merge 98c1e3d...

@bors
Copy link
Contributor

bors commented Oct 16, 2023

☀️ Test successful - checks-actions
Approved by: Nilstrieb
Pushing 98c1e3d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 16, 2023
@bors bors merged commit 98c1e3d into rust-lang:master Oct 16, 2023
12 checks passed
@rustbot rustbot added this to the 1.75.0 milestone Oct 16, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (98c1e3d): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.0% [-3.0%, -3.0%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 625.899s -> 626.363s (0.07%)
Artifact size: 305.58 MiB -> 305.53 MiB (-0.02%)

@nnethercote nnethercote deleted the rustc-features-more branch October 16, 2023 22:05
bors-ferrocene bot added a commit to ferrocene/ferrocene that referenced this pull request Oct 17, 2023
54: Pull upstream master 2023 10 17 r=pietroalbini a=Veykril

* rust-lang/rust#116196
* rust-lang/rust#116824
* rust-lang/rust#116822
* rust-lang/rust#116477
* rust-lang/rust#116826
* rust-lang/rust#116820
  * rust-lang/rust#116811
  * rust-lang/rust#116808
  * rust-lang/rust#116805
  * rust-lang/rust#116800
  * rust-lang/rust#116798
  * rust-lang/rust#116754
* rust-lang/rust#114370
* rust-lang/rust#116804
  * rust-lang/rust#116802
  * rust-lang/rust#116790
  * rust-lang/rust#116786
  * rust-lang/rust#116709
  * rust-lang/rust#116430
  * rust-lang/rust#116257
  * rust-lang/rust#114157
* rust-lang/rust#116731
* rust-lang/rust#116550
* rust-lang/rust#114330
* rust-lang/rust#116724
* rust-lang/rust#116782
  * rust-lang/rust#116776
  * rust-lang/rust#115955
  * rust-lang/rust#115196
* rust-lang/rust#116775
* rust-lang/rust#114589
* rust-lang/rust#113747
* rust-lang/rust#116772
  * rust-lang/rust#116771
  * rust-lang/rust#116760
  * rust-lang/rust#116755
  * rust-lang/rust#116732
  * rust-lang/rust#116522
  * rust-lang/rust#116341
  * rust-lang/rust#116172
* rust-lang/rust#110604
* rust-lang/rust#110729
* rust-lang/rust#116527
* rust-lang/rust#116688
* rust-lang/rust#116757
  * rust-lang/rust#116753
  * rust-lang/rust#116748
  * rust-lang/rust#116741
  * rust-lang/rust#116594
* rust-lang/rust#116691
* rust-lang/rust#116643
* rust-lang/rust#116683
* rust-lang/rust#116635
* rust-lang/rust#115515
* rust-lang/rust#116742
  * rust-lang/rust#116661
  * rust-lang/rust#116576
  * rust-lang/rust#116540
* rust-lang/rust#116352
* rust-lang/rust#116737
  * rust-lang/rust#116730
  * rust-lang/rust#116723
  * rust-lang/rust#116715
  * rust-lang/rust#116603
  * rust-lang/rust#116591
  * rust-lang/rust#115439
* rust-lang/rust#116264
* rust-lang/rust#116727
  * rust-lang/rust#116704
  * rust-lang/rust#116696
  * rust-lang/rust#116695
  * rust-lang/rust#116644
  * rust-lang/rust#116630
* rust-lang/rust#116728
  * rust-lang/rust#116689
  * rust-lang/rust#116679
  * rust-lang/rust#116618
  * rust-lang/rust#116577
  * rust-lang/rust#115653
* rust-lang/rust#116702
* rust-lang/rust#116015
* rust-lang/rust#115822
* rust-lang/rust#116407
* rust-lang/rust#115719
* rust-lang/rust#115524
* rust-lang/rust#116705
* rust-lang/rust#116645
* rust-lang/rust#116233
* rust-lang/rust#115108
* rust-lang/rust#116670
* rust-lang/rust#116676
* rust-lang/rust#116666



Co-authored-by: Benoît du Garreau <bdgdlm@outlook.com>
Co-authored-by: Colin Finck <colin@reactos.org>
Co-authored-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Co-authored-by: Joshua Liebow-Feeser <joshlf@users.noreply.github.com>
Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
Co-authored-by: Trevor Gross <tmgross@umich.edu>
Co-authored-by: Evan Merlock <evan@merlock.dev>
Co-authored-by: joboet <jonasboettiger@icloud.com>
Co-authored-by: Ralf Jung <post@ralfj.de>
Co-authored-by: DaniPopes <57450786+DaniPopes@users.noreply.github.com>
Co-authored-by: Mark Rousskov <mark.simulacrum@gmail.com>
Co-authored-by: onur-ozkan <work@onurozkan.dev>
Co-authored-by: Nicholas Nethercote <n.nethercote@gmail.com>
Co-authored-by: The 8472 <git@infinite-source.de>
Co-authored-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Co-authored-by: reez12g <reez12g@gmail.com>
Co-authored-by: Jakub Beránek <berykubik@gmail.com>
nicholasbishop added a commit to nicholasbishop/rustc-dev-guide that referenced this pull request Oct 29, 2023
nicholasbishop added a commit to nicholasbishop/rustc-dev-guide that referenced this pull request Oct 29, 2023
The name for active features was changed to unstable in
rust-lang/rust#116550
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants