Move a wf-check into the site where the value is instantiated

This commit is contained in:
Oli Scherer 2022-10-20 09:39:09 +00:00
parent 1481fd964b
commit 8286ea5a49
8 changed files with 95 additions and 59 deletions

View file

@ -1,8 +1,8 @@
error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/super-traits-fail-2.rs:11:12
--> $DIR/super-traits-fail-2.rs:11:19
|
LL | trait Bar: ~const Foo {}
| ^^^^^^^^^^
| ^^^
error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/super-traits-fail-2.rs:11:12
--> $DIR/super-traits-fail-2.rs:11:19
|
LL | trait Bar: ~const Foo {}
| ^^^^^^^^^^
| ^^^
error: aborting due to previous error

View file

@ -1,14 +1,14 @@
error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/super-traits-fail-3.rs:12:12
--> $DIR/super-traits-fail-3.rs:12:19
|
LL | trait Bar: ~const Foo {}
| ^^^^^^^^^^
| ^^^
error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/super-traits-fail-3.rs:15:17
--> $DIR/super-traits-fail-3.rs:15:24
|
LL | const fn foo<T: ~const Bar>(x: &T) {
| ^^^^^^^^^^
| ^^^
error: aborting due to 2 previous errors

View file

@ -1,8 +1,8 @@
error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/super-traits-fail-3.rs:12:12
--> $DIR/super-traits-fail-3.rs:12:19
|
LL | trait Bar: ~const Foo {}
| ^^^^^^^^^^
| ^^^
error: aborting due to previous error

View file

@ -1,8 +1,8 @@
error: ~const can only be applied to `#[const_trait]` traits
--> $DIR/super-traits-fail-3.rs:15:17
--> $DIR/super-traits-fail-3.rs:15:24
|
LL | const fn foo<T: ~const Bar>(x: &T) {
| ^^^^^^^^^^
| ^^^
error: aborting due to previous error