Prepare test for old solver

This commit is contained in:
Oli Scherer
2025-07-21 14:10:20 +00:00
committed by Oli Scherer
parent 544a5a3e0e
commit bc4d612d46
4 changed files with 49 additions and 7 deletions

View File

@@ -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`.

View 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`.

View 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`.

View File

@@ -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() {}