Commit Graph

114 Commits

Author SHA1 Message Date
Nicholas Nethercote c34ebba134 Remove extern crate rustc_middle from rustc_ty_utils. 2024-05-13 08:20:18 +10:00
Michael Goulet cc606174a6 Don't ICE when codegen_select returns ambiguity in new solver 2024-04-25 11:49:12 -04:00
Daria Sukhonina e239e73a77 Fix disabling the export of noop async_drop_in_place_raw 2024-04-18 15:19:05 +03:00
Daria Sukhonina 80c0b7e90f Use non-exhaustive matches for TyKind
Also no longer export noop async_drop_in_place_raw
2024-04-17 20:49:53 +03:00
zetanumbers 24a24ec6ba Add simple async drop glue generation
Explainer: https://zetanumbers.github.io/book/async-drop-design.html

https://github.com/rust-lang/rust/pull/121801
2024-04-16 20:45:07 +03:00
Michael Goulet f1fef64e19 Fix ABI for FnMut/Fn impls for async closures 2024-03-19 16:59:24 -04:00
Michael Goulet 05116c5c30 Only split by-ref/by-move futures for async closures 2024-03-19 16:59:23 -04:00
Deadbeef 7e1969ac13 Remove Ord from ClosureKind
Using `Ord` to accomplish a meaning of subset relationship
can be hard to read. The existing uses for that are easily
replaced with a `match`, and in my opinion, more readable
without needing to resorting to comments to explain the
intention.
2024-03-09 21:16:43 +08:00
Oli Scherer c04f0caaff make intrinsic query legal for any DefId 2024-03-04 16:28:33 +00:00
Michael Goulet 762febdaf3 Fix stray trait mismatch in resolve_associated_item for AsyncFn 2024-02-20 15:45:05 +00:00
Oli Scherer 0eee945680 Make is_intrinsic query return the intrinsic name 2024-02-12 09:33:52 +00:00
bors 520b0b20aa Auto merge of #120619 - compiler-errors:param, r=lcnr
Assert that params with the same *index* have the same *name*

Found this bug when trying to build libcore with the new solver, since it will canonicalize two params with the same index into *different* placeholders if those params differ by name.
2024-02-11 22:13:52 +00:00
Michael Goulet 24d806ccfa Stop using is_copy_modulo_regions when building clone shim 2024-02-07 22:57:55 +00:00
Michael Goulet b8c93f1223 Coroutine closures implement regular Fn traits, when possible 2024-02-06 20:52:13 +00:00
Michael Goulet 08af64e96b Regular closures now built-in impls for AsyncFn* 2024-02-06 20:52:13 +00:00
Michael Goulet c98d6994a3 More comments, final tweaks 2024-02-06 02:22:58 +00:00
Michael Goulet fc4fff4038 Build a shim to call async closures with different AsyncFn trait kinds 2024-02-06 02:22:58 +00:00
Michael Goulet a82bae2172 Teach typeck/borrowck/solvers how to deal with async closures 2024-02-06 02:22:58 +00:00
Michael Goulet c567eddec2 Add CoroutineClosure to TyKind, AggregateKind, UpvarArgs 2024-02-06 02:22:58 +00:00
León Orell Valerian Liehr 6131ba62ad Rollup merge of #120139 - compiler-errors:fnonce-shim, r=BoxyUwU
Do not normalize closure signature when building `FnOnce` shim

It is not necessary to normalize the closure signature when building an `FnOnce` shim for an `Fn`/`FnMut` closure. That closure shim is just calling `FnMut::call_mut(&mut self)` anyways.

It's also somewhat sketchy that we were ever doing this to begin with, since we're normalizing with a `ParamEnv::reveal_all()` param-env, which is definitely not right with possibly polymorphic substs.

