rust/tests/ui/consts/promoted-const-drop.stderr

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

34 lines
1.3 KiB
Plaintext
Raw Normal View History

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
error[E0716]: temporary value dropped while borrowed
2024-08-17 07:19:34 -05:00
--> $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
2024-08-17 07:19:34 -05:00
--> $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
2024-06-25 03:36:40 -05:00
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0716`.