rust/tests/ui/traits/const-traits/const-drop.precise.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

97 lines
3.7 KiB
Plaintext
Raw Normal View History

2024-06-25 09:50:01 +00:00
error: const `impl` for trait `Drop` which is not marked with `#[const_trait]`
2024-08-17 12:19:34 +00:00
--> $DIR/const-drop.rs:12:16
2024-06-25 09:50:01 +00:00
|
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]`
2024-08-17 12:19:34 +00:00
--> $DIR/const-drop.rs:46:16
2024-06-25 09:50:01 +00:00
|
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]`
2024-08-17 12:19:34 +00:00
--> $DIR/const-drop.rs:67:37
2024-06-25 09:50:01 +00:00
|
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]`
2024-08-17 12:19:34 +00:00
--> $DIR/const-drop.rs:75:30
2024-06-25 09:50:01 +00:00
|
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 11:57:24 +00:00
error: `~const` can only be applied to `#[const_trait]` traits
--> $DIR/const-drop.rs:18:15
2024-06-21 11:57:24 +00:00
|
LL | const fn a<T: ~const Destruct>(_: T) {}
| ^^^^^^
2024-06-21 11:57:24 +00:00
error: `~const` can only be applied to `#[const_trait]` traits
--> $DIR/const-drop.rs:18:15
|
LL | const fn a<T: ~const Destruct>(_: T) {}
| ^^^^^^
|
2024-06-25 09:50:01 +00:00
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error[E0277]: the trait bound `T: const SomeTrait` is not satisfied
--> $DIR/const-drop.rs:67:46
|
LL | impl<T: ~const SomeTrait> const Drop for ConstDropWithBound<T> {
| ^^^^^^^^^^^^^^^^^^^^^
|
note: required by a bound in `t::ConstDropWithBound`
--> $DIR/const-drop.rs:65:38
|
LL | pub struct ConstDropWithBound<T: const SomeTrait>(pub core::marker::PhantomData<T>);
| ^^^^^ required by this bound in `ConstDropWithBound`
error[E0277]: the trait bound `T: const SomeTrait` is not satisfied
--> $DIR/const-drop.rs:68:22
|
LL | fn drop(&mut self) {
| ^^^^
|
note: required by a bound in `t::ConstDropWithBound`
--> $DIR/const-drop.rs:65:38
|
LL | pub struct ConstDropWithBound<T: const SomeTrait>(pub core::marker::PhantomData<T>);
| ^^^^^ required by this bound in `ConstDropWithBound`
error[E0493]: destructor of `T` cannot be evaluated at compile-time
2024-08-17 12:19:34 +00:00
--> $DIR/const-drop.rs:18:32
2023-07-27 15:51:02 +00:00
|
LL | const fn a<T: ~const Destruct>(_: T) {}
| ^ the destructor for this type cannot be evaluated in constant functions
2024-06-25 09:50:01 +00:00
error[E0015]: cannot call non-const fn `<T as SomeTrait>::foo` in constant functions
2024-08-17 12:19:34 +00:00
--> $DIR/const-drop.rs:69:13
2023-07-27 15:51:02 +00:00
|
2024-06-25 09:50:01 +00:00
LL | T::foo();
| ^^^^^^^^
|
2024-06-25 09:50:01 +00: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-06-25 09:50:01 +00:00
LL + #![feature(effects)]
|
2023-07-27 15:51:02 +00:00
error: aborting due to 10 previous errors
2023-07-27 15:51:02 +00:00
Some errors have detailed explanations: E0015, E0277, E0493.
2024-06-25 09:50:01 +00:00
For more information about an error, try `rustc --explain E0015`.