about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-07-29 09:35:23 +0000
committerbors <bors@rust-lang.org>2021-07-29 09:35:23 +0000
commit5fb3394cbdf0622c9d0c292feb55db0f4c828dc3 (patch)
treee1521a5f4ca5e5e8b6e971c7635c10e979974911 /src/test
parent6e0a8bf7901a3fe2e073b1e702e80f58b76d5087 (diff)
parent3f6dc9a8abe9ffd804fed2ddaabb1c67de4c8fbd (diff)
downloadrust-5fb3394cbdf0622c9d0c292feb55db0f4c828dc3.tar.gz
rust-5fb3394cbdf0622c9d0c292feb55db0f4c828dc3.zip
Auto merge of #86664 - m-ou-se:uninit-track-caller, r=JohnTitor
Add #[track_caller] for some function in core::mem.

These functions can panic for some types. This makes the panic point to the code that calls e.g. mem::uninitialized(), instead of inside the definition of mem::uninitialized.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/consts/assume-type-intrinsics.stderr12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/test/ui/consts/assume-type-intrinsics.stderr b/src/test/ui/consts/assume-type-intrinsics.stderr
index d46ce44b7ba..e660730396f 100644
--- a/src/test/ui/consts/assume-type-intrinsics.stderr
+++ b/src/test/ui/consts/assume-type-intrinsics.stderr
@@ -1,17 +1,9 @@
 error: any use of this value will cause an error
-  --> $SRC_DIR/core/src/mem/maybe_uninit.rs:LL:COL
-   |
-LL |               intrinsics::assert_inhabited::<T>();
-   |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |               |
-   |               aborted execution: attempted to instantiate uninhabited type `!`
-   |               inside `MaybeUninit::<!>::assume_init` at $SRC_DIR/core/src/mem/maybe_uninit.rs:LL:COL
-   |               inside `_BAD` at $DIR/assume-type-intrinsics.rs:11:9
-   | 
-  ::: $DIR/assume-type-intrinsics.rs:10:5
+  --> $DIR/assume-type-intrinsics.rs:11:9
    |
 LL | /     const _BAD: () = unsafe {
 LL | |         MaybeUninit::<!>::uninit().assume_init();
+   | |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ aborted execution: attempted to instantiate uninhabited type `!`
 LL | |     };
    | |______-
    |