apply various formatting nits

This commit is contained in:
Niko Matsakis 2020-01-18 05:47:28 -05:00
parent 6bc79c9cf3
commit 5e0197f13a
5 changed files with 15 additions and 15 deletions

View File

@ -83,7 +83,7 @@ pub enum RegionResolutionError<'tcx> {
), ),
/// Indicates a `'b: 'a` constraint where `'a` is in a universe that /// Indicates a `'b: 'a` constraint where `'a` is in a universe that
/// cannot name the placeholder `'b` /// cannot name the placeholder `'b`.
UpperBoundUniverseConflict( UpperBoundUniverseConflict(
RegionVid, RegionVid,
RegionVariableOrigin, RegionVariableOrigin,
@ -449,7 +449,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
return true; return true;
} }
// If both a and b are free, consult the declared // If both `a` and `b` are free, consult the declared
// relationships. Note that this can be more precise than the // relationships. Note that this can be more precise than the
// `lub` relationship defined below, since sometimes the "lub" // `lub` relationship defined below, since sometimes the "lub"
// is actually the `postdom_upper_bound` (see // is actually the `postdom_upper_bound` (see
@ -460,7 +460,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
} }
// For other cases, leverage the LUB code to find the LUB and // For other cases, leverage the LUB code to find the LUB and
// check if it is equal to b. // check if it is equal to `b`.
self.lub_concrete_regions(a, b) == b self.lub_concrete_regions(a, b) == b
} }
@ -491,7 +491,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
} }
(&ReStatic, _) | (_, &ReStatic) => { (&ReStatic, _) | (_, &ReStatic) => {
// nothing lives longer than static // nothing lives longer than `'static`
self.tcx().lifetimes.re_static self.tcx().lifetimes.re_static
} }
@ -501,14 +501,14 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> {
| (r @ ReFree(_), &ReEmpty(_)) | (r @ ReFree(_), &ReEmpty(_))
| (&ReEmpty(_), r @ ReScope(_)) | (&ReEmpty(_), r @ ReScope(_))
| (r @ ReScope(_), &ReEmpty(_)) => { | (r @ ReScope(_), &ReEmpty(_)) => {
// all empty regions are less than early-bound, free, // All empty regions are less than early-bound, free,
// and scope regions // and scope regions.
r r
} }
(&ReEmpty(a_ui), &ReEmpty(b_ui)) => { (&ReEmpty(a_ui), &ReEmpty(b_ui)) => {
// empty regions are ordered according to the universe // Empty regions are ordered according to the universe
// they are associated with // they are associated with.
let ui = a_ui.min(b_ui); let ui = a_ui.min(b_ui);
self.tcx().mk_region(ReEmpty(ui)) self.tcx().mk_region(ReEmpty(ui))
} }

View File

@ -68,7 +68,7 @@ impl<'cx, 'tcx> VerifyBoundCx<'cx, 'tcx> {
// being tested is `'empty`. // being tested is `'empty`.
VerifyBound::IsEmpty VerifyBound::IsEmpty
} else { } else {
// If we can find any other bound R such that `T: R`, then // If we can find any other bound `R` such that `T: R`, then
// we don't need to check for `'empty`, because `R: 'empty`. // we don't need to check for `'empty`, because `R: 'empty`.
VerifyBound::AnyBound(any_bounds) VerifyBound::AnyBound(any_bounds)
} }

View File

@ -173,10 +173,10 @@ pub struct CommonTypes<'tcx> {
} }
pub struct CommonLifetimes<'tcx> { pub struct CommonLifetimes<'tcx> {
/// ReEmpty in the root universe /// `ReEmpty` in the root universe.
pub re_root_empty: Region<'tcx>, pub re_root_empty: Region<'tcx>,
/// ReStatic /// `ReStatic`
pub re_static: Region<'tcx>, pub re_static: Region<'tcx>,
/// Erased region, used after type-checking /// Erased region, used after type-checking

View File

@ -56,7 +56,7 @@ impl<'tcx> FreeRegionMap<'tcx> {
} }
} }
/// Check whether `r_a <= r_b` is found in the relation /// Check whether `r_a <= r_b` is found in the relation.
fn check_relation(&self, r_a: Region<'tcx>, r_b: Region<'tcx>) -> bool { 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)
} }

View File

@ -1415,9 +1415,9 @@ pub enum RegionKind {
/// Empty lifetime is for data that is never accessed. We tag the /// Empty lifetime is for data that is never accessed. We tag the
/// empty lifetime with a universe -- the idea is that we don't /// empty lifetime with a universe -- the idea is that we don't
/// want `exists<'a> { forall<'b> { 'b: 'a } }` to be satisfiable. /// want `exists<'a> { forall<'b> { 'b: 'a } }` to be satisfiable.
/// Therefore, the `'empty` in a universe U is less than all /// Therefore, the `'empty` in a universe `U` is less than all
/// regions visible from U, but not less than regions not visible /// regions visible from `U`, but not less than regions not visible
/// from U. /// from `U`.
ReEmpty(ty::UniverseIndex), ReEmpty(ty::UniverseIndex),
/// Erased region, used by trait selection, in MIR and during codegen. /// Erased region, used by trait selection, in MIR and during codegen.