diff --git a/tests/ui/consts/trait_alias.fail.stderr b/tests/ui/consts/trait_alias.fail.stderr index bb0a4e22efcf..8cf9a7c87770 100644 --- a/tests/ui/consts/trait_alias.fail.stderr +++ b/tests/ui/consts/trait_alias.fail.stderr @@ -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(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`. diff --git a/tests/ui/consts/trait_alias.next_fail.stderr b/tests/ui/consts/trait_alias.next_fail.stderr new file mode 100644 index 000000000000..1a72b9c70de7 --- /dev/null +++ b/tests/ui/consts/trait_alias.next_fail.stderr @@ -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`. diff --git a/tests/ui/consts/trait_alias.pass.stderr b/tests/ui/consts/trait_alias.pass.stderr new file mode 100644 index 000000000000..bbd598e80785 --- /dev/null +++ b/tests/ui/consts/trait_alias.pass.stderr @@ -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(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`. diff --git a/tests/ui/consts/trait_alias.rs b/tests/ui/consts/trait_alias.rs index 2496ef609865..4062c19f52d2 100644 --- a/tests/ui/consts/trait_alias.rs +++ b/tests/ui/consts/trait_alias.rs @@ -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(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() {}