File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/tools/rust-analyzer/crates/hir-ty/src/infer Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -917,9 +917,19 @@ impl<'a> InferenceTable<'a> {
917917 /// Check if given type is `Sized` or not
918918 pub ( crate ) fn is_sized ( & mut self , ty : & Ty ) -> bool {
919919 // Early return for some obvious types
920- if matches ! ( ty. kind( Interner ) , TyKind :: Scalar ( ..) | TyKind :: Ref ( ..) | TyKind :: Raw ( ..) ) {
920+ if matches ! (
921+ ty. kind( Interner ) ,
922+ TyKind :: Scalar ( ..)
923+ | TyKind :: Ref ( ..)
924+ | TyKind :: Raw ( ..)
925+ | TyKind :: Never
926+ | TyKind :: FnDef ( ..)
927+ | TyKind :: Array ( ..)
928+ | TyKind :: Function ( _)
929+ ) {
921930 return true ;
922931 }
932+
923933 if let Some ( ( AdtId :: StructId ( id) , subst) ) = ty. as_adt ( ) {
924934 let struct_data = self . db . struct_data ( id) ;
925935 if let Some ( ( last_field, _) ) = struct_data. variant_data . fields ( ) . iter ( ) . last ( ) {
You can’t perform that action at this time.
0 commit comments