From 5e0197f13a28d2b3d9aadbc6c5d48506ab4d696f Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Sat, 18 Jan 2020 05:47:28 -0500 Subject: [PATCH] apply various formatting nits --- src/librustc/infer/lexical_region_resolve/mod.rs | 16 ++++++++-------- src/librustc/infer/outlives/verify.rs | 2 +- src/librustc/ty/context.rs | 4 ++-- src/librustc/ty/free_region_map.rs | 2 +- src/librustc/ty/sty.rs | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/librustc/infer/lexical_region_resolve/mod.rs b/src/librustc/infer/lexical_region_resolve/mod.rs index f4d583d9092..e0a8c3b4e65 100644 --- a/src/librustc/infer/lexical_region_resolve/mod.rs +++ b/src/librustc/infer/lexical_region_resolve/mod.rs @@ -83,7 +83,7 @@ pub enum RegionResolutionError<'tcx> { ), /// Indicates a `'b: 'a` constraint where `'a` is in a universe that - /// cannot name the placeholder `'b` + /// cannot name the placeholder `'b`. UpperBoundUniverseConflict( RegionVid, RegionVariableOrigin, @@ -449,7 +449,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> { 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 // `lub` relationship defined below, since sometimes the "lub" // 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 - // check if it is equal to b. + // check if it is equal to `b`. self.lub_concrete_regions(a, b) == b } @@ -491,7 +491,7 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> { } (&ReStatic, _) | (_, &ReStatic) => { - // nothing lives longer than static + // nothing lives longer than `'static` self.tcx().lifetimes.re_static } @@ -501,14 +501,14 @@ impl<'cx, 'tcx> LexicalResolver<'cx, 'tcx> { | (r @ ReFree(_), &ReEmpty(_)) | (&ReEmpty(_), r @ ReScope(_)) | (r @ ReScope(_), &ReEmpty(_)) => { - // all empty regions are less than early-bound, free, - // and scope regions + // All empty regions are less than early-bound, free, + // and scope regions. r } (&ReEmpty(a_ui), &ReEmpty(b_ui)) => { - // empty regions are ordered according to the universe - // they are associated with + // Empty regions are ordered according to the universe + // they are associated with. let ui = a_ui.min(b_ui); self.tcx().mk_region(ReEmpty(ui)) } diff --git a/src/librustc/infer/outlives/verify.rs b/src/librustc/infer/outlives/verify.rs index 9d6c3f30aa7..a2c99064caa 100644 --- a/src/librustc/infer/outlives/verify.rs +++ b/src/librustc/infer/outlives/verify.rs @@ -68,7 +68,7 @@ impl<'cx, 'tcx> VerifyBoundCx<'cx, 'tcx> { // being tested is `'empty`. VerifyBound::IsEmpty } 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`. VerifyBound::AnyBound(any_bounds) } diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index d56d4fa1485..f104cb084e6 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -173,10 +173,10 @@ pub struct CommonTypes<'tcx> { } pub struct CommonLifetimes<'tcx> { - /// ReEmpty in the root universe + /// `ReEmpty` in the root universe. pub re_root_empty: Region<'tcx>, - /// ReStatic + /// `ReStatic` pub re_static: Region<'tcx>, /// Erased region, used after type-checking diff --git a/src/librustc/ty/free_region_map.rs b/src/librustc/ty/free_region_map.rs index 4cd6b4cfadb..2ab12a4acbf 100644 --- a/src/librustc/ty/free_region_map.rs +++ b/src/librustc/ty/free_region_map.rs @@ -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 { r_a == r_b || self.relation.contains(&r_a, &r_b) } diff --git a/src/librustc/ty/sty.rs b/src/librustc/ty/sty.rs index c0ee14192ff..9414c78c781 100644 --- a/src/librustc/ty/sty.rs +++ b/src/librustc/ty/sty.rs @@ -1415,9 +1415,9 @@ pub enum RegionKind { /// Empty lifetime is for data that is never accessed. We tag the /// empty lifetime with a universe -- the idea is that we don't /// want `exists<'a> { forall<'b> { 'b: 'a } }` to be satisfiable. - /// Therefore, the `'empty` in a universe U is less than all - /// regions visible from U, but not less than regions not visible - /// from U. + /// Therefore, the `'empty` in a universe `U` is less than all + /// regions visible from `U`, but not less than regions not visible + /// from `U`. ReEmpty(ty::UniverseIndex), /// Erased region, used by trait selection, in MIR and during codegen.