about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/solve/project_goals.rs
AgeCommit message (Collapse)AuthorLines
2024-06-18Uplift the new trait solverMichael Goulet-27/+0
2024-06-18SolverDelegateMichael Goulet-2/+2
2024-05-28EvalCtxt::tcx() -> EvalCtxt::interner()Michael Goulet-1/+1
2024-05-19Make EvalCtxt generic over internerMichael Goulet-1/+2
2024-05-13split out AliasTy -> AliasTermMichael Goulet-13/+1
2024-05-12solve: replace all `debug` with `trace`lcnr-1/+1
2023-12-18track the source of nested goalslcnr-2/+5
2023-12-14Unconditionally register alias-relate in projection goalMichael Goulet-11/+23
2023-12-08implement and use `NormalizesTo`lcnr-0/+23
2023-10-10reorder files in solvelcnr-636/+0
2023-09-29a small wf and clause cleanuplcnr-5/+4
2023-09-26Don't store lazyness in DefKindMichael Goulet-1/+1
2023-09-23Remove GeneratorWitness and rename GeneratorWitnessMIR.Camille GILLOT-2/+0
2023-09-20remove `impl<'tcx> ToPredicate<'tcx, Clause<'tcx>> for ↵Ziru Niu-4/+6
PolyProjectionPredicate<'tcx>`
2023-09-11inspect: strongly typed CandidateKindlcnr-6/+7
2023-09-03Don't ICE on associated type projection without feature gateMichael Goulet-1/+15
2023-08-15Rollup merge of #114831 - ↵Guillaume Gomez-7/+15
compiler-errors:next-solver-projection-subst-compat, r=lcnr Check projection args before substitution in new solver Don't ICE when an impl has the wrong kind of GAT arguments r? lcnr
2023-08-15Check projection arguments before substitutionMichael Goulet-7/+15
2023-08-15Separate consider_unsize_to_dyn_candidate from other unsize candidatesMichael Goulet-1/+8
2023-08-08Rollup merge of #114566 - fmease:type-alias-laziness-is-crate-specific, ↵Matthias Krüger-1/+1
r=oli-obk Store the laziness of type aliases in their `DefKind` Previously, we would treat paths referring to type aliases as *lazy* type aliases if the current crate had lazy type aliases enabled independently of whether the crate which the alias was defined in had the feature enabled or not. With this PR, the laziness of a type alias depends on the crate it is defined in. This generally makes more sense to me especially if / once lazy type aliases become the default in a new edition and we need to think about *edition interoperability*: Consider the hypothetical case where the dependency crate has an older edition (and thus eager type aliases), it exports a type alias with bounds & a where-clause (which are void but technically valid), the dependent crate has the latest edition (and thus lazy type aliases) and it uses that type alias. Arguably, the bounds should *not* be checked since at any time, the dependency crate should be allowed to change the bounds at will with a *non*-major version bump & without negatively affecting downstream crates. As for the reverse case (dependency: lazy type aliases, dependent: eager type aliases), I guess it rules out anything from slight confusion to mild annoyance from upstream crate authors that would be caused by the compiler ignoring the bounds of their type aliases in downstream crates with older editions. --- This fixes #114468 since before, my assumption that the type alias associated with a given weak projection was lazy (and therefore had its variances computed) did not necessarily hold in cross-crate scenarios (which [I kinda had a hunch about](https://github.com/rust-lang/rust/pull/114253#discussion_r1278608099)) as outlined above. Now it does hold. `@rustbot` label F-lazy_type_alias r? `@oli-obk`
2023-08-07Store the laziness of type aliases in the DefKindLeón Orell Valerian Liehr-1/+1
2023-08-03avoid more `ty::Binder:dummy`lcnr-12/+6
2023-07-28refactor builtin unsize handling, extend commentslcnr-1/+1
2023-07-25Make everything builtin!Michael Goulet-1/+2
2023-07-25Consolidate trait upcasting and unsize into one normalizationMichael Goulet-10/+3
2023-07-20assembly: only consider blanket impls oncelcnr-2/+10
2023-07-16Check GAT, IAT, and weak type where clauses during projectionMichael Goulet-0/+16
2023-07-16Add support for inherent projectionsMichael Goulet-1/+1
2023-07-14refactor(rustc_middle): Substs -> GenericArgMahdi Dibaiee-32/+30
2023-07-12Re-format let-else per rustfmt updateMark Rousskov-79/+78
2023-07-06add helper methods for accessing struct tailLukas Markeffsky-1/+1
2023-07-05Move `TyCtxt::mk_x` to `Ty::new_x` where applicableBoxy-2/+2
2023-07-05Auto merge of #113329 - lcnr:probe_candidate, r=BoxyUwUbors-95/+84
add `ecx.probe_candidate` Not yet changing the candidate source to an enum because that would be more involved, but this by itself should already be a significant improvement imo r? `@BoxyUwU`
2023-07-04add `ecx.probe_candidate`lcnr-95/+84
2023-07-04Replace `const_error` methods with `Const::new_error`Boxy-5/+4
2023-06-21Rollup merge of #112772 - compiler-errors:clauses-1, r=lcnrNilstrieb-1/+1
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-20split probe into 2 functions for better readabilitylcnr-19/+16
2023-06-19Fully fledged Clause typeMichael Goulet-1/+1
2023-06-19s/Clause/ClauseKindMichael Goulet-1/+1
2023-06-19introduce a separate set of types for finalized proof treesBoxy-21/+31
2023-06-19initial info dumpBoxy-156/+166
2023-06-17Auto merge of #108860 - oli-obk:tait_alias, r=compiler-errorsbors-0/+1
Add `AliasKind::Weak` for type aliases. `type Foo<T: Debug> = Bar<T>;` does not check `T: Debug` at use sites of `Foo<NotDebug>`, because in contrast to a ```rust trait Identity { type Identity; } impl<T: Debug> Identity for T { type Identity = T; } <NotDebug as Identity>::Identity ``` type aliases do not exist in the type system, but are expanded to their aliased type immediately when going from HIR to the type layer. Similarly: * a private type alias for a public type is a completely fine thing, even though it makes it a bit hard to write out complex times sometimes * rustdoc expands the type alias, even though often times users use them for documentation purposes * diagnostics show the expanded type, which is confusing if the user wrote a type alias and the diagnostic talks about another type that they don't know about. For type alias impl trait, these issues do not actually apply in most cases, but sometimes you have a type alias impl trait like `type Foo<T: Debug> = (impl Debug, Bar<T>);`, which only really checks it for `impl Debug`, but by accident prevents `Bar<T>` from only being instantiated after proving `T: Debug`. This PR makes sure that we always check these bounds explicitly and don't rely on an implementation accident. To not break all the type aliases out there, we only use it when the type alias contains an opaque type. We can decide to do this for all type aliases over an edition. Or we can later extend this to more types if we figure out the back-compat concerns with suddenly checking such bounds. As a side effect, easily allows fixing https://github.com/rust-lang/rust/issues/108617, which I did. fixes https://github.com/rust-lang/rust/issues/108617
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-15Make assumption functions in new solver take clauseMichael Goulet-4/+4
2023-06-02Rollup merge of #112223 - compiler-errors:new-solver-auto-proj, r=BoxyUwUMichael Goulet-2/+6
Don't ICE in new solver when auto traits have associated types People can write malformed auto traits, and that shouldn't cause the new solver to ICE
2023-06-02Elaborate comment, make sure we do normalizes-to hack eventually for IATs, ↵Michael Goulet-26/+29
don't partially support const projection for impls
2023-06-02Normalize anon consts in new solverMichael Goulet-17/+47
2023-06-02Don't ICE in new solver when auto traits have associated typesMichael Goulet-2/+6
2023-05-25Prepopulate opaques in canonical inputMichael Goulet-14/+15
2023-05-25Pull out logic from #111131, plus some new logic in ↵Michael Goulet-2/+7
EvalCtxt::normalize_opaque_type Co-authored-by: lcnr <rust@lcnr.de>