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

Seal all extension traits #81213

Closed
wants to merge 5 commits into from
Closed

Seal all extension traits #81213

wants to merge 5 commits into from

Conversation

m-ou-se
Copy link
Member

@m-ou-se m-ou-se commented Jan 20, 2021

This seals all extension traits, to make sure we can add new methods to them in the future without breaking anything.

(ExitStatusExt was already sealed a few days ago by #79982.)

This needs a crater run. See #80634.

cc @SimonSapin @camelid

@m-ou-se m-ou-se added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. labels Jan 20, 2021
@m-ou-se
Copy link
Member Author

m-ou-se commented Jan 21, 2021

@bors try

@bors
Copy link
Contributor

bors commented Jan 21, 2021

⌛ Trying commit 00cf2c5952e971ce1a799540f16c5762065a0673 with merge 710510d996d140cdc77887403b52d8ddbbf33bbe...

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
    Checking strip-ansi-escapes v0.1.0
    Checking aho-corasick v0.7.15
    Checking bstr v0.2.14
   Compiling quote v1.0.8
error[E0277]: the trait bound `ScopedJoinHandle<'_, T>: std::sealed::Sealed` is not satisfied
    |
    |
552 |         impl<T> JoinHandleExt for ScopedJoinHandle<'_, T> {
    |                 ^^^^^^^^^^^^^ the trait `std::sealed::Sealed` is not implemented for `ScopedJoinHandle<'_, T>`
   ::: /checkout/library/std/src/sys/unix/ext/thread.rs:17:26
    |
    |
17  | pub trait JoinHandleExt: Sealed {
    |                          ------ required by this bound in `JoinHandleExt`
error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `crossbeam-utils`

@bors
Copy link
Contributor

bors commented Jan 21, 2021

💔 Test failed - checks-actions

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 21, 2021
This also marks it as unstable, as it should never be used outside std.
With cfg(doc), both the windows and unix implementations were included,
which conflicts. This moves the implementation to the file that defines
the type.
@m-ou-se
Copy link
Member Author

m-ou-se commented Jan 21, 2021

Well that's a first data point. We can't seal JoinHandleExt, as crossbeam uses it here:

https://github.com/crossbeam-rs/crossbeam/blob/a95c02ea75d236a3560cd85075f71f8982bbf307/crossbeam-utils/src/thread.rs#L550

Un-sealing that trait and trying again.. :)

@m-ou-se
Copy link
Member Author

m-ou-se commented Jan 21, 2021

@bors try

@bors
Copy link
Contributor

bors commented Jan 21, 2021

⌛ Trying commit 229c004 with merge 82acd1d76add2232e19c1f0feb250d2a19ec6efe...

@bors
Copy link
Contributor

bors commented Jan 21, 2021

☀️ Try build successful - checks-actions
Build commit: 82acd1d76add2232e19c1f0feb250d2a19ec6efe (82acd1d76add2232e19c1f0feb250d2a19ec6efe)

1 similar comment
@bors
Copy link
Contributor

bors commented Jan 21, 2021

☀️ Try build successful - checks-actions
Build commit: 82acd1d76add2232e19c1f0feb250d2a19ec6efe (82acd1d76add2232e19c1f0feb250d2a19ec6efe)

@m-ou-se
Copy link
Member Author

m-ou-se commented Jan 21, 2021

Uh, thanks bors, once was enough. (:

@m-ou-se
Copy link
Member Author

m-ou-se commented Jan 21, 2021

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-81213 created and queued.
🤖 Automatically detected try build 82acd1d76add2232e19c1f0feb250d2a19ec6efe
⚠️ Try build based on commit 339e196, but latest commit is 229c004. Did you forget to make a new try build?
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 21, 2021
@camelid
Copy link
Member

camelid commented Jan 21, 2021

🤖 Automatically detected try build 82acd1d
⚠️ Try build based on commit 339e196, but latest commit is 229c004. Did you forget to make a new try build?

Is craterbot confused? The try commit looks correct to me.

@craterbot
Copy link
Collaborator

🚧 Experiment pr-81213 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-81213 is completed!
📊 6403 regressed and 8 fixed (141625 total)
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot removed the S-waiting-on-crater Status: Waiting on a crater run to be completed. label Jan 26, 2021
@craterbot craterbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 26, 2021
@m-ou-se
Copy link
Member Author

m-ou-se commented Jan 26, 2021

Results:

Crate DirEntryExt DirBuilderExt OpenOptionsExt FileExt FileTypeExt MetadataExt PermissionsExt ExitStatusExt CommandExt OsStrExt OsStringExt
tokio 💥
tokio-fs 💥
tokio-async-std 💥 💥 💥
async-std 💥 💥 💥
async-fs 💥 💥 💥
deterministic 💥 💥
file-locker 💥
queen-io 💥
fs-err 💥
kayrx 💥
cap-primitives 0.9* 💥 💥 💥 💥 💥 💥

*outdated: 0.11 is the latest, which does not implement any of these traits.

So, sealing these didn't cause any problems:

  • ExitStatusExt
  • CommandExt
  • OsStrExt
  • OsStringExt

Sealing these only causes problems on an older version of one crate:

  • FileTypeExt
  • MetadataExt
  • PermissionsExt

Sealing the others causes bigger problems.

@camelid
Copy link
Member

camelid commented Jan 29, 2021

Does this PR need an assignee? It seems like highfive conked out again and didn't assign one.

@m-ou-se m-ou-se self-assigned this Jan 29, 2021
@m-ou-se
Copy link
Member Author

m-ou-se commented Jan 29, 2021

Does this PR need an assignee? It seems like highfive conked out again and didn't assign one.

I do this on purpose for experimental PRs. Should I assign myself instead?

@camelid
Copy link
Member

camelid commented Jan 30, 2021

Does this PR need an assignee? It seems like highfive conked out again and didn't assign one.

I do this on purpose for experimental PRs. Should I assign myself instead?

Ah, you edited the PR description to remove r? @ghost, so I didn't realize you didn't want a reviewer.

No need to assign yourself; maybe just add S-experimental and remove S-waiting-on-review.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 11, 2021
Seal the CommandExt, OsStrExt and OsStringExt traits

A crater run (rust-lang#81213 (comment)) has shown that this does not break any existing code.

This also unblocks rust-lang#77728.

Based on rust-lang#81213.

r? ``@m-ou-se``
cc ``@lygstate``
@camelid camelid added S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 16, 2021
@crlf0710 crlf0710 added S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. and removed S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. labels Mar 5, 2021
@m-ou-se m-ou-se closed this Mar 21, 2021
@m-ou-se m-ou-se deleted the seal branch March 21, 2021 12:54
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 13, 2023
Seal `MetadataExt` on all platforms

The Windows flavour of [`MetadataExt`](https://doc.rust-lang.org/std/os/windows/fs/trait.MetadataExt.html) is currently unimplementable on stable because of unstable methods. Therefore anyone making a cross-platform library that implements `MetadataExt` will fail on Windows. So let's see if we can seal it for all platforms.

[Last time this was tried](rust-lang#81213 (comment)), sealing `MetadataExt` only caused a problem for one old version of one crate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-experimental Status: Ongoing experiment that does not require reviewing and won't be merged in its current state. T-libs-api Relevant to the library API 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