rustc: treat ReEarlyBound as free without replacing it with ReFree.

This commit is contained in:
Eduard-Mihai Burtescu 2017-05-11 15:05:00 +03:00
parent dbae169ac1
commit 2da080e779
35 changed files with 250 additions and 334 deletions

View file

@ -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<R>;
//~^ 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);

View file

@ -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<Self::Item>
//~^ 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)
}