Skip to content

Commit 9766192

Browse files
committed
update outdated comments
1 parent b9dc4a3 commit 9766192

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

compiler/rustc_type_ir/src/predicate.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -668,8 +668,8 @@ impl<I: Interner> fmt::Debug for ProjectionPredicate<I> {
668668
}
669669
}
670670

671-
/// Used by the new solver. Unlike a `ProjectionPredicate` this can only be
672-
/// proven by actually normalizing `alias`.
671+
/// Used by the new solver to normalize an alias. This always expects the `term` to
672+
/// be an unconstrained inference variable which is used as the output.
673673
#[derive_where(Clone, Copy, Hash, PartialEq, Eq; I: Interner)]
674674
#[derive(TypeVisitable_Generic, TypeFoldable_Generic, Lift_Generic)]
675675
#[cfg_attr(feature = "nightly", derive(TyDecodable, TyEncodable, HashStable_NoContext))]

compiler/rustc_type_ir/src/predicate_kind.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ pub enum PredicateKind<I: Interner> {
7474
Ambiguous,
7575

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

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

0 commit comments

Comments
 (0)