Michael Goulet
138881b315
Uplift Goal to rustc_type_ir
2024-05-16 14:24:22 -04:00
Michael Goulet
11ec3eca74
Rename ToPredicate for Upcast
2024-05-16 14:23:47 -04:00
bors
34582118af
Auto merge of #125076 - compiler-errors:alias-term, r=lcnr
...
Split out `ty::AliasTerm` from `ty::AliasTy`
Splitting out `AliasTerm` (for use in project and normalizes goals) and `AliasTy` (for use in `ty::Alias`)
r? lcnr
2024-05-13 22:20:43 +00:00
Michael Goulet
3bcdf3058e
split out AliasTy -> AliasTerm
2024-05-13 11:59:42 -04:00
Nicholas Nethercote
4bf20b2b55
Remove extern crate rustc_middle
from rustc_trait_selection
.
2024-05-13 08:20:18 +10:00
lcnr
41ebd16266
solve: replace all debug
with trace
2024-05-12 03:29:50 +00:00
Nicholas Nethercote
4814fd0a4b
Remove extern crate rustc_macros
from numerous crates.
2024-04-29 10:21:54 +10:00
Michael Goulet
6f96d7d012
Don't rely on upvars being assigned just because coroutine-closure kind is assigned
2024-04-08 22:43:32 -04:00
Oli Scherer
84acfe86de
Actually create ranged int types in the type system.
2024-04-08 12:02:19 +00:00
Michael Goulet
ff0c31e6b9
Programmatically convert some of the pat ctors
2024-03-22 11:13:29 -04:00
Michael Goulet
bca708b9fa
Do binder folding eagerly in bound_coroutine_hidden_types
...
I refuse to fix this in the old solver; its lazy instantiation of
binders will be the end of me.
2024-03-19 11:52:45 -04:00
Michael Goulet
67f1c53c05
Don't ICE when encountering bound regions in generator interior type
2024-03-19 11:30:12 -04:00
Lukas Markeffsky
99efae342e
address nits
2024-03-18 22:28:29 +01:00
Lukas Markeffsky
8fe99f57a4
remove unnecessary sized checks
2024-03-14 21:28:48 +01:00
Lukas Markeffsky
8ad94111ad
clean up ADT sized constraint computation
2024-03-14 21:28:47 +01:00
Deadbeef
69d781abef
move impl documentation to their actual locations
2024-03-14 20:18:04 +08:00
Michael Goulet
118730b9a3
Add a couple helpers, make return types less confusing
2024-02-27 17:21:40 +00:00
Michael Goulet
a6727bad88
Support {async closure}: Fn
in new solver
2024-02-27 17:21:39 +00:00
Shoyu Vanilla
3856df059e
Dejargnonize subst
2024-02-12 15:46:35 +09:00
bors
757b8efed4
Auto merge of #120712 - compiler-errors:async-closures-harmonize, r=oli-obk
...
Harmonize `AsyncFn` implementations, make async closures conditionally impl `Fn*` traits
This PR implements several changes to the built-in and libcore-provided implementations of `Fn*` and `AsyncFn*` to address two problems:
1. async closures do not implement the `Fn*` family traits, leading to breakage: https://crater-reports.s3.amazonaws.com/pr-120361/index.html
2. *references* to async closures do not implement `AsyncFn*`, as a consequence of the existing blanket impls of the shape `AsyncFn for F where F: Fn, F::Output: Future`.
In order to fix (1.), we implement `Fn` traits appropriately for async closures. It turns out that async closures can:
* always implement `FnOnce`, meaning that they're drop-in compatible with `FnOnce`-bound combinators like `Option::map`.
* conditionally implement `Fn`/`FnMut` if they have no captures, which means that existing usages of async closures should *probably* work without breakage (crater checking this: https://github.com/rust-lang/rust/pull/120712#issuecomment-1930587805 ).
In order to fix (2.), we make all of the built-in callables implement `AsyncFn*` via built-in impls, and instead adjust the blanket impls for `AsyncFn*` provided by libcore to match the blanket impls for `Fn*`.
2024-02-10 07:15:15 +00:00
Boxy
f867742be8
reviews + rebase
2024-02-08 13:19:25 +00:00
Boxy
ac559af98f
introduce enter_forall
2024-02-08 13:01:08 +00:00
Michael Goulet
08af64e96b
Regular closures now built-in impls for AsyncFn*
2024-02-06 20:52:13 +00:00
Michael Goulet
f3d32f2f0c
Flatten confirmation logic
2024-02-06 17:20:40 +00:00
Michael Goulet
c98d6994a3
More comments, final tweaks
2024-02-06 02:22:58 +00:00
Michael Goulet
881b6b5149
Bless tests, add comments
2024-02-06 02:22:58 +00:00
Michael Goulet
427896dd7e
Construct body for by-move coroutine closure output
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
Michael Goulet
e24da8ea19
Movability doesn't need to be a query anymore
2023-12-28 16:35:01 +00:00
Michael Goulet
fcb42b42d6
Remove movability from TyKind::Coroutine
2023-12-28 16:35:01 +00:00
Nilstrieb
21a870515b
Fix clippy::needless_borrow
in the compiler
...
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`.
Then I had to remove a few unnecessary parens and muts that were exposed
now.
2023-11-21 20:13:40 +01:00
lcnr
8935a1be01
update type flags
...
- `HAS_RE_LATE_BOUND` -> `HAS_RE_BOUND`
- `HAS_TY_LATE_BOUND` -> `HAS_TY_BOUND`
- `HAS_CT_LATE_BOUND` -> `HAS_CT_BOUND`
- `HAS_LATE_BOUND` -> `HAS_BOUND_VARS`
- `fn has_late_bound_regions` -> `fn has_bound_regions`
- `fnhas_non_region_late_bound` -> `fn has_non_region_bound_vars`
- `fn has_late_bound_vars` -> `fn has_bound_vars`
2023-11-13 14:13:54 +00:00
lcnr
86fa1317a3
rename ReLateBound
to ReBound
...
other changes:
- `Region::new_late_bound` -> `Region::new_bound`
- `Region::is_late_bound` -> `Region::is_bound`
2023-11-13 14:13:54 +00:00
lcnr
bf360d407e
instrument constituent types computation
2023-11-08 12:24:42 +01: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
Camille GILLOT
26cb34cd18
Remove span from BrAnon.
2023-09-24 09:46:55 +00:00
Camille GILLOT
44ac8dcc71
Remove GeneratorWitness and rename GeneratorWitnessMIR.
2023-09-23 13:47:30 +00:00
Michael Goulet
07fc644132
Do not require associated types with Self: Sized to uphold bounds when confirming object candidate
2023-09-02 05:08:38 +00:00
Michael Goulet
7a6b52bf0d
RPITITs are considered object-safe, they're always on Self:Sized methods
2023-09-02 04:58:23 +00:00
lcnr
bb76fde734
remove builtin impl for float and int infer
2023-08-11 19:08:11 +02:00
Matthias Krüger
2a643b2dc0
Rollup merge of #114196 - compiler-errors:bubble-pls, r=lcnr
...
Bubble up nested goals from equation in `predicates_for_object_candidate`
This used to be needed for https://github.com/rust-lang/rust/pull/114036#discussion_r1273987510 , but since it's no longer, I'm opening this as a separate PR. This also fixes one ICEing UI test: (`tests/ui/unboxed-closures/issue-53448.rs`)
r? `@lcnr`
2023-08-07 16:47:54 +02:00
Michael Goulet
8696fa71b3
Convert adt_sized_constraint to early-binder, use list
2023-08-01 23:10:38 +00:00
Michael Goulet
57407a3555
Bubble up nested goals from equation in predicates_for_object_candidate
2023-07-29 05:55:03 +00:00
Michael Goulet
f3553691a8
Comment stuff in the new solver
2023-07-23 12:30:52 -07:00
Michael Goulet
05f6890b3e
Rename arg_iter to iter_instantiated
2023-07-17 21:04:12 +00:00
Mahdi Dibaiee
e55583c4b8
refactor(rustc_middle): Substs -> GenericArg
2023-07-14 13:27:35 +01:00
Boxy
12138b8e5e
Move TyCtxt::mk_x
to Ty::new_x
where applicable
2023-07-05 20:27:07 +01:00
Michael Goulet
fbdef58414
Migrate predicates_of and caller_bounds to Clause
2023-06-26 23:12:03 +00:00