diff options
| author | Michael Goulet <michael@errs.io> | 2022-11-10 21:29:20 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-11-10 21:29:20 +0000 |
| commit | fea8d0eb999dbe732a70cd61518d79195c139b2c (patch) | |
| tree | 8d86b7043de91534913675d300b3c3d0a2b50151 /compiler/rustc_middle/src | |
| parent | 43ad19b2506c4e4ce6204e3ecf8b35869bd76eff (diff) | |
More nits
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/ty/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index b509ae6dd3b..18eb06b83c9 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -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>> { |
