1
Fork 0

add #[rustc_pass_by_value] to more types

This commit is contained in:
lcnr 2022-03-08 15:39:52 +01:00
parent 67b3e81838
commit b8135fd5c8
27 changed files with 165 additions and 152 deletions

View file

@ -86,7 +86,7 @@ impl<'tcx> FreeRegionMap<'tcx> {
/// Check whether `r_a <= r_b` is found in the relation.
fn check_relation(&self, r_a: Region<'tcx>, r_b: Region<'tcx>) -> bool {
r_a == r_b || self.relation.contains(&r_a, &r_b)
r_a == r_b || self.relation.contains(r_a, r_b)
}
/// True for free regions other than `'static`.
@ -119,9 +119,9 @@ impl<'tcx> FreeRegionMap<'tcx> {
let result = if r_a == r_b {
r_a
} else {
match self.relation.postdom_upper_bound(&r_a, &r_b) {
match self.relation.postdom_upper_bound(r_a, r_b) {
None => tcx.lifetimes.re_static,
Some(r) => *r,
Some(r) => r,
}
};
debug!("lub_free_regions(r_a={:?}, r_b={:?}) = {:?}", r_a, r_b, result);
@ -132,6 +132,6 @@ impl<'tcx> FreeRegionMap<'tcx> {
impl<'a, 'tcx> Lift<'tcx> for FreeRegionMap<'a> {
type Lifted = FreeRegionMap<'tcx>;
fn lift_to_tcx(self, tcx: TyCtxt<'tcx>) -> Option<FreeRegionMap<'tcx>> {
self.relation.maybe_map(|&fr| tcx.lift(fr)).map(|relation| FreeRegionMap { relation })
self.relation.maybe_map(|fr| tcx.lift(fr)).map(|relation| FreeRegionMap { relation })
}
}