diff options
| author | Michael Goulet <michael@errs.io> | 2023-08-01 00:59:59 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-08-01 23:10:38 +0000 |
| commit | ac6f2f0d2e6cb149f80903654cd603692bd06761 (patch) | |
| tree | 5a6ce7702dfd4ba5874d1f13ace42e08358c6214 | |
| parent | 44be25d8a2262a77ada651f0129b0ea6f8cb4755 (diff) | |
Fix a comment
| -rw-r--r-- | compiler/rustc_hir_analysis/src/astconv/mod.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_hir_typeck/src/closure.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/adt.rs | 12 | ||||
| -rw-r--r-- | compiler/rustc_ty_utils/src/ty.rs | 3 |
4 files changed, 6 insertions, 13 deletions
diff --git a/compiler/rustc_hir_analysis/src/astconv/mod.rs b/compiler/rustc_hir_analysis/src/astconv/mod.rs index 3235a9ceba1..bc109e7ad51 100644 --- a/compiler/rustc_hir_analysis/src/astconv/mod.rs +++ b/compiler/rustc_hir_analysis/src/astconv/mod.rs @@ -1462,7 +1462,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o { let traits: Vec<_> = self.probe_traits_that_match_assoc_ty(qself_ty, assoc_ident); - // Don't print `TyErr` to the user. + // Don't print `ty::Error` to the user. self.report_ambiguous_associated_type( span, &[qself_ty.to_string()], diff --git a/compiler/rustc_hir_typeck/src/closure.rs b/compiler/rustc_hir_typeck/src/closure.rs index 0624a4baf79..3e67afb1c3d 100644 --- a/compiler/rustc_hir_typeck/src/closure.rs +++ b/compiler/rustc_hir_typeck/src/closure.rs @@ -795,7 +795,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { /// Converts the types that the user supplied, in case that doing /// so should yield an error, but returns back a signature where - /// all parameters are of type `TyErr`. + /// all parameters are of type `ty::Error`. fn error_sig_of_closure( &self, decl: &hir::FnDecl<'_>, diff --git a/compiler/rustc_middle/src/ty/adt.rs b/compiler/rustc_middle/src/ty/adt.rs index 1bbbc0b8f7b..6ba13a76563 100644 --- a/compiler/rustc_middle/src/ty/adt.rs +++ b/compiler/rustc_middle/src/ty/adt.rs @@ -562,16 +562,8 @@ impl<'tcx> AdtDef<'tcx> { tcx.adt_destructor(self.did()) } - /// Returns a list of types such that `Self: Sized` if and only - /// if that type is `Sized`, or `TyErr` if this type is recursive. - /// - /// Oddly enough, checking that the sized-constraint is `Sized` is - /// actually more expressive than checking all members: - /// the `Sized` trait is inductive, so an associated type that references - /// `Self` would prevent its containing ADT from being `Sized`. - /// - /// Due to normalization being eager, this applies even if - /// the associated type is behind a pointer (e.g., issue #31299). + /// Returns a list of types such that `Self: Sized` if and only if that + /// type is `Sized`, or `ty::Error` if this type has a recursive layout. pub fn sized_constraint(self, tcx: TyCtxt<'tcx>) -> ty::EarlyBinder<&'tcx ty::List<Ty<'tcx>>> { tcx.adt_sized_constraint(self.did()) } diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs index 08c405dfbcc..ba0258b63cb 100644 --- a/compiler/rustc_ty_utils/src/ty.rs +++ b/compiler/rustc_ty_utils/src/ty.rs @@ -62,7 +62,8 @@ fn sized_constraint_for_ty<'tcx>( let predicates = tcx.predicates_of(adtdef.did()).predicates; if predicates.iter().any(|(p, _)| { p.as_trait_clause().is_some_and(|trait_pred| { - trait_pred.def_id() == sized_trait_def_id && trait_pred.self_ty().skip_binder() == ty + trait_pred.def_id() == sized_trait_def_id + && trait_pred.self_ty().skip_binder() == ty }) }) { vec![] |
