Skip to content

Commit e46c459

Browse files
committed
test guesses
1 parent aea71bd commit e46c459

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+161
-38
lines changed

src/test/compile-fail-fulldeps/macro-crate-unexported-macro.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ extern crate macro_crate_test;
1515

1616
fn main() {
1717
assert_eq!(3, unexported_macro!()); //~ ERROR macro undefined: 'unexported_macro!'
18+
//~| GUESS exported_macro!
1819
}

src/test/compile-fail/E0423.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ fn main () {
1212
struct Foo { a: bool };
1313

1414
let f = Foo(); //~ ERROR E0423
15+
//~^ GUESS Foo { /* fields */ }
1516
}

src/test/compile-fail/E0559.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ enum Field {
1515
fn main() {
1616
let s = Field::Fool { joke: 0 };
1717
//~^ ERROR E0559
18-
//~| NOTE field does not exist - did you mean `x`?
18+
//~| HELP field does not exist - did you mean
19+
//~| GUESS x
1920
}

src/test/compile-fail/associated-types-eq-1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ pub trait Foo {
1818

1919
fn foo2<I: Foo>(x: I) {
2020
let _: A = x.boo(); //~ ERROR cannot find type `A` in this scope
21+
//~^ GUESS I
22+
// FIXME: should guess `I::A`
2123
}
2224

2325
pub fn main() {}

src/test/compile-fail/borrowck/borrowck-escaping-closure-error-1.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ fn main() {
2424
//~^ ERROR E0373
2525
//~| NOTE `books` is borrowed here
2626
//~| NOTE may outlive borrowed value `books`
27+
//~| GUESS move ||
2728
}

src/test/compile-fail/borrowck/borrowck-escaping-closure-error-2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ fn foo<'a>(x: &'a i32) -> Box<FnMut()+'a> {
2222
//~^ ERROR E0373
2323
//~| NOTE `books` is borrowed here
2424
//~| NOTE may outlive borrowed value `books`
25+
//~| GUESS move ||
2526
}
2627

2728
fn main() { }

src/test/compile-fail/cast-to-unsized-trait-object-suggestion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ fn main() {
1616
Box::new(1) as Send;
1717
//~^ ERROR cast to unsized type
1818
//~| HELP try casting to a `Box` instead:
19-
//~| SUGGESTION Box::new(1) as Box<Send>;
19+
//~| GUESS Box<Send>
2020
}

src/test/compile-fail/class-missing-self.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ impl cat {
1717
fn meow(&self) {
1818
println!("Meow");
1919
meows += 1; //~ ERROR cannot find value `meows` in this scope
20+
//~^ GUESS self.meows
2021
sleep(); //~ ERROR cannot find function `sleep` in this scope
2122
}
2223

src/test/compile-fail/empty-struct-braces-expr.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,18 @@ enum E {
2323

2424
fn main() {
2525
let e1 = Empty1; //~ ERROR expected value, found struct `Empty1`
26+
//~^ GUESS Empty1 { /* fields */ }
2627
let e1 = Empty1(); //~ ERROR expected function, found struct `Empty1`
28+
//~^ GUESS Empty1 { /* fields */ }
2729
let e3 = E::Empty3; //~ ERROR expected value, found struct variant `E::Empty3`
30+
//~^ GUESS E::Empty3 { /* fields */ }
2831
let e3 = E::Empty3(); //~ ERROR expected function, found struct variant `E::Empty3`
32+
//~^ GUESS E::Empty3 { /* fields */ }
2933

3034
let xe1 = XEmpty1; //~ ERROR expected value, found struct `XEmpty1`
35+
//~^ GUESS Empty1 { /* fields */ }
3136
let xe1 = XEmpty1(); //~ ERROR expected function, found struct `XEmpty1`
37+
//~^ GUESS Empty1 { /* fields */ }
3238
let xe3 = XE::Empty3; //~ ERROR no associated item named `Empty3` found for type
3339
let xe3 = XE::Empty3(); //~ ERROR no associated item named `Empty3` found for type
3440
}

src/test/compile-fail/empty-struct-braces-pat-1.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,14 @@ fn main() {
3333
match e3 {
3434
E::Empty3 => ()
3535
//~^ ERROR expected unit struct/variant or constant, found struct variant `E::Empty3`
36+
//~| GUESS E::Empty3 { /* fields */ }
3637
}
3738
match xe1 {
3839
XEmpty1 => () // Not an error, `XEmpty1` is interpreted as a new binding
3940
}
4041
match xe3 {
4142
XE::XEmpty3 => ()
4243
//~^ ERROR expected unit struct/variant or constant, found struct variant `XE::XEmpty3`
44+
//~| GUESS XE::XEmpty3 { /* fields */ }
4345
}
4446
}

0 commit comments

Comments
 (0)