Skip to content

Commit 29dccfe

Browse files
Bless chalk tests
1 parent 2257ba9 commit 29dccfe

File tree

5 files changed

+44
-13
lines changed

5 files changed

+44
-13
lines changed

Diff for: compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,8 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
867867
);
868868
}
869869

870-
let is_fn_trait = ty::ClosureKind::from_def_id(tcx, trait_ref.def_id()).is_some();
870+
let is_fn_trait =
871+
ty::ClosureKind::from_def_id(tcx, trait_ref.def_id()).is_some();
871872
let is_target_feature_fn = if let ty::FnDef(def_id, _) =
872873
*trait_ref.skip_binder().self_ty().kind()
873874
{

Diff for: src/test/ui/chalkify/closure.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// check-fail
1+
// known-bug: unknown
2+
// FIXME(chalk): Chalk needs support for the Tuple trait
23
// compile-flags: -Z chalk
34

45
fn main() -> () {
@@ -25,7 +26,7 @@ fn main() -> () {
2526
let mut c = b;
2627

2728
c();
28-
b(); //~ ERROR
29+
b(); // FIXME: reenable when this is fixed ~ ERROR
2930

3031
// FIXME(chalk): this doesn't quite work
3132
/*

Diff for: src/test/ui/chalkify/closure.stderr

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: `()` is not a tuple
2-
--> $DIR/closure.rs:6:5
2+
--> $DIR/closure.rs:7:5
33
|
44
LL | t();
55
| ^^^ the trait `Tuple` is not implemented for `()`
@@ -10,7 +10,7 @@ LL | fn main() -> () where (): Tuple {
1010
| +++++++++++++++
1111

1212
error[E0277]: `()` is not a tuple
13-
--> $DIR/closure.rs:12:5
13+
--> $DIR/closure.rs:13:5
1414
|
1515
LL | b();
1616
| ^^^ the trait `Tuple` is not implemented for `()`
@@ -21,7 +21,7 @@ LL | fn main() -> () where (): Tuple {
2121
| +++++++++++++++
2222

2323
error[E0277]: `()` is not a tuple
24-
--> $DIR/closure.rs:16:5
24+
--> $DIR/closure.rs:17:5
2525
|
2626
LL | c();
2727
| ^^^ the trait `Tuple` is not implemented for `()`
@@ -32,7 +32,7 @@ LL | fn main() -> () where (): Tuple {
3232
| +++++++++++++++
3333

3434
error[E0277]: `()` is not a tuple
35-
--> $DIR/closure.rs:17:5
35+
--> $DIR/closure.rs:18:5
3636
|
3737
LL | b();
3838
| ^^^ the trait `Tuple` is not implemented for `()`
@@ -43,7 +43,7 @@ LL | fn main() -> () where (): Tuple {
4343
| +++++++++++++++
4444

4545
error[E0277]: `()` is not a tuple
46-
--> $DIR/closure.rs:23:5
46+
--> $DIR/closure.rs:24:5
4747
|
4848
LL | b();
4949
| ^^^ the trait `Tuple` is not implemented for `()`
@@ -54,7 +54,7 @@ LL | fn main() -> () where (): Tuple {
5454
| +++++++++++++++
5555

5656
error[E0277]: `()` is not a tuple
57-
--> $DIR/closure.rs:27:5
57+
--> $DIR/closure.rs:28:5
5858
|
5959
LL | c();
6060
| ^^^ the trait `Tuple` is not implemented for `()`
@@ -65,10 +65,10 @@ LL | fn main() -> () where (): Tuple {
6565
| +++++++++++++++
6666

6767
error[E0277]: `()` is not a tuple
68-
--> $DIR/closure.rs:28:5
68+
--> $DIR/closure.rs:29:5
6969
|
70-
LL | b();
71-
| ^^^ `()` is not a tuple
70+
LL | b(); // FIXME: reenable when this is fixed ~ ERROR
71+
| ^^^ the trait `Tuple` is not implemented for `()`
7272
|
7373
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
7474
|

Diff for: src/test/ui/chalkify/trait-objects.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// check-pass
1+
// known-bug: unknown
2+
// FIXME(chalk): Chalk needs support for the Tuple trait
23
// compile-flags: -Z chalk
34

45
use std::fmt::Display;

Diff for: src/test/ui/chalkify/trait-objects.stderr

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
error: the type `&dyn Fn(i32) -> _` is not well-formed (chalk)
2+
--> $DIR/trait-objects.rs:11:12
3+
|
4+
LL | let f: &dyn Fn(i32) -> _ = &|x| x + x;
5+
| ^^^^^^^^^^^^^^^^^
6+
7+
error[E0277]: `(i32,)` is not a tuple
8+
--> $DIR/trait-objects.rs:12:5
9+
|
10+
LL | f(2);
11+
| ^^^^ the trait `Tuple` is not implemented for `(i32,)`
12+
|
13+
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement
14+
|
15+
LL | fn main() where (i32,): Tuple {
16+
| +++++++++++++++++++
17+
18+
error[E0277]: expected a `Fn<(i32,)>` closure, found `dyn Fn(i32) -> i32`
19+
--> $DIR/trait-objects.rs:12:5
20+
|
21+
LL | f(2);
22+
| ^^^^ expected an `Fn<(i32,)>` closure, found `dyn Fn(i32) -> i32`
23+
|
24+
= help: the trait `Fn<(i32,)>` is not implemented for `dyn Fn(i32) -> i32`
25+
26+
error: aborting due to 3 previous errors
27+
28+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)