From 805333b2b5602e421124787c7f944c4a7eacdb62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Mon, 6 Nov 2017 21:02:31 -0800 Subject: [PATCH] review comments --- src/librustc/infer/error_reporting/named_anon_conflict.rs | 4 ++-- ... => ex1-return-one-existing-name-early-bound-in-struct.rs} | 0 ...ex1-return-one-existing-name-early-bound-in-struct.stderr} | 2 +- ...-regions.rs => ex2a-push-one-existing-name-early-bound.rs} | 0 ....stderr => ex2a-push-one-existing-name-early-bound.stderr} | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename src/test/ui/lifetime-errors/{ex4-anon-named-regions.rs => ex1-return-one-existing-name-early-bound-in-struct.rs} (100%) rename src/test/ui/lifetime-errors/{ex4-anon-named-regions.stderr => ex1-return-one-existing-name-early-bound-in-struct.stderr} (82%) rename src/test/ui/lifetime-errors/{ex3-both-anon-regions-earlybound-regions.rs => ex2a-push-one-existing-name-early-bound.rs} (100%) rename src/test/ui/lifetime-errors/{ex3-both-anon-regions-earlybound-regions.stderr => ex2a-push-one-existing-name-early-bound.stderr} (83%) diff --git a/src/librustc/infer/error_reporting/named_anon_conflict.rs b/src/librustc/infer/error_reporting/named_anon_conflict.rs index 4563d955413e0..6d3b950784097 100644 --- a/src/librustc/infer/error_reporting/named_anon_conflict.rs +++ b/src/librustc/infer/error_reporting/named_anon_conflict.rs @@ -16,8 +16,8 @@ use infer::region_inference::RegionResolutionError; use ty; impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> { - /// Generate an error message for when the function arguments consist of a named region and - /// an anonymous region and corresponds to `ConcreteFailure(..)` + /// When given a `ConcreteFailure` for a function with arguments containing a named region and + /// an anonymous region, emit an descriptive diagnostic error. pub fn try_report_named_anon_conflict(&self, error: &RegionResolutionError<'tcx>) -> bool { let (span, sub, sup) = match *error { ConcreteFailure(ref origin, sub, sup) => (origin.span(), sub, sup), diff --git a/src/test/ui/lifetime-errors/ex4-anon-named-regions.rs b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex4-anon-named-regions.rs rename to src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.rs diff --git a/src/test/ui/lifetime-errors/ex4-anon-named-regions.stderr b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr similarity index 82% rename from src/test/ui/lifetime-errors/ex4-anon-named-regions.stderr rename to src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr index 4a127bbc551f0..d1660a620b6c7 100644 --- a/src/test/ui/lifetime-errors/ex4-anon-named-regions.stderr +++ b/src/test/ui/lifetime-errors/ex1-return-one-existing-name-early-bound-in-struct.stderr @@ -1,5 +1,5 @@ error[E0621]: explicit lifetime required in the type of `other` - --> $DIR/ex4-anon-named-regions.rs:21:21 + --> $DIR/ex1-return-one-existing-name-early-bound-in-struct.rs:21:21 | 17 | fn bar(&self, other: Foo) -> Foo<'a> { | ----- consider changing the type of `other` to `Foo<'a>` diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-earlybound-regions.rs b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs similarity index 100% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-earlybound-regions.rs rename to src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.rs diff --git a/src/test/ui/lifetime-errors/ex3-both-anon-regions-earlybound-regions.stderr b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr similarity index 83% rename from src/test/ui/lifetime-errors/ex3-both-anon-regions-earlybound-regions.stderr rename to src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr index 6c5ed672604c3..980f14a51d9b1 100644 --- a/src/test/ui/lifetime-errors/ex3-both-anon-regions-earlybound-regions.stderr +++ b/src/test/ui/lifetime-errors/ex2a-push-one-existing-name-early-bound.stderr @@ -1,5 +1,5 @@ error[E0621]: explicit lifetime required in the type of `y` - --> $DIR/ex3-both-anon-regions-earlybound-regions.rs:17:12 + --> $DIR/ex2a-push-one-existing-name-early-bound.rs:17:12 | 13 | fn baz<'a, 'b, T>(x: &mut Vec<&'a T>, y: &T) | - consider changing the type of `y` to `&'a T`