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