Skip to content

Commit f956dc2

Browse files
Bless tests
1 parent 0ead25c commit f956dc2

6 files changed

+58
-73
lines changed

Diff for: tests/ui/higher-ranked/structually-relate-aliases.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ type Assoc<'a, T> = <T as ToUnit<'a>>::Unit;
1111
impl<T> Overlap<T> for T {}
1212

1313
impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}
14-
//~^ ERROR conflicting implementations of trait `Overlap<for<'a> fn(&'a (), _)>`
14+
//~^ ERROR the trait bound `for<'a> T: ToUnit<'a>` is not satisfied
15+
//~| ERROR the trait bound `for<'a> T: ToUnit<'a>` is not satisfied
1516

1617
fn main() {}
+20-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [?1t, '^0.Named(DefId(0:15 ~ structually_relate_aliases[de75]::{impl#1}::'a), "'a")], def_id: DefId(0:5 ~ structually_relate_aliases[de75]::ToUnit::Unit), .. }
2-
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [?1t, '^0.Named(DefId(0:15 ~ structually_relate_aliases[de75]::{impl#1}::'a), "'a")], def_id: DefId(0:5 ~ structually_relate_aliases[de75]::ToUnit::Unit), .. }
3-
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [?1t, '^0.Named(DefId(0:15 ~ structually_relate_aliases[de75]::{impl#1}::'a), "'a")], def_id: DefId(0:5 ~ structually_relate_aliases[de75]::ToUnit::Unit), .. }
4-
WARN rustc_infer::infer::relate::generalize may incompletely handle alias type: AliasTy { args: [?1t, '^0.Named(DefId(0:15 ~ structually_relate_aliases[de75]::{impl#1}::'a), "'a")], def_id: DefId(0:5 ~ structually_relate_aliases[de75]::ToUnit::Unit), .. }
5-
error[E0119]: conflicting implementations of trait `Overlap<for<'a> fn(&'a (), _)>` for type `for<'a> fn(&'a (), _)`
6-
--> $DIR/structually-relate-aliases.rs:13:1
2+
error[E0277]: the trait bound `for<'a> T: ToUnit<'a>` is not satisfied
3+
--> $DIR/structually-relate-aliases.rs:13:36
74
|
8-
LL | impl<T> Overlap<T> for T {}
9-
| ------------------------ first implementation here
10-
LL |
115
LL | impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}
12-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `for<'a> fn(&'a (), _)`
6+
| ^^^^^^^^^^^^ the trait `for<'a> ToUnit<'a>` is not implemented for `T`
7+
|
8+
help: consider restricting type parameter `T`
9+
|
10+
LL | impl<T: for<'a> ToUnit<'a>> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}
11+
| ++++++++++++++++++++
12+
13+
error[E0277]: the trait bound `for<'a> T: ToUnit<'a>` is not satisfied
14+
--> $DIR/structually-relate-aliases.rs:13:17
15+
|
16+
LL | impl<T> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> ToUnit<'a>` is not implemented for `T`
18+
|
19+
help: consider restricting type parameter `T`
1320
|
14-
= note: this behavior recently changed as a result of a bug fix; see rust-lang/rust#56105 for details
21+
LL | impl<T: for<'a> ToUnit<'a>> Overlap<for<'a> fn(&'a (), Assoc<'a, T>)> for T {}
22+
| ++++++++++++++++++++
1523

16-
error: aborting due to 1 previous error
24+
error: aborting due to 2 previous errors
1725

18-
For more information about this error, try `rustc --explain E0119`.
26+
For more information about this error, try `rustc --explain E0277`.

Diff for: tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ fn main() {
1313
}
1414

