diff options
Diffstat (limited to 'tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.stderr')
-rw-r--r-- | tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.stderr | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.stderr b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.stderr index 35dc1ca12..deed05ae1 100644 --- a/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.stderr +++ b/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-default-body-stability.stderr @@ -1,20 +1,29 @@ -error: const `impl` for trait `Try` which is not marked with `#[const_trait]` - --> $DIR/trait-default-body-stability.rs:18:12 +error[E0015]: `?` cannot determine the branch of `T` in constant functions + --> $DIR/trait-default-body-stability.rs:44:9 | -LL | impl const Try for T { - | ^^^ +LL | T? + | ^^ + | +note: impl defined here, but it is not `const` + --> $DIR/trait-default-body-stability.rs:18:1 | - = 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 +LL | impl const Try for T { + | ^^^^^^^^^^^^^^^^^^^^ + = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants -error: const `impl` for trait `FromResidual` which is not marked with `#[const_trait]` - --> $DIR/trait-default-body-stability.rs:33:12 +error[E0015]: `?` cannot convert from residual of `T` in constant functions + --> $DIR/trait-default-body-stability.rs:44:9 | -LL | impl const FromResidual for T { - | ^^^^^^^^^^^^ +LL | T? + | ^^ + | +note: impl defined here, but it is not `const` + --> $DIR/trait-default-body-stability.rs:33:1 | - = 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 +LL | impl const FromResidual for T { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants error: aborting due to 2 previous errors +For more information about this error, try `rustc --explain E0015`. |