about summary refs log tree commit diff
path: root/tests/ui/consts
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-10-29 20:08:55 +0000
committerMichael Goulet <michael@errs.io>2024-11-22 16:54:40 +0000
commit59408add4d67e7e04fa1dcf378e4e1cc71c6ff48 (patch)
treeb9d50a919f1f8667097b6236cc177c4029b9019a /tests/ui/consts
parenta7d9ebdf088f166e91759ec5b3b0625e3c1d0c82 (diff)
downloadrust-59408add4d67e7e04fa1dcf378e4e1cc71c6ff48.tar.gz
rust-59408add4d67e7e04fa1dcf378e4e1cc71c6ff48.zip
Implement ~const Destruct in new solver
Diffstat (limited to 'tests/ui/consts')
-rw-r--r--tests/ui/consts/promoted_const_call.stderr25
1 files changed, 7 insertions, 18 deletions
diff --git a/tests/ui/consts/promoted_const_call.stderr b/tests/ui/consts/promoted_const_call.stderr
index bcb9dfb704b..7a96b6e7705 100644
--- a/tests/ui/consts/promoted_const_call.stderr
+++ b/tests/ui/consts/promoted_const_call.stderr
@@ -7,25 +7,13 @@ LL | impl const Drop for Panic { fn drop(&mut self) { panic!(); } }
    = 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_call.rs:10:26
-   |
-LL |     let _: &'static _ = &id(&Panic);
-   |            ----------    ^^^^^^^^^^ 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[E0716]: temporary value dropped while borrowed
+error[E0493]: destructor of `Panic` cannot be evaluated at compile-time
   --> $DIR/promoted_const_call.rs:10:30
    |
 LL |     let _: &'static _ = &id(&Panic);
-   |            ----------        ^^^^^ - temporary value is freed at the end of this statement
-   |            |                 |
-   |            |                 creates a temporary value which is freed while still in use
-   |            type annotation requires that borrow lasts for `'static`
+   |                              ^^^^^ - value is dropped here
+   |                              |
+   |                              the destructor for this type cannot be evaluated in constants
 
 error[E0716]: temporary value dropped while borrowed
   --> $DIR/promoted_const_call.rs:16:26
@@ -69,6 +57,7 @@ LL |     let _: &'static _ = &&(Panic, 0).1;
 LL | }
    | - temporary value is freed at the end of this statement
 
-error: aborting due to 7 previous errors
+error: aborting due to 6 previous errors
 
-For more information about this error, try `rustc --explain E0716`.
+Some errors have detailed explanations: E0493, E0716.
+For more information about an error, try `rustc --explain E0493`.