catch attempts to leak obligations out of snapshots

This commit is contained in:
Ariel Ben-Yehuda 2016-05-25 21:12:35 +03:00
parent c209d44c34
commit 040fc94b4e
7 changed files with 121 additions and 110 deletions

View file

@ -34,7 +34,8 @@ impl<'a, 't> Foo<'a, 't> for &'a isize {
}
fn wrong_bound1<'b,'c,'d:'a+'c>(self, b: Inv<'b>, c: Inv<'c>, d: Inv<'d>) {
//~^ ERROR method `wrong_bound1` has an incompatible type for trait
//~^ ERROR method not compatible with trait
//~^^ ERROR method not compatible with trait
//
// Note: This is a terrible error message. It is caused
// because, in the trait, 'b is early bound, and in the impl,

View file

@ -23,7 +23,7 @@ impl<'a> get_ctxt for has_ctxt<'a> {
// Here an error occurs because we used `&self` but
// the definition used `&`:
fn get_ctxt(&self) -> &'a ctxt { //~ ERROR method `get_ctxt` has an incompatible type
fn get_ctxt(&self) -> &'a ctxt { //~ ERROR method not compatible with trait
self.c
}