summary refs log tree commit diff
path: root/compiler/rustc_infer/src
AgeCommit message (Collapse)AuthorLines
2023-07-08Auto merge of #113474 - compiler-errors:rollup-07x1up7, r=compiler-errorsbors-11/+0
Rollup of 8 pull requests Successful merges: - #113413 (Add needs-triage to all new issues) - #113426 (Don't ICE in `resolve_bound_vars` when associated return-type bounds are in bad positions) - #113427 (Remove `variances_of` on RPITIT GATs, remove its one use-case) - #113441 (miri: check that assignments do not self-overlap) - #113453 (Remove unused from_method from rustc_on_unimplemented) - #113456 (Avoid calling report_forbidden_specialization for RPITITs) - #113466 (Update cargo) - #113467 (Fix comment of `fn_can_unwind`) r? `@ghost` `@rustbot` modify labels: rollup
2023-07-07Rollup merge of #113427 - compiler-errors:no-variances-of-rpitit-gat, ↵Michael Goulet-11/+0
r=spastorino Remove `variances_of` on RPITIT GATs, remove its one use-case It doesn't make sense to implement variances on a GAT anyways, since we don't relate GATs with variance: https://github.com/rust-lang/rust/blob/85bf07972a1041b9e25393b803d0e006bec3eaaf/compiler/rustc_middle/src/ty/relate.rs#L569-L579 r? ``@spastorino``
2023-07-08Auto merge of #112652 - oli-obk:tait_only_in_sig, r=compiler-errorsbors-1/+1
Require TAITs to be mentioned in the signatures of functions that register hidden types for them r? `@lcnr` `@compiler-errors` This implements the lang team decision from [the TAIT design meeting](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/design.20meeting.202023-05-31.20TAITs/near/362518164).
2023-07-07Require TAITs to be mentioned in the signatures of functions that register ↵Oli Scherer-1/+1
hidden types for them
2023-07-07Auto merge of #113308 - compiler-errors:poly-select, r=lcnrbors-3/+4
Split `SelectionContext::select` into fns that take a binder and don't *most* usages of `SelectionContext::select` don't need to use a binder, but wrap them in a dummy because of the signature. Let's split this out into `SelectionContext::{select,poly_select}` and limit the usages of the latter. Right now, we only have 3 places where we're calling `poly_select` -- fulfillment, internally within the old solver, and the auto-trait finder. r? `@lcnr`
2023-07-07Remove variances_of on RPITIT gats, remove its one use-caseMichael Goulet-11/+0
2023-07-06Avoid calling item_name for RPITITSantiago Pastorino-3/+5
2023-07-06Separate select calls that don't need a binderMichael Goulet-0/+1
2023-07-06TraitObligation -> PolyTraitObligationMichael Goulet-3/+3
2023-07-05Move `TyCtxt::mk_x` to `Ty::new_x` where applicableBoxy-42/+45
2023-07-05Rollup merge of #113319 - lcnr:type-param-def-def-id, r=compiler-errorsMichael Goulet-5/+5
`TypeParameterDefinition` always require a `DefId` the `None` case never actually reaches diagnostics so it feels better for diagnostics to be able to rely on the `DefId` being there, cc #113310
2023-07-05Rollup merge of #113317 - lcnr:sketchy-new-select, r=oli-obkMichael Goulet-24/+13
-Ztrait-solver=next: stop depending on old solver removes the final dependencies on the old solver when `-Ztrait-solver=next` is enabled.
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