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

Make AsyncFnOnce, AsyncFnMut, AsyncFn non-#[fundamental] #136724

Merged
merged 1 commit into from
Feb 9, 2025

Conversation

steffahn
Copy link
Member

@steffahn steffahn commented Feb 8, 2025

Address the issue #136723 on nightly (the issue will only actually be fixed with a beta backport).

@rustbot
Copy link
Collaborator

rustbot commented Feb 8, 2025

r? @cuviper

rustbot has assigned @cuviper.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Feb 8, 2025
@steffahn
Copy link
Member Author

steffahn commented Feb 8, 2025

r? @compiler-errors

@rustbot rustbot assigned compiler-errors and unassigned cuviper Feb 8, 2025
@compiler-errors
Copy link
Member

(the issue will only actually be fixed with a beta backport)

I'll beta-nominate this and it should be a no brainer to accept, but I'd like to temper a sense of urgency here by making sure it's overwhelmingly it clear that anyone who would take advantage of this in coherence between 1.85 and when this would be landing "naturally" in 1.86 would be doing it almost certainly maliciously, on purpose, rather than just doing it accidentally, lol.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 8, 2025

📌 Commit 7155382 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-review Status: Awaiting review from the assignee but also interested parties. labels Feb 8, 2025
@compiler-errors compiler-errors added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Feb 8, 2025
@steffahn
Copy link
Member Author

steffahn commented Feb 8, 2025

Where’s the bors r+ speedrun 😎 leaderboard?

@steffahn
Copy link
Member Author

steffahn commented Feb 8, 2025

anyone who would take advantage of this in coherence between 1.85 and when this would be landing "naturally" in 1.86 would be doing it almost certainly maliciously, on purpose

Not necessarily, I think it could very reasonably appear naturally. After all, Box<dyn FnOnce() -> BoxFuture<()>>; can be a natural choice for “simulating” a Box<dyn AsyncFnOnce()>, and then it can be a reasonable idea to desire an API that’s able to accept both, either any impl AsyncFnOnce(), or a Box<dyn FnOnce() -> BoxFuture<()>> value.

A workaround that’ll still be okay is to use some struct DynAsyncFnOnce(Box<dyn FnOnce() -> BoxFuture<()>>); instead, the local struct supports the negative reasoning again. This is not problematic either, because DynAsyncFnOnce won’t be implementing FnOnce either…

…which also demonstrates that any stabilizing a way to implement FnOnce for custom structs can be problematic in this regard (once again breaking future-compatibility of a Fn*AsyncFn* unification).

Also any stabilizing a way of doing/using dyn AsyncFnOnce trait objects could come with the analogous issue with reversed roles, that FnOnce’s #[fundamental]ity means Box<dyn AsyncFnOnce…*> can’t support being changed to implement FnOnce at a later point.

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Feb 8, 2025
…r=compiler-errors

Make `AsyncFnOnce`, `AsyncFnMut`, `AsyncFn` non-`#[fundamental]`

Address the issue rust-lang#136723 on nightly (the issue will only *actually* be fixed with a beta backport).
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 8, 2025
…kingjubilee

Rollup of 13 pull requests

Successful merges:

 - rust-lang#134999 (Add cygwin target.)
 - rust-lang#135439 (Make `-O` mean `OptLevel::Aggressive`)
 - rust-lang#136397 (Add a comment pointing to ICE-136223)
 - rust-lang#136681 (resolve `llvm-config` path properly on cross builds)
 - rust-lang#136686 (Clean up `HashMap` and `HashSet` docs.)
 - rust-lang#136694 (Update minifier version to `0.3.4`)
 - rust-lang#136706 (compiler: mostly-finish `rustc_abi` updates)
 - rust-lang#136710 (Document `Sum::sum` returns additive identities for `[]`)
 - rust-lang#136724 (Make `AsyncFnOnce`, `AsyncFnMut`, `AsyncFn` non-`#[fundamental]`)
 - rust-lang#136727 (Have a break from review rotation)
 - rust-lang#136730 (transmutability: fix ICE when passing wrong ADT to ASSUME)
 - rust-lang#136736 (Small resolve refactor)
 - rust-lang#136746 (Emit an error if `-Zdwarf-version=1` is requested)

r? `@ghost`
`@rustbot` modify labels: rollup
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Feb 9, 2025
…r=compiler-errors

Make `AsyncFnOnce`, `AsyncFnMut`, `AsyncFn` non-`#[fundamental]`

Address the issue rust-lang#136723 on nightly (the issue will only *actually* be fixed with a beta backport).
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 9, 2025
…kingjubilee

Rollup of 10 pull requests

Successful merges:

 - rust-lang#136397 (Add a comment pointing to ICE-136223)
 - rust-lang#136681 (resolve `llvm-config` path properly on cross builds)
 - rust-lang#136686 (Clean up `HashMap` and `HashSet` docs.)
 - rust-lang#136694 (Update minifier version to `0.3.4`)
 - rust-lang#136706 (compiler: mostly-finish `rustc_abi` updates)
 - rust-lang#136710 (Document `Sum::sum` returns additive identities for `[]`)
 - rust-lang#136724 (Make `AsyncFnOnce`, `AsyncFnMut`, `AsyncFn` non-`#[fundamental]`)
 - rust-lang#136727 (Have a break from review rotation)
 - rust-lang#136730 (transmutability: fix ICE when passing wrong ADT to ASSUME)
 - rust-lang#136736 (Small resolve refactor)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 9, 2025
…kingjubilee

Rollup of 8 pull requests

Successful merges:

 - rust-lang#136397 (Add a comment pointing to ICE-136223)
 - rust-lang#136686 (Clean up `HashMap` and `HashSet` docs.)
 - rust-lang#136706 (compiler: mostly-finish `rustc_abi` updates)
 - rust-lang#136710 (Document `Sum::sum` returns additive identities for `[]`)
 - rust-lang#136724 (Make `AsyncFnOnce`, `AsyncFnMut`, `AsyncFn` non-`#[fundamental]`)
 - rust-lang#136727 (Have a break from review rotation)
 - rust-lang#136730 (transmutability: fix ICE when passing wrong ADT to ASSUME)
 - rust-lang#136736 (Small resolve refactor)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit bf2c532 into rust-lang:master Feb 9, 2025
6 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Feb 9, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 9, 2025
Rollup merge of rust-lang#136724 - steffahn:asyncfn-non-fundamental, r=compiler-errors

Make `AsyncFnOnce`, `AsyncFnMut`, `AsyncFn` non-`#[fundamental]`

Address the issue rust-lang#136723 on nightly (the issue will only *actually* be fixed with a beta backport).
@Amanieu Amanieu added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. beta-nominated Nominated for backporting to the compiler in the beta channel. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library 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