1515
fn weird0() -> impl Sized + !Sized {}
16-
//~^ ERROR the size for values of type `()` cannot be known at compilation time [E0277]
17-
//~| ERROR the size for values of type `()` cannot be known at compilation time [E0277]
18-
//~| ERROR the size for values of type `()` cannot be known at compilation time [E0277]
16+
//~^ ERROR the trait bound `(): !Sized` is not satisfied
17+
//~| ERROR the trait bound `(): !Sized` is not satisfied
18+
//~| ERROR the trait bound `(): !Sized` is not satisfied
1919
fn weird1() -> impl !Sized + Sized {}
20-
//~^ ERROR the size for values of type `()` cannot be known at compilation time [E0277]
21-
//~| ERROR the size for values of type `()` cannot be known at compilation time [E0277]
22-
//~| ERROR the size for values of type `()` cannot be known at compilation time [E0277]
20+
//~^ ERROR the trait bound `(): !Sized` is not satisfied
21+
//~| ERROR the trait bound `(): !Sized` is not satisfied
22+
//~| ERROR the trait bound `(): !Sized` is not satisfied
2323
fn weird2() -> impl !Sized {}
24-
//~^ ERROR the size for values of type `()` cannot be known at compilation time [E0277]
25-
//~| ERROR the size for values of type `()` cannot be known at compilation time [E0277]
26-
//~| ERROR the size for values of type `()` cannot be known at compilation time [E0277]
24+
//~^ ERROR the trait bound `(): !Sized` is not satisfied
25+
//~| ERROR the trait bound `(): !Sized` is not satisfied
26+
//~| ERROR the trait bound `(): !Sized` is not satisfied

Diff for: tests/ui/traits/negative-bounds/opaque-type-unsatisfied-bound.stderr

+18-36
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,56 @@
1-
error[E0277]: the size for values of type `()` cannot be known at compilation time
1+
error[E0277]: the trait bound `(): !Sized` is not satisfied
22
--> $DIR/opaque-type-unsatisfied-bound.rs:15:16
33
|
44
LL | fn weird0() -> impl Sized + !Sized {}
5-
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
6-
|
7-
= help: the trait bound `(): !Sized` is not satisfied
5+
| ^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied
86

9-
error[E0277]: the size for values of type `()` cannot be known at compilation time
7+
error[E0277]: the trait bound `(): !Sized` is not satisfied
108
--> $DIR/opaque-type-unsatisfied-bound.rs:15:36
119
|
1210
LL | fn weird0() -> impl Sized + !Sized {}
13-
| ^^ doesn't have a size known at compile-time
14-
|
15-
= help: the trait bound `(): !Sized` is not satisfied
11+
| ^^ the trait bound `(): !Sized` is not satisfied
1612

17-
error[E0277]: the size for values of type `()` cannot be known at compilation time
13+
error[E0277]: the trait bound `(): !Sized` is not satisfied
1814
--> $DIR/opaque-type-unsatisfied-bound.rs:15:1
1915
|
2016
LL | fn weird0() -> impl Sized + !Sized {}
21-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
22-
|
23-
= help: the trait bound `(): !Sized` is not satisfied
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied
2418

25-
error[E0277]: the size for values of type `()` cannot be known at compilation time
19+
error[E0277]: the trait bound `(): !Sized` is not satisfied
2620
--> $DIR/opaque-type-unsatisfied-bound.rs:19:16
2721
|
2822
LL | fn weird1() -> impl !Sized + Sized {}
29-
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
30-
|
31-
= help: the trait bound `(): !Sized` is not satisfied
23+
| ^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied
3224

33-
error[E0277]: the size for values of type `()` cannot be known at compilation time
25+
error[E0277]: the trait bound `(): !Sized` is not satisfied
3426
--> $DIR/opaque-type-unsatisfied-bound.rs:19:36
3527
|
3628
LL | fn weird1() -> impl !Sized + Sized {}
37-
| ^^ doesn't have a size known at compile-time
38-
|
39-
= help: the trait bound `(): !Sized` is not satisfied
29+
| ^^ the trait bound `(): !Sized` is not satisfied
4030

41-
error[E0277]: the size for values of type `()` cannot be known at compilation time
31+
error[E0277]: the trait bound `(): !Sized` is not satisfied
4232
--> $DIR/opaque-type-unsatisfied-bound.rs:19:1
4333
|
4434
LL | fn weird1() -> impl !Sized + Sized {}
45-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
46-
|
47-
= help: the trait bound `(): !Sized` is not satisfied
35+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied
4836

