diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-10-04 08:59:20 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-10-04 08:59:20 +0000 |
| commit | c72c6e01c8020c7a285b76a9b61934e3501b80f3 (patch) | |
| tree | 01541dd2c18f1f923a430c9511de92da304c5abd /src/test/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr | |
| parent | 33bcea8f614f5019012f16b49dc3cd934326ca87 (diff) | |
| download | rust-c72c6e01c8020c7a285b76a9b61934e3501b80f3.tar.gz rust-c72c6e01c8020c7a285b76a9b61934e3501b80f3.zip | |
Merge the `~const` and `impl const` checks and add some explanatory notes
Diffstat (limited to 'src/test/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr')
| -rw-r--r-- | src/test/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/test/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr b/src/test/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr index f9c69d6c6bf..478adcf3e9e 100644 --- a/src/test/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr +++ b/src/test/ui/rfc-2632-const-trait-impl/const-impl-requires-const-trait.stderr @@ -1,20 +1,14 @@ -error: const `impl`s must be for traits marked with `#[const_trait]` - --> $DIR/const-impl-requires-const-trait.rs:6:1 - | -LL | impl const A for () {} - | ^^^^^^^^^^^^^^^^^^^ - | -note: this trait must be annotated with `#[const_trait]` - --> $DIR/const-impl-requires-const-trait.rs:3:1 - | -LL | pub trait A {} - | ^^^^^^^^^^^ - -error: ~const can only be applied to `#[const_trait]` traits +error: const `impl` for trait `A` which is not marked with `#[const_trait]` --> $DIR/const-impl-requires-const-trait.rs:6:12 | +LL | pub trait A {} + | - help: mark `A` as const: `#[const_trait]` +... LL | impl const A for () {} | ^ + | + = note: marking a trait with `#[const_trait]` ensures all default method bodies are `const` + = note: adding a non-const method body in the future would be a breaking change -error: aborting due to 2 previous errors +error: aborting due to previous error |
