about summary refs log tree commit diff
path: root/compiler/rustc_next_trait_solver/src
AgeCommit message (Collapse)AuthorLines
2024-08-13implement a performant and fuzzed solver cachelcnr-21/+31
2024-08-12expand fuzzing supportlcnr-0/+9
this allows us to only sometimes disable the global cache.
2024-08-12do not use the global solver cache for proof treeslcnr-94/+19
doing so requires overwriting global cache entries and generally adds significant complexity to the solver. This is also only ever done for root goals, so it feels easier to wrap the `evaluate_canonical_goal` in an ordinary query if necessary.
2024-08-12Remove some unnecessary `skip_binder` calls.Nicholas Nethercote-2/+2
`is_fn_trait_compatible` is defined on both `FnSig` and `Binder<FnSig>`.
2024-08-09Shrink `TyKind::FnPtr`.Nicholas Nethercote-9/+10
By splitting the `FnSig` within `TyKind::FnPtr` into `FnSigTys` and `FnHeader`, which can be packed more efficiently. This reduces the size of the hot `TyKind` type from 32 bytes to 24 bytes on 64-bit platforms. This reduces peak memory usage by a few percent on some benchmarks. It also reduces cache misses and page faults similarly, though this doesn't translate to clear cycles or wall-time improvements on CI.
2024-08-08Don't implement AsyncFn for FnDef/FnPtr that wouldnt implement FnMichael Goulet-21/+39
2024-08-05Elaborate supertraits in dyn candidatesMichael Goulet-6/+14
2024-08-05Enforce supertrait outlives obligations hold when confirming implMichael Goulet-0/+13
2024-07-30Rollup merge of #127574 - lcnr:coherence-check-supertrait, r=compiler-errorsMatthias Krüger-0/+12
elaborate unknowable goals A reimplemented version of #124532 affecting only the new solver. Always trying to prove super traits ends up causing a fatal overflow error in diesel, so we cannot land this in the old solver. The following test currently does not pass coherence: ```rust trait Super {} trait Sub<T>: Super {} trait Overlap<T> {} impl<T, U: Sub<T>> Overlap<T> for U {} impl<T> Overlap<T> for () {} fn main() {} ``` We check whether `(): Sub<?t>` holds. This stalls with ambiguity as downstream crates may add an impl for `(): Sub<Local>`. However, its super trait bound `(): Super` cannot be implemented downstream, so this one is known not to hold. By trying to prove that all the super bounds of a trait before adding a coherence unknowable candidate, this compiles. This is necessary to prevent breakage from enabling `-Znext-solver=coherence` (#121848), see tests/ui/coherence/super-traits/super-trait-knowable-2.rs for more details. The idea is that while there may be an impl of the trait itself we don't know about, if we're able to prove that a super trait is definitely not implemented, then that impl would also never apply/not be well-formed. This approach is different from #124532 as it allows tests/ui/coherence/super-traits/super-trait-knowable-3.rs to compile. The approach in #124532 only elaborating the root obligations while this approach tries it for all unknowable trait goals. r? `@compiler-errors`
2024-07-29Reformat `use` declarations.Nicholas Nethercote-12/+10
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-26Make coroutine-closures possible to be clonedMichael Goulet-1/+4
2024-07-12rustc_next_trait_solver: derivative -> derive-wherePavel Grigorenko-24/+17
2024-07-12enable fuzzing of `SearchGraph`lcnr-592/+114
fully move it into `rustc_type_ir` and make it independent of `Interner`.
2024-07-10elaborate unknowable goalslcnr-0/+12
if a trait is unknowable, but its super trait is definitely not implemented, then the trait itself is definitely also not implemented.
2024-07-10Rollup merge of #127508 - lcnr:search-graph-prep, r=compiler-errorsJacob Pratt-34/+32
small search graph refactor small improvements which shouldn't impact behavior. r? ``````@compiler-errors``````
2024-07-09cycle_participants to nested_goalslcnr-11/+11
2024-07-09use `update_parent_goal` for lazy updateslcnr-20/+10
2024-07-09exhaustively destructure external constraintslcnr-3/+11
2024-07-08Rollup merge of #127439 - compiler-errors:uplift-elaborate, r=lcnr许杰友 Jieyou Xu (Joe)-12/+8
Uplift elaboration into `rustc_type_ir` Allows us to deduplicate and consolidate elaboration (including these stupid elaboration duplicate fns i added for pretty printing like 3 years ago) so I'm pretty hyped about this change :3 r? lcnr
2024-07-07Finish uplifting supertraitsMichael Goulet-8/+3
2024-07-07Get rid of the redundant elaboration in middleMichael Goulet-3/+2
2024-07-07Uplift elaborationMichael Goulet-1/+3
2024-07-07Get rid of trait_ref_is_knowable from delegateMichael Goulet-10/+3
2024-07-07Uplift trait_ref_is_knowable and friendsMichael Goulet-0/+470
2024-07-06Uplift PredicateEmittingRelation firstMichael Goulet-0/+50
2024-07-05Split SolverDelegate back out from InferCtxtLikeMichael Goulet-93/+14
2024-07-03Rollup merge of #127145 - compiler-errors:as_lang_item, r=lcnrMatthias Krüger-41/+76
Add `as_lang_item` to `LanguageItems`, new trait solver Add `as_lang_item` which turns `DefId` into a `TraitSolverLangItem` in the new trait solver, so we can turn the large chain of if statements in `assemble_builtin_impl_candidates` into a match instead. r? lcnr
2024-07-02Make fn traits into first-class TraitSolverLangItems to avoid needing ↵Michael Goulet-4/+26
fn_trait_kind_from_def_id
2024-07-02add TyCtxt::as_lang_item, use in new solverMichael Goulet-37/+50
2024-07-02Rollup merge of #127146 - compiler-errors:fast-reject, r=lcnrMatthias Krüger-2/+5
Uplift fast rejection to new solver Self explanatory. r? lcnr
2024-06-30Uplift fast rejection to new solverMichael Goulet-2/+5
2024-06-29Auto merge of #120639 - fee1-dead-contrib:new-effects-desugaring, r=oli-obkbors-0/+110
Implement new effects desugaring cc `@rust-lang/project-const-traits.` Will write down notes once I have finished. * [x] See if we want `T: Tr` to desugar into `T: Tr, T::Effects: Compat<true>` * [x] Fix ICEs on `type Assoc: ~const Tr` and `type Assoc<T: ~const Tr>` * [ ] add types and traits to minicore test * [ ] update rustc-dev-guide Fixes #119717 Fixes #123664 Fixes #124857 Fixes #126148
2024-06-28address review commentsDeadbeef-7/+11
2024-06-28finishing touches, move fixed ICEs to ui testsDeadbeef-4/+4
2024-06-28general fixups and turn `TODO`s into `FIXME`sDeadbeef-5/+4
2024-06-28Implement `Min` trait in new solverDeadbeef-0/+107
2024-06-27Make queries more explicitMichael Goulet-2/+3
2024-06-25Rename tcx to cxMichael Goulet-347/+333
2024-06-24Also migrate FnInputTysMichael Goulet-5/+9
2024-06-24Replace Deref bounds on Interner in favor of a SliceLike traitMichael Goulet-59/+57
2024-06-24Split out IntoIterator and non-Iterator constructors for ↵Michael Goulet-1/+1
AliasTy/AliasTerm/TraitRef/projection
2024-06-21Rename a bunch of thingsMichael Goulet-473/+447
2024-06-18Make rustc_next_trait_solver nightly againMichael Goulet-55/+71
2024-06-18Fix transmute goalMichael Goulet-38/+26
2024-06-18Explicitly import tracing macrosMichael Goulet-7/+14
2024-06-18Fix impl for SolverDelegateMichael Goulet-8/+75
2024-06-18Uplift the new trait solverMichael Goulet-3/+7158
2024-06-18SolverDelegateMichael Goulet-10/+90
2024-06-16Add a noteMichael Goulet-0/+6
2024-06-06Uplift TypeRelation and RelateMichael Goulet-4/+4