rust/tests/ui/consts/promoted-const-drop.stderr
2024-09-15 09:51:32 +02:00

34 lines
1.3 KiB
Plaintext

error: const `impl` for trait `Drop` which is not marked with `#[const_trait]`
--> $DIR/promoted-const-drop.rs:5:12
|
LL | impl const Drop for 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[E0716]: temporary value dropped while borrowed
--> $DIR/promoted-const-drop.rs:13:26
|
LL | let _: &'static A = &A();
| ---------- ^^^ creates a temporary value which is freed while still in use
| |
| type annotation requires that borrow lasts for `'static`
LL | let _: &'static [A] = &[C];
LL | }
| - temporary value is freed at the end of this statement
error[E0716]: temporary value dropped while borrowed
--> $DIR/promoted-const-drop.rs:14:28
|
LL | let _: &'static [A] = &[C];
| ------------ ^^^ creates a temporary value which is freed while still in use
| |
| type annotation requires that borrow lasts for `'static`
LL | }
| - temporary value is freed at the end of this statement
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0716`.