Rollup merge of #114712 - compiler-errors:comment-nits, r=lcnr
Fix a couple of bad comments A couple of nits I saw. Sorry, this really should be folded into some other PR of mine, but I will literally forget if I don't put these up now.
This commit is contained in:
commit
5f906897f6
4 changed files with 9 additions and 9 deletions
|
@ -510,9 +510,11 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
|
||||||
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 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
|
|
||||||
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 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||||
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());
|
||||||
|
|
||||||
|
|
|
@ -2394,7 +2394,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
|
||||||
Ok(args) => args,
|
Ok(args) => args,
|
||||||
Err(()) => {
|
Err(()) => {
|
||||||
// FIXME: A rematch may fail when a candidate cache hit occurs
|
// FIXME: A rematch may fail when a candidate cache hit occurs
|
||||||
// on thefreshened form of the trait predicate, but the match
|
// on the freshened form of the trait predicate, but the match
|
||||||
// fails for some reason that is not captured in the freshened
|
// fails for some reason that is not captured in the freshened
|
||||||
// cache key. For example, equating an impl trait ref against
|
// cache key. For example, equating an impl trait ref against
|
||||||
// the placeholder trait ref may fail due the Generalizer relation
|
// the placeholder trait ref may fail due the Generalizer relation
|
||||||
|
|
|
@ -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…
Add table
Add a link
Reference in a new issue