2024-06-25 04:50:01 -05:00
|
|
|
error: const `impl` for trait `Drop` which is not marked with `#[const_trait]`
|
|
|
|
--> $DIR/const-drop.rs:13:16
|
|
|
|
|
|
|
|
|
LL | impl<'a> const Drop for S<'a> {
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
|
= 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: const `impl` for trait `Drop` which is not marked with `#[const_trait]`
|
|
|
|
--> $DIR/const-drop.rs:47:16
|
|
|
|
|
|
|
|
|
LL | impl const Drop for ConstDrop {
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
|
= 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: const `impl` for trait `Drop` which is not marked with `#[const_trait]`
|
|
|
|
--> $DIR/const-drop.rs:68:37
|
|
|
|
|
|
|
|
|
LL | impl<T: ~const SomeTrait> const Drop for ConstDropWithBound<T> {
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
|
= 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: const `impl` for trait `Drop` which is not marked with `#[const_trait]`
|
|
|
|
--> $DIR/const-drop.rs:76:30
|
|
|
|
|
|
|
|
|
LL | impl<T: SomeTrait> const Drop for ConstDropWithNonconstBound<T> {
|
|
|
|
| ^^^^
|
|
|
|
|
|
|
|
|
= 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
|
|
|
|
|
2024-06-21 06:57:24 -05:00
|
|
|
error: `~const` can only be applied to `#[const_trait]` traits
|
|
|
|
--> $DIR/const-drop.rs:19:22
|
|
|
|
|
|
|
|
|
LL | const fn a<T: ~const Destruct>(_: T) {}
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
2024-06-25 04:50:01 -05:00
|
|
|
error[E0049]: method `foo` has 1 const parameter but its trait declaration has 0 const parameters
|
|
|
|
--> $DIR/const-drop.rs:54:5
|
2024-02-14 06:28:07 -06:00
|
|
|
|
|
2024-06-25 04:50:01 -05:00
|
|
|
LL | #[const_trait]
|
|
|
|
| ^^^^^^^^^^^^^^ found 1 const parameter
|
|
|
|
LL | pub trait SomeTrait {
|
|
|
|
LL | fn foo();
|
|
|
|
| - expected 0 const parameters
|
2024-02-14 06:28:07 -06:00
|
|
|
|
2024-06-25 04:50:01 -05:00
|
|
|
error[E0049]: method `foo` has 1 const parameter but its trait declaration has 0 const parameters
|
|
|
|
--> $DIR/const-drop.rs:54:5
|
2024-02-14 06:28:07 -06:00
|
|
|
|
|
2024-06-25 04:50:01 -05:00
|
|
|
LL | #[const_trait]
|
|
|
|
| ^^^^^^^^^^^^^^ found 1 const parameter
|
|
|
|
LL | pub trait SomeTrait {
|
|
|
|
LL | fn foo();
|
|
|
|
| - expected 0 const parameters
|
2024-02-14 06:28:07 -06:00
|
|
|
|
|
2024-06-25 04:50:01 -05:00
|
|
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
2024-02-14 06:28:07 -06:00
|
|
|
|
2023-12-18 10:55:55 -06:00
|
|
|
error[E0493]: destructor of `T` cannot be evaluated at compile-time
|
|
|
|
--> $DIR/const-drop.rs:19:32
|
2023-07-27 10:51:02 -05:00
|
|
|
|
|
2023-12-18 10:55:55 -06:00
|
|
|
LL | const fn a<T: ~const Destruct>(_: T) {}
|
|
|
|
| ^ the destructor for this type cannot be evaluated in constant functions
|
|
|
|
|
2024-06-25 04:50:01 -05:00
|
|
|
error[E0015]: cannot call non-const fn `<T as SomeTrait>::foo` in constant functions
|
|
|
|
--> $DIR/const-drop.rs:70:13
|
2023-07-27 10:51:02 -05:00
|
|
|
|
|
2024-06-25 04:50:01 -05:00
|
|
|
LL | T::foo();
|
|
|
|
| ^^^^^^^^
|
2024-02-14 06:28:07 -06:00
|
|
|
|
|
2024-06-25 04:50:01 -05:00
|
|
|
= note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
|
|
|
help: add `#![feature(effects)]` to the crate attributes to enable
|
2024-02-14 06:28:07 -06:00
|
|
|
|
|
2024-06-25 04:50:01 -05:00
|
|
|
LL + #![feature(effects)]
|
2024-02-14 06:28:07 -06:00
|
|
|
|
|
2023-07-27 10:51:02 -05:00
|
|
|
|
2024-06-25 04:50:01 -05:00
|
|
|
error: aborting due to 9 previous errors
|
2023-07-27 10:51:02 -05:00
|
|
|
|
2024-06-25 04:50:01 -05:00
|
|
|
Some errors have detailed explanations: E0015, E0049, E0493.
|
|
|
|
For more information about an error, try `rustc --explain E0015`.
|