about summary refs log tree commit diff
path: root/compiler/rustc_infer/src
AgeCommit message (Collapse)AuthorLines
2023-07-04Replace `const_error` methods with `Const::new_error`Boxy-2/+2
2023-07-04Replace `mk_const` with `Const::new_x` methodsBoxy-23/+26
2023-07-04`TypeParameterDefinition` always require a `DefId`lcnr-5/+5
2023-07-04Auto merge of #113303 - compiler-errors:yeet-chalk, r=lcnrbors-5/+1
Remove chalk support from the compiler Removes chalk (`-Ztrait-solver=chalk`) from the compiler and prunes any dead code resulting from this, mainly: * Remove the chalk compatibility layer in `compiler/rustc_traits/src/chalk` * Remove the chalk flag `-Ztrait-solver=chalk` and its `TraitEngine` implementation * Remove `TypeWellFormedFromEnv` (and its many `bug!()` match arms) * Remove the chalk migration mode from compiletest * Remove the `chalkify` UI tests (do we want to keep any of these, but migrate them to `-Ztrait-solver=next`??) Fulfills rust-lang/types-team#93. r? `@jackh726`
2023-07-04 -Ztrait-solver=next: stop depending on old solverlcnr-24/+13
2023-07-04Auto merge of #113215 - compiler-errors:rpitit-predicates-tweaks, r=spastorinobors-1/+3
Make RPITITs assume/require their parent method's predicates Removes a FIXME from the `param_env` query where we were manually adding the parent function's predicates to the RPITIT's assumptions. r? `@spastorino`
2023-07-03remove TypeWellFormedFromEnvMichael Goulet-5/+1
2023-07-03add deep normalization via the new solverlcnr-0/+1
2023-07-01Auto merge of #113154 - lcnr:better-probe-check, r=compiler-errorsbors-33/+14
change snapshot tracking in fulfillment contexts use the exact snapshot number to prevent misuse even when created inside of a snapshot
2023-06-30RPITITs inherit method predicatesMichael Goulet-1/+3
2023-06-29change snapshot tracking in fulfillment contextslcnr-33/+14
2023-06-29Make the Elaboratable trait take clausesMichael Goulet-40/+42
2023-06-27avoid using `format!("{}", ..)`Takayuki Maeda-2/+2
2023-06-26TypeWellFormedInEnvMichael Goulet-2/+3
2023-06-26Migrate predicates_of and caller_bounds to ClauseMichael Goulet-29/+19
2023-06-24Rollup merge of #112703 - aliemjay:next-solver-root-var, r=compiler-errorsGuillaume Gomez-0/+1
[-Ztrait-solver=next, mir-typeck] instantiate hidden types in the root universe Fixes an ICE in the test `member-constraints-in-root-universe`. Main motivation is to make #112691 pass under the new solver. r? ``@compiler-errors``
2023-06-24instantiate hidden types in root universeAli MJ Al-Nasrawy-0/+1
2023-06-23Auto merge of #112891 - oli-obk:impl_trait_in_assoc_tys_cleanup, ↵bors-9/+3
r=compiler-errors Various impl trait in assoc tys cleanups r? `@compiler-errors` All commits except for the last are pure refactorings. 274dab5bd658c97886a8987340bf50ae57900c39 allows struct fields to participate in deciding whether a function has an opaque in its signature. best reviewed commit by commit
2023-06-22Expect clause moreMichael Goulet-4/+4
2023-06-22Migrate item_bounds to ty::ClauseMichael Goulet-7/+25
2023-06-22Point to argument/return type instead of the whole function headerOli Scherer-1/+2
2023-06-22Move `opaque_type_origin_unchecked` onto `TyCtxt` and re-use it where it was ↵Oli Scherer-8/+1
open coded
2023-06-21Rollup merge of #112772 - compiler-errors:clauses-1, r=lcnrNilstrieb-37/+60
Add a fully fledged `Clause` type, rename old `Clause` to `ClauseKind` Does two basic things before I put up a more delicate set of PRs (along the lines of #112714, but hopefully much cleaner) that migrate existing usages of `ty::Predicate` to `ty::Clause` (`predicates_of`/`item_bounds`/`ParamEnv::caller_bounds`). 1. Rename `Clause` to `ClauseKind`, so it's parallel with `PredicateKind`. 2. Add a new `Clause` type which is parallel to `Predicate`. * This type exposes `Clause::kind(self) -> Binder<'tcx, ClauseKind<'tcx>>` which is parallel to `Predicate::kind` 😸 The new `Clause` type essentially acts as a newtype wrapper around `Predicate` that asserts that it is specifically a `PredicateKind::Clause`. Turns out from experimentation[^1] that this is not negative performance-wise, which is wonderful, since this a much simpler design than something that requires encoding the discriminant into the alignment bits of a predicate kind, or something else like that... r? ``@lcnr`` or ``@oli-obk`` [^1]: https://github.com/rust-lang/rust/pull/112714#issuecomment-1595653910
2023-06-19Rollup merge of #112781 - compiler-errors:new-solver-tait-overlaps-hidden, ↵Michael Goulet-4/+6
r=lcnr Don't consider TAIT normalizable to hidden ty if it would result in impossible item bounds See test for example where we shouldn't consider it possible to alias-relate a TAIT and hidden type. r? `@lcnr`
2023-06-19Fully fledged Clause typeMichael Goulet-0/+20
2023-06-19s/Clause/ClauseKindMichael Goulet-37/+40
2023-06-19Don't consider TAIT normalizable to hidden ty if it would result in ↵Michael Goulet-4/+6
impossible item bounds
2023-06-18Treat TAIT equation as always ambiguous in coherenceMichael Goulet-7/+4
2023-06-17Move ConstEvaluatable to ClauseMichael Goulet-2/+2
2023-06-17Move WF goal to clauseMichael Goulet-3/+3
2023-06-16Add `AliasKind::Weak` for type aliases.Oli Scherer-0/+1
Only use it when the type alias contains an opaque type. Also does wf-checking on such type aliases.
2023-06-12extend assertlcnr-3/+3
2023-06-11Rollup merge of #112513 - compiler-errors:dont-compute-box-span-for-tait, ↵Matthias Krüger-1/+19
r=cjgillot Dont compute `opt_suggest_box_span` span for TAIT Fixes #112434 Also a couple more commits on top, pruning some dead code and fixing another weird suggestion encountered in the above issue.
2023-06-11Don't suggest boxing an empty if/else armMichael Goulet-1/+19
2023-06-09split opaque type handling in new solverlcnr-36/+47
be more explicit in where we only add new hidden types and where we also have to deal with item bounds.
2023-06-09recompute opaque type originlcnr-20/+11
2023-06-08Don't suggest cyclic associated type constraintMichael Goulet-0/+6
2023-06-08More robust as_ref/as_deref suggestionsMichael Goulet-49/+3
2023-06-07Rollup merge of #112122 - compiler-errors:next-coherence, r=lcnrDylan DPC-27/+43
Add `-Ztrait-solver=next-coherence` Flag that conditionally uses the trait solver *only* during coherence, for more testing and/or eventual partial-migration onto the trait solver (in the medium- to long-term). * This still uses the selection context in some of the coherence methods I think, so it's not "complete". Putting this up for review and/or for further work in-tree. * I probably need to spend a bit more time making sure that we don't sneakily create any other infcx's during coherence that also need the new solver enabled. r? `@lcnr`
2023-06-07Auto merge of #111047 - compiler-errors:rtn-no-ty-ct-params, r=spastorinobors-1/+0
Emit an error when return-type-notation is used with type/const params These are not intended to be supported initially, even though the compiler supports them internally...
2023-06-06Fix comment for `get_region_var_origins`Nilstrieb-5/+5
2023-06-06Make TraitEngine::new use the right solver, add compare modeMichael Goulet-11/+9
2023-06-06New trait solver is a property of inference contextMichael Goulet-27/+45
2023-06-05Remove redundant InferCtxtExt::fresh_item_substsMichael Goulet-1/+0
2023-06-02Normalize anon consts in new solverMichael Goulet-1/+1
2023-06-02No more TyCtxt::lazy_normalizationMichael Goulet-1/+1
2023-06-01Rename `impl_defaultness` to `defaultness`Deadbeef-1/+1
2023-05-30change redundant `clear()` to assertionlcnr-4/+2
2023-05-30rework the leak_check to take the outer_universelcnr-111/+106
clean up coherence to not rely on probes anymore
2023-05-30coherence: don't add hidden types for opaqueslcnr-10/+22
we can otherwise assign a hidden type to the opaque which causes ICE if we don't use `take_opaque_types` during coherence. This is annoying so I didn't bother. Added a test showing the behavior this prevents.