Comment nits
This commit is contained in:
parent
439d066bcf
commit
540afe202f
@ -510,9 +510,11 @@ fn coerce_borrowed_pointer(
|
|||||||
success(adjustments, ty, obligations)
|
success(adjustments, ty, obligations)
|
||||||
}
|
}
|
||||||
|
|
||||||
// &[T; n] or &mut [T; n] -> &[T]
|
/// Performs [unsized coercion] by emulating a fulfillment loop on a
|
||||||
// or &mut [T; n] -> &mut [T]
|
/// `CoerceUnsized` goal until all `CoerceUnsized` and `Unsize` goals
|
||||||
// or &Concrete -> &Trait, etc.
|
/// are successfully selected.
|
||||||
|
///
|
||||||
|
/// [unsized coercion](https://doc.rust-lang.org/reference/type-coercions.html#unsized-coercions)
|
||||||
#[instrument(skip(self), level = "debug")]
|
#[instrument(skip(self), level = "debug")]
|
||||||
fn coerce_unsized(&self, mut source: Ty<'tcx>, mut target: Ty<'tcx>) -> CoerceResult<'tcx> {
|
fn coerce_unsized(&self, mut source: Ty<'tcx>, mut target: Ty<'tcx>) -> CoerceResult<'tcx> {
|
||||||
source = self.shallow_resolve(source);
|
source = self.shallow_resolve(source);
|
||||||
|
@ -618,8 +618,6 @@ fn self_type_matches_expected_vid(&self, self_ty: Ty<'tcx>, expected_vid: ty::Ty
|
|||||||
|
|
||||||
match *self_ty.kind() {
|
match *self_ty.kind() {
|
||||||
ty::Infer(ty::TyVar(found_vid)) => {
|
ty::Infer(ty::TyVar(found_vid)) => {
|
||||||
// FIXME: consider using `sub_root_var` here so we
|
|
||||||
// can see through subtyping.
|
|
||||||
let found_vid = self.root_var(found_vid);
|
let found_vid = self.root_var(found_vid);
|
||||||
debug!("self_type_matches_expected_vid - found_vid={:?}", found_vid);
|
debug!("self_type_matches_expected_vid - found_vid={:?}", found_vid);
|
||||||
expected_vid == found_vid
|
expected_vid == found_vid
|
||||||
@ -634,8 +632,6 @@ pub(in super::super) fn obligations_for_self_ty<'b>(
|
|||||||
self_ty: ty::TyVid,
|
self_ty: ty::TyVid,
|
||||||
) -> impl DoubleEndedIterator<Item = traits::PredicateObligation<'tcx>> + Captures<'tcx> + 'b
|
) -> impl DoubleEndedIterator<Item = traits::PredicateObligation<'tcx>> + Captures<'tcx> + 'b
|
||||||
{
|
{
|
||||||
// FIXME: consider using `sub_root_var` here so we
|
|
||||||
// can see through subtyping.
|
|
||||||
let ty_var_root = self.root_var(self_ty);
|
let ty_var_root = self.root_var(self_ty);
|
||||||
trace!("pending_obligations = {:#?}", self.fulfillment_cx.borrow().pending_obligations());
|
trace!("pending_obligations = {:#?}", self.fulfillment_cx.borrow().pending_obligations());
|
||||||
|
|
||||||
|
@ -200,7 +200,9 @@ pub enum TyKind<I: Interner> {
|
|||||||
/// A tuple type. For example, `(i32, bool)`.
|
/// A tuple type. For example, `(i32, bool)`.
|
||||||
Tuple(I::ListTy),
|
Tuple(I::ListTy),
|
||||||
|
|
||||||
/// A projection or opaque type. Both of these types
|
/// A projection, opaque type, weak type alias, or inherent associated type.
|
||||||
|
/// All of these types are represented as pairs of def-id and args, and can
|
||||||
|
/// be normalized, so they are grouped conceptually.
|
||||||
Alias(AliasKind, I::AliasTy),
|
Alias(AliasKind, I::AliasTy),
|
||||||
|
|
||||||
/// A type parameter; for example, `T` in `fn f<T>(x: T) {}`.
|
/// A type parameter; for example, `T` in `fn f<T>(x: T) {}`.
|
||||||
|
Loading…
Reference in New Issue
Block a user