Skip to content

Commit ac6f2f0

Browse files
Fix a comment
1 parent 44be25d commit ac6f2f0

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

Diff for: compiler/rustc_hir_analysis/src/astconv/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
14621462
let traits: Vec<_> =
14631463
self.probe_traits_that_match_assoc_ty(qself_ty, assoc_ident);
14641464

1465-
// Don't print `TyErr` to the user.
1465+
// Don't print `ty::Error` to the user.
14661466
self.report_ambiguous_associated_type(
14671467
span,
14681468
&[qself_ty.to_string()],

Diff for: compiler/rustc_hir_typeck/src/closure.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
795795

796796
/// Converts the types that the user supplied, in case that doing
797797
/// so should yield an error, but returns back a signature where
798-
/// all parameters are of type `TyErr`.
798+
/// all parameters are of type `ty::Error`.
799799
fn error_sig_of_closure(
800800
&self,
801801
decl: &hir::FnDecl<'_>,

Diff for: compiler/rustc_middle/src/ty/adt.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -562,16 +562,8 @@ impl<'tcx> AdtDef<'tcx> {
562562
tcx.adt_destructor(self.did())
563563
}
564564

565-
/// Returns a list of types such that `Self: Sized` if and only
566-
/// if that type is `Sized`, or `TyErr` if this type is recursive.
567-
///
568-
/// Oddly enough, checking that the sized-constraint is `Sized` is
569-
/// actually more expressive than checking all members:
570-
/// the `Sized` trait is inductive, so an associated type that references
571-
/// `Self` would prevent its containing ADT from being `Sized`.
572-
///
573-
/// Due to normalization being eager, this applies even if
574-
/// the associated type is behind a pointer (e.g., issue #31299).
565+
/// Returns a list of types such that `Self: Sized` if and only if that
566+
/// type is `Sized`, or `ty::Error` if this type has a recursive layout.
575567
pub fn sized_constraint(self, tcx: TyCtxt<'tcx>) -> ty::EarlyBinder<&'tcx ty::List<Ty<'tcx>>> {
576568
tcx.adt_sized_constraint(self.did())
577569
}

Diff for: compiler/rustc_ty_utils/src/ty.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ fn sized_constraint_for_ty<'tcx>(
6262
let predicates = tcx.predicates_of(adtdef.did()).predicates;
6363
if predicates.iter().any(|(p, _)| {
6464
p.as_trait_clause().is_some_and(|trait_pred| {
65-
trait_pred.def_id() == sized_trait_def_id && trait_pred.self_ty().skip_binder() == ty
65+
trait_pred.def_id() == sized_trait_def_id
66+
&& trait_pred.self_ty().skip_binder() == ty
6667
})
6768
}) {
6869
vec![]

0 commit comments

Comments
 (0)