Prepare test for old solver
This commit is contained in:
@@ -1,9 +1,23 @@
|
||||
error[E0277]: the trait bound `T: [const] Baz` is not satisfied
|
||||
--> $DIR/trait_alias.rs:22:11
|
||||
--> $DIR/trait_alias.rs:23:11
|
||||
|
|
||||
LL | x.baz();
|
||||
| ^^^
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
error[E0277]: the trait bound `(): const Foo` is not satisfied
|
||||
--> $DIR/trait_alias.rs:28:19
|
||||
|
|
||||
LL | const _: () = foo(&());
|
||||
| --- ^^^
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
note: required by a bound in `foo`
|
||||
--> $DIR/trait_alias.rs:19:17
|
||||
|
|
||||
LL | const fn foo<T: [const] Foo>(x: &T) {
|
||||
| ^^^^^^^^^^^ required by this bound in `foo`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
|
||||
9
tests/ui/consts/trait_alias.next_fail.stderr
Normal file
9
tests/ui/consts/trait_alias.next_fail.stderr
Normal file
@@ -0,0 +1,9 @@
|
||||
error[E0277]: the trait bound `T: [const] Baz` is not satisfied
|
||||
--> $DIR/trait_alias.rs:23:11
|
||||
|
|
||||
LL | x.baz();
|
||||
| ^^^
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
17
tests/ui/consts/trait_alias.pass.stderr
Normal file
17
tests/ui/consts/trait_alias.pass.stderr
Normal file
@@ -0,0 +1,17 @@
|
||||
error[E0277]: the trait bound `(): const Foo` is not satisfied
|
||||
--> $DIR/trait_alias.rs:28:19
|
||||
|
|
||||
LL | const _: () = foo(&());
|
||||
| --- ^^^
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
note: required by a bound in `foo`
|
||||
--> $DIR/trait_alias.rs:19:17
|
||||
|
|
||||
LL | const fn foo<T: [const] Foo>(x: &T) {
|
||||
| ^^^^^^^^^^^ required by this bound in `foo`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0277`.
|
||||
@@ -1,7 +1,8 @@
|
||||
#![feature(trait_alias, const_trait_impl)]
|
||||
//@ revisions: pass fail
|
||||
//@ compile-flags: -Znext-solver
|
||||
//@[pass] check-pass
|
||||
//@ revisions: next_pass next_fail pass fail
|
||||
//@[next_pass] compile-flags: -Znext-solver
|
||||
//@[next_fail] compile-flags: -Znext-solver
|
||||
//@[next_pass] check-pass
|
||||
|
||||
const trait Bar {
|
||||
fn bar(&self) {}
|
||||
@@ -17,13 +18,14 @@ const trait Foo = [const] Bar + Baz;
|
||||
|
||||
const fn foo<T: [const] Foo>(x: &T) {
|
||||
x.bar();
|
||||
#[cfg(fail)]
|
||||
#[cfg(any(fail, next_fail))]
|
||||
{
|
||||
x.baz();
|
||||
//[fail]~^ ERROR: the trait bound `T: [const] Baz` is not satisfied
|
||||
//[fail,next_fail]~^ ERROR: the trait bound `T: [const] Baz` is not satisfied
|
||||
}
|
||||
}
|
||||
|
||||
const _: () = foo(&());
|
||||
//[fail,pass]~^ ERROR: `(): const Foo` is not satisfied
|
||||
|
||||
fn main() {}
|
||||
|
||||
Reference in New Issue
Block a user