-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Fix async Fn
confirmation for FnDef
/FnPtr
/Closure
types
#121654
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
oof. and the mixup is only really noticeable for projections, not just proving that one of the async fn traits holds |
💀 |
let future_trait_def_id = tcx.require_lang_item(LangItem::Future, None); | ||
let placeholder_output_ty = self.infcx.enter_forall_and_leak_universe(sig.output()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, if actually used (via unboxed closures), we'd just get odd errors about traits not being implemented even though they are?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this change only affects async Fn
trait goals, and makes them go from ICE -> PASS.
That issue I linked via unboxed closures still ICEs; I'll put up a fix like #108834 in a separate PR.
I guess the tests implicitly test that r=me either way, and sorry for not catching these in review. |
No, it's definitely 100% my fault for writing extremely incomprehensible code lol |
da9c691
to
c8e3f35
Compare
…llaumeGomez Rollup of 10 pull requests Successful merges: - rust-lang#118217 (Document which methods on `f64` are precise) - rust-lang#119748 (Increase visibility of `join_path` and `split_paths`) - rust-lang#121412 (platform docs: clarify hexagon-unknown-none-elf example, add hexagon-unknown-linux-musl) - rust-lang#121654 (Fix `async Fn` confirmation for `FnDef`/`FnPtr`/`Closure` types) - rust-lang#121700 (CFI: Don't compress user-defined builtin types) - rust-lang#121765 (add platform-specific function to get the error number for HermitOS) - rust-lang#121781 (bootstrap/format: send larger batches to rustfmt) - rust-lang#121788 (bootstrap: fix clap deprecated warnings) - rust-lang#121792 (Improve renaming suggestion when item starts with underscore) - rust-lang#121793 (Document which methods on `f32` are precise) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#121654 - compiler-errors:async-fn-for-fn-def, r=oli-obk Fix `async Fn` confirmation for `FnDef`/`FnPtr`/`Closure` types Fixes three issues: 1. The code in `extract_tupled_inputs_and_output_from_async_callable` was accidentally getting the *future* type and the *output* type (returned by the future) messed up for fnptr/fndef/closure types. :/ 2. We have a (class of) bug(s) in the old solver where we don't really support higher ranked built-in `Future` goals for generators. This is not possible to hit on stable code, but [can be hit with `unboxed_closures`](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=e935de7181e37e13515ad01720bcb899) (rust-lang#121653). * I'm opting not to fix that in this PR. Instead, I just instantiate placeholders when confirming `async Fn` goals. 4. Fixed a bug when generating `FnPtr` shims for `async Fn` trait goals. r? oli-obk
Fixes three issues:
extract_tupled_inputs_and_output_from_async_callable
was accidentally getting the future type and the output type (returned by the future) messed up for fnptr/fndef/closure types. :/Future
goals for generators. This is not possible to hit on stable code, but can be hit withunboxed_closures
(Confirming built-in higher-ranked Future (and other coroutine) goals ICEs #121653).async Fn
goals.FnPtr
shims forasync Fn
trait goals.r? oli-obk