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

Fix a couple of bad comments #114712

Merged
merged 1 commit into from
Aug 11, 2023
Merged
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
8 changes: 5 additions & 3 deletions compiler/rustc_hir_typeck/src/coercion.rs
Original file line number Diff line number Diff line change
@@ -510,9 +510,11 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
success(adjustments, ty, obligations)
}

// &[T; n] or &mut [T; n] -> &[T]
// or &mut [T; n] -> &mut [T]
// or &Concrete -> &Trait, etc.
/// Performs [unsized coercion] by emulating a fulfillment loop on a
/// `CoerceUnsized` goal until all `CoerceUnsized` and `Unsize` goals
/// are successfully selected.
///
/// [unsized coercion](https://doc.rust-lang.org/reference/type-coercions.html#unsized-coercions)
#[instrument(skip(self), level = "debug")]
fn coerce_unsized(&self, mut source: Ty<'tcx>, mut target: Ty<'tcx>) -> CoerceResult<'tcx> {
source = self.shallow_resolve(source);
4 changes: 0 additions & 4 deletions compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs
Original file line number Diff line number Diff line change
@@ -618,8 +618,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {

match *self_ty.kind() {
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);
debug!("self_type_matches_expected_vid - found_vid={:?}", found_vid);
expected_vid == found_vid
@@ -634,8 +632,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
self_ty: ty::TyVid,
) -> 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);
trace!("pending_obligations = {:#?}", self.fulfillment_cx.borrow().pending_obligations());

2 changes: 1 addition & 1 deletion compiler/rustc_trait_selection/src/traits/select/mod.rs
Original file line number Diff line number Diff line change
@@ -2394,7 +2394,7 @@ impl<'tcx> SelectionContext<'_, 'tcx> {
Ok(args) => args,
Err(()) => {
// 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
// cache key. For example, equating an impl trait ref against
// the placeholder trait ref may fail due the Generalizer relation
4 changes: 3 additions & 1 deletion compiler/rustc_type_ir/src/sty.rs
Original file line number Diff line number Diff line change
@@ -200,7 +200,9 @@ pub enum TyKind<I: Interner> {
/// A tuple type. For example, `(i32, bool)`.
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),

/// A type parameter; for example, `T` in `fn f<T>(x: T) {}`.