From 2da080e779b4e6f4359c031824c3bdcedad452fd Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Thu, 11 May 2017 15:05:00 +0300 Subject: rustc: treat ReEarlyBound as free without replacing it with ReFree. --- src/test/compile-fail/issue-27942.rs | 7 ++++--- src/test/compile-fail/issue-37884.rs | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/test') diff --git a/src/test/compile-fail/issue-27942.rs b/src/test/compile-fail/issue-27942.rs index 595e4bfb0d7..22e7de3838d 100644 --- a/src/test/compile-fail/issue-27942.rs +++ b/src/test/compile-fail/issue-27942.rs @@ -11,17 +11,18 @@ pub trait Resources<'a> {} pub trait Buffer<'a, R: Resources<'a>> { + //~^ NOTE the lifetime 'a as defined on the trait at 13:0... + //~| NOTE ...does not necessarily outlive the lifetime 'a as defined on the trait + fn select(&self) -> BufferViewHandle; //~^ ERROR mismatched types //~| lifetime mismatch //~| NOTE expected type `Resources<'_>` - //~| NOTE the lifetime 'a as defined on the method body at 14:4... //~| NOTE ...does not necessarily outlive the anonymous lifetime #1 defined on the method body //~| ERROR mismatched types //~| lifetime mismatch //~| NOTE expected type `Resources<'_>` - //~| NOTE the anonymous lifetime #1 defined on the method body at 14:4... - //~| NOTE ...does not necessarily outlive the lifetime 'a as defined on the method body + //~| NOTE the anonymous lifetime #1 defined on the method body at 17:4... } pub struct BufferViewHandle<'a, R: 'a+Resources<'a>>(&'a R); diff --git a/src/test/compile-fail/issue-37884.rs b/src/test/compile-fail/issue-37884.rs index 28ce79ab5aa..6313293bf2b 100644 --- a/src/test/compile-fail/issue-37884.rs +++ b/src/test/compile-fail/issue-37884.rs @@ -11,13 +11,14 @@ struct RepeatMut<'a, T>(T, &'a ()); impl<'a, T: 'a> Iterator for RepeatMut<'a, T> { + //~^ NOTE ...does not necessarily outlive the lifetime 'a as defined on the impl + type Item = &'a mut T; fn next(&'a mut self) -> Option //~^ ERROR method not compatible with trait //~| lifetime mismatch //~| NOTE expected type `fn(&mut RepeatMut<'a, T>) -> std::option::Option<&mut T>` //~| NOTE the anonymous lifetime #1 defined on the method body - //~| NOTE ...does not necessarily outlive the lifetime 'a as defined on the method body { Some(&mut self.0) } -- cgit 1.4.1-3-g733a5