Fix a comment
This commit is contained in:
parent
44be25d8a2
commit
ac6f2f0d2e
4 changed files with 6 additions and 13 deletions
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue