1
Fork 0

More nits

This commit is contained in:
Michael Goulet 2022-11-10 21:29:20 +00:00
parent 43ad19b250
commit fea8d0eb99
3 changed files with 19 additions and 4 deletions

View file

@ -2506,6 +2506,10 @@ impl<'tcx> TyCtxt<'tcx> {
self.trait_def(trait_def_id).has_auto_impl
}
pub fn trait_is_coinductive(self, trait_def_id: DefId) -> bool {
self.trait_is_auto(trait_def_id) || self.lang_items().sized_trait() == Some(trait_def_id)
}
/// Returns layout of a generator. Layout might be unavailable if the
/// generator is tainted by errors.
pub fn generator_layout(self, def_id: DefId) -> Option<&'tcx GeneratorLayout<'tcx>> {