Ensure that queries only return Copy types.

This commit is contained in:
Camille GILLOT 2022-01-31 19:55:34 +01:00
parent bf242bb119
commit 6c2ee885e6
31 changed files with 141 additions and 96 deletions

View file

@ -2509,7 +2509,13 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
};
if let Some(def_id) = def_id.as_local() {
let id = self.tcx.hir().local_def_id_to_hir_id(def_id);
self.tcx.object_lifetime_defaults(id).unwrap().iter().map(set_to_region).collect()
self.tcx
.object_lifetime_defaults(id)
.as_ref()
.unwrap()
.iter()
.map(set_to_region)
.collect()
} else {
let tcx = self.tcx;
self.xcrate_object_lifetime_defaults