+
+ fn in_return_place(&mut self, item: &Item<'_, 'tcx>) -> QualifSet {
+ // Find the `Return` terminator if one exists.
+ //
+ // If no `Return` terminator exists, this MIR is divergent. Just return the conservative
+ // qualifs for the return type.
+ let return_block = item.body
+ .basic_blocks()
+ .iter_enumerated()
+ .find(|(_, block)| {
+ match block.terminator().kind {
+ TerminatorKind::Return => true,
+ _ => false,
+ }
+ })
+ .map(|(bb, _)| bb);
+
+ let return_block = match return_block {
+ None => return QualifSet::in_any_value_of_ty(item, item.body.return_ty()),
+ Some(bb) => bb,
+ };
+
+ let return_loc = item.body.terminator_loc(return_block);
+
+ let mut qualifs = QualifSet::default();
+
+ qualifs.set::<NeedsDrop>(self.needs_drop_lazy_seek(RETURN_PLACE, return_loc));
+ qualifs.set::<HasMutInterior>(self.has_mut_interior_lazy_seek(RETURN_PLACE, return_loc));
+
+ qualifs
+ }