File tree 1 file changed +11
-1
lines changed
src/tools/rust-analyzer/crates/hir-ty/src/infer
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> {
917
917
/// Check if given type is `Sized` or not
918
918
pub ( crate ) fn is_sized ( & mut self , ty : & Ty ) -> bool {
919
919
// 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
+ ) {
921
930
return true ;
922
931
}
932
+
923
933
if let Some ( ( AdtId :: StructId ( id) , subst) ) = ty. as_adt ( ) {
924
934
let struct_data = self . db . struct_data ( id) ;
925
935
if let Some ( ( last_field, _) ) = struct_data. variant_data . fields ( ) . iter ( ) . last ( ) {
You can’t perform that action at this time.
0 commit comments