Rollup merge of #76641 - nox:pointee-random-stuff, r=eddyb
Some cleanup changes and commenting r? @nikomatsakis Cc @eddyb
This commit is contained in:
commit
0bcc96dd3d
4 changed files with 13 additions and 22 deletions
|
@ -2280,6 +2280,12 @@ impl<'tcx> TyS<'tcx> {
|
|||
///
|
||||
/// Returning true means the type is known to be sized. Returning
|
||||
/// `false` means nothing -- could be sized, might not be.
|
||||
///
|
||||
/// Note that we could never rely on the fact that a type such as `[_]` is
|
||||
/// trivially `!Sized` because we could be in a type environment with a
|
||||
/// bound such as `[_]: Copy`. A function with such a bound obviously never
|
||||
/// can be called, but that doesn't mean it shouldn't typecheck. This is why
|
||||
/// this method doesn't return `Option<bool>`.
|
||||
pub fn is_trivially_sized(&self, tcx: TyCtxt<'tcx>) -> bool {
|
||||
match self.kind() {
|
||||
ty::Infer(ty::IntVar(_) | ty::FloatVar(_))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue