From a2a019a28a6b5e78fd696261f1906cfbcabedb01 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 21 Jun 2018 15:26:44 -0400 Subject: do not introduce *false* results from lifetime resolution --- src/test/ui/error-codes/E0657.rs | 4 ++-- src/test/ui/error-codes/E0657.stderr | 23 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) (limited to 'src/test/ui/error-codes') diff --git a/src/test/ui/error-codes/E0657.rs b/src/test/ui/error-codes/E0657.rs index c23aa40ee37..05a4b8b3544 100644 --- a/src/test/ui/error-codes/E0657.rs +++ b/src/test/ui/error-codes/E0657.rs @@ -19,7 +19,7 @@ fn free_fn_capture_hrtb_in_impl_trait() -> Box Id>> //~^ ERROR `impl Trait` can only capture lifetimes bound at the fn or impl level [E0657] { - () + () //~ ERROR mismatched types } struct Foo; @@ -28,7 +28,7 @@ impl Foo { -> Box Id>> //~^ ERROR `impl Trait` can only capture lifetimes bound at the fn or impl level { - () + () //~ ERROR mismatched types } } diff --git a/src/test/ui/error-codes/E0657.stderr b/src/test/ui/error-codes/E0657.stderr index 737ae3a163a..23b9666de3c 100644 --- a/src/test/ui/error-codes/E0657.stderr +++ b/src/test/ui/error-codes/E0657.stderr @@ -10,6 +10,25 @@ error[E0657]: `impl Trait` can only capture lifetimes bound at the fn or impl le LL | -> Box Id>> | ^^ -error: aborting due to 2 previous errors +error[E0308]: mismatched types + --> $DIR/E0657.rs:22:5 + | +LL | () //~ ERROR mismatched types + | ^^ expected struct `std::boxed::Box`, found () + | + = note: expected type `std::boxed::Box + 'static>` + found type `()` + +error[E0308]: mismatched types + --> $DIR/E0657.rs:31:9 + | +LL | () //~ ERROR mismatched types + | ^^ expected struct `std::boxed::Box`, found () + | + = note: expected type `std::boxed::Box + 'static>` + found type `()` + +error: aborting due to 4 previous errors -For more information about this error, try `rustc --explain E0657`. +Some errors occurred: E0308, E0657. +For more information about an error, try `rustc --explain E0308`. -- cgit 1.4.1-3-g733a5