49-
error[E0277]: the size for values of type `()` cannot be known at compilation time
37+
error[E0277]: the trait bound `(): !Sized` is not satisfied
5038
--> $DIR/opaque-type-unsatisfied-bound.rs:23:16
5139
|
5240
LL | fn weird2() -> impl !Sized {}
53-
| ^^^^^^^^^^^ doesn't have a size known at compile-time
54-
|
55-
= help: the trait bound `(): !Sized` is not satisfied
41+
| ^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied
5642

57-
error[E0277]: the size for values of type `()` cannot be known at compilation time
43+
error[E0277]: the trait bound `(): !Sized` is not satisfied
5844
--> $DIR/opaque-type-unsatisfied-bound.rs:23:28
5945
|
6046
LL | fn weird2() -> impl !Sized {}
61-
| ^^ doesn't have a size known at compile-time
62-
|
63-
= help: the trait bound `(): !Sized` is not satisfied
47+
| ^^ the trait bound `(): !Sized` is not satisfied
6448

65-
error[E0277]: the size for values of type `()` cannot be known at compilation time
49+
error[E0277]: the trait bound `(): !Sized` is not satisfied
6650
--> $DIR/opaque-type-unsatisfied-bound.rs:23:1
6751
|
6852
LL | fn weird2() -> impl !Sized {}
69-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
70-
|
71-
= help: the trait bound `(): !Sized` is not satisfied
53+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Sized` is not satisfied
7254

7355
error[E0277]: the trait bound `impl !Trait: Trait` is not satisfied
7456
--> $DIR/opaque-type-unsatisfied-bound.rs:12:13

Diff for: tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#![feature(negative_bounds, unboxed_closures)]
44

55
fn produce() -> impl !Fn<(u32,)> {}
6-
//~^ ERROR expected a `Fn(u32)` closure, found `()`
7-
//~| ERROR expected a `Fn(u32)` closure, found `()`
8-
//~| ERROR expected a `Fn(u32)` closure, found `()`
6+
//~^ ERROR the trait bound `(): !Fn(u32)` is not satisfied
7+
//~| ERROR the trait bound `(): !Fn(u32)` is not satisfied
8+
//~| ERROR the trait bound `(): !Fn(u32)` is not satisfied
99

1010
fn main() {}

Diff for: tests/ui/traits/negative-bounds/opaque-type-unsatisfied-fn-bound.stderr

+6-12
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
1-
error[E0277]: expected a `Fn(u32)` closure, found `()`
1+
error[E0277]: the trait bound `(): !Fn(u32)` is not satisfied
22
--> $DIR/opaque-type-unsatisfied-fn-bound.rs:5:17
33
|
44
LL | fn produce() -> impl !Fn<(u32,)> {}
5-
| ^^^^^^^^^^^^^^^^ expected an `Fn(u32)` closure, found `()`
6-
|
7-
= help: the trait bound `(): !Fn(u32)` is not satisfied
5+
| ^^^^^^^^^^^^^^^^ the trait bound `(): !Fn(u32)` is not satisfied
86

9-
error[E0277]: expected a `Fn(u32)` closure, found `()`
7+
error[E0277]: the trait bound `(): !Fn(u32)` is not satisfied
108
--> $DIR/opaque-type-unsatisfied-fn-bound.rs:5:34
119
|
1210
LL | fn produce() -> impl !Fn<(u32,)> {}
13-
| ^^ expected an `Fn(u32)` closure, found `()`
14-
|
15-
= help: the trait bound `(): !Fn(u32)` is not satisfied
11+
| ^^ the trait bound `(): !Fn(u32)` is not satisfied
1612

17-
error[E0277]: expected a `Fn(u32)` closure, found `()`
13+
error[E0277]: the trait bound `(): !Fn(u32)` is not satisfied
1814
--> $DIR/opaque-type-unsatisfied-fn-bound.rs:5:1
1915
|
2016
LL | fn produce() -> impl !Fn<(u32,)> {}
21-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `Fn(u32)` closure, found `()`
22-
|
23-
= help: the trait bound `(): !Fn(u32)` is not satisfied
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait bound `(): !Fn(u32)` is not satisfied
2418

2519
error: aborting due to 3 previous errors
2620

0 commit comments

Comments
 (0)