Skip to content

Commit 567c74d

Browse files
committed
Prepare test for old solver
1 parent 9c5b143 commit 567c74d

File tree

4 files changed

+49
-7
lines changed

4 files changed

+49
-7
lines changed
Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
error[E0277]: the trait bound `T: [const] Baz` is not satisfied
2-
--> $DIR/trait_alias.rs:22:11
2+
--> $DIR/trait_alias.rs:23:11
33
|
44
LL | x.baz();
55
| ^^^
66

7-
error: aborting due to 1 previous error
7+
error[E0277]: the trait bound `(): const Foo` is not satisfied
8+
--> $DIR/trait_alias.rs:28:19
9+
|
10+
LL | const _: () = foo(&());
11+
| --- ^^^
12+
| |
13+
| required by a bound introduced by this call
14+
|
15+
note: required by a bound in `foo`
16+
--> $DIR/trait_alias.rs:19:17
17+
|
18+
LL | const fn foo<T: [const] Foo>(x: &T) {
19+
| ^^^^^^^^^^^ required by this bound in `foo`
20+
21+
error: aborting due to 2 previous errors
822

923
For more information about this error, try `rustc --explain E0277`.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0277]: the trait bound `T: [const] Baz` is not satisfied
2+
--> $DIR/trait_alias.rs:23:11
3+
|
4+
LL | x.baz();
5+
| ^^^
6+
7+
error: aborting due to 1 previous error
8+
9+
For more information about this error, try `rustc --explain E0277`.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
error[E0277]: the trait bound `(): const Foo` is not satisfied
2+
--> $DIR/trait_alias.rs:28:19
3+
|
4+
LL | const _: () = foo(&());
5+
| --- ^^^
6+
| |
7+
| required by a bound introduced by this call
8+
|
9+
note: required by a bound in `foo`
10+
--> $DIR/trait_alias.rs:19:17
11+
|
12+
LL | const fn foo<T: [const] Foo>(x: &T) {
13+
| ^^^^^^^^^^^ required by this bound in `foo`
14+
15+
error: aborting due to 1 previous error
16+
17+
For more information about this error, try `rustc --explain E0277`.

tests/ui/consts/trait_alias.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#![feature(trait_alias, const_trait_impl)]
2-
//@ revisions: pass fail
3-
//@ compile-flags: -Znext-solver
4-
//@[pass] check-pass
2+
//@ revisions: next_pass next_fail pass fail
3+
//@[next_pass] compile-flags: -Znext-solver
4+
//@[next_fail] compile-flags: -Znext-solver
5+
//@[next_pass] check-pass
56

67
const trait Bar {
78
fn bar(&self) {}
@@ -17,13 +18,14 @@ const trait Foo = [const] Bar + Baz;
1718

1819
const fn foo<T: [const] Foo>(x: &T) {
1920
x.bar();
20-
#[cfg(fail)]
21+
#[cfg(any(fail, next_fail))]
2122
{
2223
x.baz();
23-
//[fail]~^ ERROR: the trait bound `T: [const] Baz` is not satisfied
24+
//[fail,next_fail]~^ ERROR: the trait bound `T: [const] Baz` is not satisfied
2425
}
2526
}
2627

2728
const _: () = foo(&());
29+
//[fail,pass]~^ ERROR: `(): const Foo` is not satisfied
2830

2931
fn main() {}

0 commit comments

Comments
 (0)