exhaustive matches are good

This commit is contained in:
lcnr 2023-07-17 15:11:07 +02:00
parent 55be59d2ce
commit 8a0802089c
1 changed files with 25 additions and 1 deletions

View File

@ -172,7 +172,31 @@ where
queue_type(self, component);
}
}
_ => return Some(Err(AlwaysRequiresDrop)),
ty::Foreign(_) | ty::Dynamic(..) | ty::Placeholder(_) => {
return Some(Err(AlwaysRequiresDrop));
}
ty::Bool
| ty::Char
| ty::Int(_)
| ty::Uint(_)
| ty::Float(_)
| ty::Str
| ty::Slice(_)
| ty::Ref(..)
| ty::RawPtr(..)
| ty::FnDef(..)
| ty::FnPtr(..)
| ty::Tuple(_)
| ty::Bound(..)
| ty::GeneratorWitness(..)
| ty::GeneratorWitnessMIR(..)
| ty::Never
| ty::Infer(_)
| ty::Error(_) => {
bug!("unexpected type returned by `needs_drop_components`: {component}")
}
}
}
}