This cuts out a tiny bit of unnecessary work in `Instance::resolve` and simplifies the signature because now we can unconditionally return an `Instance`.
2024-01-23 21:53:56 +01:00
Michael Goulet f700ee4e70 Do not normalize closure signature when building FnOnce shim 2024-01-22 16:50:30 +00:00
Michael Goulet f2ef88ba06 Consolidate logic around resolving built-in coroutine trait impls 2024-01-19 21:28:37 +00:00
Michael Goulet fcb42b42d6 Remove movability from TyKind::Coroutine 2023-12-28 16:35:01 +00:00
Nicholas Nethercote 99472c7049 Remove Session methods that duplicate DiagCtxt methods.
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier
access.
2023-12-24 08:05:28 +11:00
Michael Goulet 96bb542a31 Implement async gen blocks 2023-12-08 17:23:25 +00:00
Nicholas Nethercote 5d1d384443 Rename HandlerInner::delay_span_bug as HandlerInner::span_delayed_bug.
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug`
follows the pattern used everywhere else: `span_err`, `span_warning`,
etc.
2023-12-02 09:01:19 +11:00
Nilstrieb 90e4c2dc3a Rollup merge of #118115 - spastorino:fix-old-fn-names, r=compiler-errors
Fix occurrences of old fn names in comment and tracing
2023-11-21 09:06:30 +01:00
Santiago Pastorino 8cf94c955f Fix occurrences of old fn names in comment and tracing 2023-11-20 22:45:28 -03:00
Nicholas Nethercote e2664eba50 Reduce exposure of some items. 2023-11-20 14:10:19 +11:00
Michael Goulet add09e66f2 Some more coroutine renamings 2023-10-30 23:46:27 +00:00
Oli Scherer c892b28c02 Basic generators work 2023-10-27 13:05:48 +00:00
Oli Scherer e96ce20b34 s/generator/coroutine/ 2023-10-20 21:14:01 +00:00
Oli Scherer 60956837cf s/Generator/Coroutine/ 2023-10-20 21:10:38 +00:00
Michael Goulet b2d2184ede Format all the let chains in compiler 2023-10-13 08:59:36 +00:00
Michael Goulet a30ad3a5a6 Don't resolve generic instances if they may be shadowed by dyn 2023-09-19 05:42:23 +00:00
Deadbeef a0a801cd38 treat host effect params as erased generics in codegen
This fixes the changes brought to codegen tests when effect params are
added to libcore, by not attempting to monomorphize functions that get
the host param by being `const fn`.
2023-09-14 07:34:35 +00:00
Michael Goulet d8e3986d42 Don't use type_of to determine if item has intrinsic shim 2023-08-09 20:00:38 +00:00
Michael Goulet a7ed9c1da7 Make everything builtin! 2023-07-25 16:08:58 +00:00
Michael Goulet c02d1a6553 Restore tuple unsizing feature gate 2023-07-25 15:15:25 +00:00
Mahdi Dibaiee e55583c4b8 refactor(rustc_middle): Substs -> GenericArg 2023-07-14 13:27:35 +01:00
Mark Rousskov cc907f80b9 Re-format let-else per rustfmt update 2023-07-12 21:49:27 -04:00
Michael Goulet 3f8919c09b get rid of a bit more calls to poly_select 2023-07-06 16:50:12 +00:00
Michael Goulet 42571c4847 yeet ImplSource::TraitAlias too 2023-06-20 23:33:02 +00:00
Michael Goulet d97d4ebecc Remove even more redundant builtin candidates 2023-06-17 03:32:46 +00:00
Michael Goulet 2835d9d1d3 Simplify even more candidates 2023-06-17 03:32:46 +00:00
Michael Goulet 9e68b6f505 Simplify some impl source candidates 2023-06-17 03:32:45 +00:00
Deadbeef 21bc5cded4 Rename impl_defaultness to defaultness 2023-06-01 06:14:06 +00:00
John Kåre Alsaker fff20a703d Move expansion of query macros in rustc_middle to rustc_middle::query 2023-05-15 08:49:13 +02:00
Jonas Schievink 3bbb69eaa0 Fix miscompilation when adding default method to Future 2023-05-08 17:06:48 +02:00
Kyle Matsuda e5d10cdbc3 make (try_)subst_and_normalize_erasing_regions take EarlyBinder 2023-05-06 22:32:39 -06:00