Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update outdated comments #130927

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/rustc_type_ir/src/predicate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -668,8 +668,8 @@ impl<I: Interner> fmt::Debug for ProjectionPredicate<I> {
}
}

/// Used by the new solver. Unlike a `ProjectionPredicate` this can only be
/// proven by actually normalizing `alias`.
/// Used by the new solver to normalize an alias. This always expects the `term` to
/// be an unconstrained inference variable which is used as the output.
#[derive_where(Clone, Copy, Hash, PartialEq, Eq; I: Interner)]
#[derive(TypeVisitable_Generic, TypeFoldable_Generic, Lift_Generic)]
#[cfg_attr(feature = "nightly", derive(TyDecodable, TyEncodable, HashStable_NoContext))]
Expand Down
12 changes: 6 additions & 6 deletions compiler/rustc_type_ir/src/predicate_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ pub enum PredicateKind<I: Interner> {
Ambiguous,

/// This should only be used inside of the new solver for `AliasRelate` and expects
/// the `term` to be an unconstrained inference variable.
/// the `term` to be always be an unconstrained inference variable. It is used to
/// normalize `alias` as much as possible. In case the alias is rigid - i.e. it cannot
/// be normalized in the current environment - this constrains `term` to be equal to
/// the alias itself.
///
/// The alias normalizes to `term`. Unlike `Projection`, this always fails if the
/// alias cannot be normalized in the current context. For the rigid alias
/// `T as Trait>::Assoc`, `Projection(<T as Trait>::Assoc, ?x)` constrains `?x`
/// to `<T as Trait>::Assoc` while `NormalizesTo(<T as Trait>::Assoc, ?x)`
/// results in `NoSolution`.
/// It is likely more useful to think of this as a function `normalizes_to(alias)`,
/// whose return value is written into `term`.
NormalizesTo(ty::NormalizesTo<I>),

/// Separate from `ClauseKind::Projection` which is used for normalization in new solver.
Expand Down
Loading