make suggestion stuff not swallow errors
The older code would sometimes swallow errors or fail to produce a suggestion. The newer code does not. However, just printing everything would produce a bunch of new and kind of annoying errors, so continue to swallow `T: 'a` errors so long as there are other things to show.
This commit is contained in:
parent
5abacd36f0
commit
bca07b5ebb
6 changed files with 155 additions and 89 deletions
|
|
@ -36,9 +36,5 @@ fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool
|
|||
fn main() {
|
||||
check((3, 5));
|
||||
//~^ ERROR mismatched types
|
||||
//~| expected `&_`
|
||||
//~| found `(_, _)`
|
||||
//~| expected &-ptr
|
||||
//~| found tuple
|
||||
//~| HELP run `rustc --explain E0308` to see a detailed explanation
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ fn bar1<'a>(x: &Bar) -> (&'a i32, &'a i32, &'a i32) {
|
|||
}
|
||||
|
||||
fn bar2<'a, 'b, 'c>(x: &Bar<'a, 'b, 'c>) -> (&'a i32, &'a i32, &'a i32) {
|
||||
//~^ HELP: consider using an explicit lifetime parameter as shown: fn bar2<'a, 'b, 'c>(x: &'a Bar<'a, 'b, 'c>) -> (&'a i32, &'a i32, &'a i32)
|
||||
//~^ HELP: consider using an explicit lifetime parameter as shown: fn bar2<'a, 'c>(x: &'a Bar<'a, 'a, 'c>) -> (&'a i32, &'a i32, &'a i32)
|
||||
(x.bar, &x.baz, &x.baz)
|
||||
//~^ ERROR E0312
|
||||
//~| ERROR cannot infer
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ struct Cat<'x, T> { cat: &'x isize, t: T }
|
|||
struct Dog<'y> { dog: &'y isize }
|
||||
|
||||
fn cat2<'x, 'y>(x: Cat<'x, Dog<'y>>) -> &'x isize {
|
||||
//~^ HELP consider using an explicit lifetime parameter as shown: fn cat2<'x>(x: Cat<'x, Dog<'x>>) -> &'x isize
|
||||
x.t.dog //~ ERROR E0312
|
||||
}
|
||||
|
||||
|
|
@ -48,6 +49,7 @@ struct Baz<'x> {
|
|||
|
||||
impl<'a> Baz<'a> {
|
||||
fn baz2<'b>(&self, x: &isize) -> (&'b isize, &'b isize) {
|
||||
//~^ HELP consider using an explicit lifetime parameter as shown: fn baz2<'b>(&self, x: &'b isize) -> (&'a isize, &'a isize)
|
||||
(self.bar, x) //~ ERROR E0312
|
||||
//~^ ERROR E0312
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue