Skip to content

Commit 02d1504

Browse files
committed
fix docs
1 parent 85d9dae commit 02d1504

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

src/librustc/infer/outlives/verify.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,11 @@ impl<'cx, 'tcx> VerifyBoundCx<'cx, 'tcx> {
144144
.map(|r| VerifyBound::OutlivedBy(r)),
145145
);
146146

147-
// see the extensive comment in projection_must_outlive
148-
let ty = self.tcx.mk_projection(projection_ty.item_def_id, projection_ty.substs);
149-
let recursive_bound = self.recursive_type_bound(ty);
150-
151-
VerifyBound::AnyBound(bounds).or(recursive_bound)
147+
VerifyBound::AnyBound(bounds).or(|| {
148+
// see the extensive comment in projection_must_outlive
149+
let ty = self.tcx.mk_projection(projection_ty.item_def_id, projection_ty.substs);
150+
self.recursive_type_bound(ty)
151+
})
152152
}
153153

154154
fn recursive_type_bound(&self, ty: Ty<'tcx>) -> VerifyBound<'tcx> {

src/librustc/infer/region_constraints/mod.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -904,13 +904,18 @@ impl<'tcx> VerifyBound<'tcx> {
904904
}
905905
}
906906

907-
pub fn or(self, vb: VerifyBound<'tcx>) -> VerifyBound<'tcx> {
908-
if self.must_hold() || vb.cannot_hold() {
907+
pub fn or(self, vb: impl FnOnce() -> VerifyBound<'tcx>) -> VerifyBound<'tcx> {
908+
if self.must_hold() {
909909
self
910-
} else if self.cannot_hold() || vb.must_hold() {
911-
vb
912910
} else {
913-
VerifyBound::AnyBound(vec![self, vb])
911+
let vb = vb();
912+
if vb.cannot_hold() {
913+
self
914+
} else if self.cannot_hold() || vb.must_hold() {
915+
vb
916+
} else {
917+
VerifyBound::AnyBound(vec![self, vb])
918+
}
914919
}
915920
}
916921

src/librustc/ty/sty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2204,7 +2204,7 @@ impl<'tcx> TyS<'tcx> {
22042204
}
22052205
}
22062206

2207-
/// Pushes onto `out` the regions directly referenced from this type (but not
2207+
/// Returns the regions directly referenced from this type (but not
22082208
/// types reachable from this type via `walk_tys`). This ignores late-bound
22092209
/// regions binders.
22102210
pub fn regions(&self) -> impl Iterator<Item = ty::Region<'tcx>> {

0 commit comments

Comments
 (0)