File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
compiler/rustc_middle/src/ty Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -2280,6 +2280,12 @@ impl<'tcx> TyS<'tcx> {
2280
2280
///
2281
2281
/// Returning true means the type is known to be sized. Returning
2282
2282
/// `false` means nothing -- could be sized, might not be.
2283
+ ///
2284
+ /// Note that we could never rely on the fact that a type such as `[_]` is
2285
+ /// trivially `!Sized` because we could be in a type environment with a
2286
+ /// bound such as `[_]: Copy`. A function with such a bound obviously never
2287
+ /// can be called, but that doesn't mean it shouldn't typecheck. This is why
2288
+ /// this method doesn't return `Option<bool>`.
2283
2289
pub fn is_trivially_sized ( & self , tcx : TyCtxt < ' tcx > ) -> bool {
2284
2290
match self . kind ( ) {
2285
2291
ty:: Infer ( ty:: IntVar ( _) | ty:: FloatVar ( _) )
You can’t perform that action at this time.
0 commit comments