Skip to content

Commit 2223499

Browse files
committed
apply review feedback nits
- correct indentation - rename `from_cause` to `from_obligation_cause` - break up `compare_impl_method` into fns - delete some blank lines and correct comment
1 parent b659752 commit 2223499

File tree

4 files changed

+412
-342
lines changed

4 files changed

+412
-342
lines changed

src/librustc/infer/mod.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,9 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
11721172
self.commit_if_ok(|snapshot| {
11731173
let (ty::OutlivesPredicate(r_a, r_b), skol_map) =
11741174
self.skolemize_late_bound_regions(predicate, snapshot);
1175-
let origin = SubregionOrigin::from_cause(cause, || RelateRegionParamBound(cause.span));
1175+
let origin =
1176+
SubregionOrigin::from_obligation_cause(cause,
1177+
|| RelateRegionParamBound(cause.span));
11761178
self.sub_regions(origin, r_b, r_a); // `b : a` ==> `a <= b`
11771179
self.leak_check(false, cause.span, &skol_map, snapshot)?;
11781180
Ok(self.pop_skolemized(skol_map, snapshot))
@@ -1809,9 +1811,9 @@ impl<'tcx> SubregionOrigin<'tcx> {
18091811
}
18101812
}
18111813

1812-
pub fn from_cause<F>(cause: &traits::ObligationCause<'tcx>,
1813-
default: F)
1814-
-> Self
1814+
pub fn from_obligation_cause<F>(cause: &traits::ObligationCause<'tcx>,
1815+
default: F)
1816+
-> Self
18151817
where F: FnOnce() -> Self
18161818
{
18171819
match cause.code {

src/librustc/traits/util.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
32
// file at the top-level directory of this distribution and at
43
// http://rust-lang.org/COPYRIGHT.
@@ -185,7 +184,7 @@ impl<'cx, 'gcx, 'tcx> Elaborator<'cx, 'gcx, 'tcx> {
185184
// `'a: 'b`.
186185

187186
// Ignore `for<'a> T: 'a` -- we might in the future
188-
// consider this as evidence that `Foo: 'static`, but
187+
// consider this as evidence that `T: 'static`, but
189188
// I'm a bit wary of such constructions and so for now
190189
// I want to be conservative. --nmatsakis
191190
let ty_max = data.skip_binder().0;

0 commit comments

Comments
 (0)