Skip to content

Remove use of const traits (and feature(effects)) from stdlib#126552

Merged
bors merged 4 commits into
rust-lang:masterfrom
fee1-dead-contrib:rmfx
Jun 22, 2024
Merged

Remove use of const traits (and feature(effects)) from stdlib#126552
bors merged 4 commits into
rust-lang:masterfrom
fee1-dead-contrib:rmfx

Conversation

@fee1-dead
Copy link
Copy Markdown
Member

@fee1-dead fee1-dead commented Jun 16, 2024

The current uses are already unsound because they are using non-const impls in const contexts. We can reintroduce them by reverting the commit in this PR, after #120639 lands.

Also, make effects an incomplete feature.

cc @rust-lang/project-const-traits
r? @compiler-errors

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jun 16, 2024
@compiler-errors
Copy link
Copy Markdown
Contributor

compiler-errors commented Jun 16, 2024

r=me when ci is green

Note for anyone whose nightly code has regressed because we removed const traits from libstd

Please pin your nightly version to 2024-06-16 since it's likely going to be a bit of time before we restore const to some of these traits like PartialEq and Add. Sorry!

@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Copy Markdown
Contributor

oli-obk commented Jun 16, 2024

Could also mark the features as incomplete now as then they won't be usable in libcore accidentally

@compiler-errors
Copy link
Copy Markdown
Contributor

Yeah, good idea. Will require adding a bunch of //~^ WARN the feature effects is incomplete to the test suite, but I'd rather mark it incomplete until we're confident about it!

@compiler-errors
Copy link
Copy Markdown
Contributor

@rustbot author

@rustbot rustbot 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 Jun 18, 2024
@bors
Copy link
Copy Markdown
Collaborator

bors commented Jun 20, 2024

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

@rustbot rustbot added the WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) label Jun 21, 2024
@fee1-dead
Copy link
Copy Markdown
Member Author

fee1-dead commented Jun 21, 2024

I made effects incomplete and blessed the ui tests.

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 21, 2024
@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Copy Markdown
Contributor

r=me after making tests pass

@compiler-errors
Copy link
Copy Markdown
Contributor

@rustbot author

@rustbot rustbot 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 Jun 21, 2024
@fee1-dead
Copy link
Copy Markdown
Member Author

@bors r=compiler-errors

@oli-obk
Copy link
Copy Markdown
Contributor

oli-obk commented Jun 22, 2024

Looks like the book uses effects in examples

@fee1-dead
Copy link
Copy Markdown
Member Author

@bors r=compiler-errors

@bors
Copy link
Copy Markdown
Collaborator

bors commented Jun 22, 2024

📌 Commit 81da6a6 has been approved by compiler-errors

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 Jun 22, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 22, 2024
…iaskrgr

Rollup of 3 pull requests

Successful merges:

 - rust-lang#126140 (Rename `std::fs::try_exists` to  `std::fs::exists` and stabilize fs_try_exists)
 - rust-lang#126318 (Add a `x perf` command for integrating bootstrap with `rustc-perf`)
 - rust-lang#126552 (Remove use of const traits (and `feature(effects)`) from stdlib)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit dc9a08f into rust-lang:master Jun 22, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jun 22, 2024
Rollup merge of rust-lang#126552 - fee1-dead-contrib:rmfx, r=compiler-errors

Remove use of const traits (and `feature(effects)`) from stdlib

The current uses are already unsound because they are using non-const impls in const contexts. We can reintroduce them by reverting the commit in this PR, after rust-lang#120639 lands.

Also, make `effects` an incomplete feature.

cc `@rust-lang/project-const-traits`
r? `@compiler-errors`
@rustbot rustbot added this to the 1.81.0 milestone Jun 22, 2024
@bors
Copy link
Copy Markdown
Collaborator

bors commented Jun 22, 2024

⌛ Testing commit 81da6a6 with merge a0f01c3...

@W95Psp W95Psp mentioned this pull request Jun 24, 2024
brunocodutra added a commit to brunocodutra/cinder that referenced this pull request Jun 29, 2024
brunocodutra added a commit to brunocodutra/cinder that referenced this pull request Jun 29, 2024
brunocodutra added a commit to brunocodutra/cinder that referenced this pull request Jun 29, 2024
@fee1-dead fee1-dead deleted the rmfx branch June 30, 2024 16:33
celinval added a commit to celinval/rust-dev that referenced this pull request Jul 17, 2024