about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2021-06-27 12:41:50 +0000
committerMara Bos <m-ou.se@m-ou.se>2021-07-28 14:34:36 +0200
commit3f6dc9a8abe9ffd804fed2ddaabb1c67de4c8fbd (patch)
tree226343744c4d375c6fcb3841a3a893405e57e253 /src/test
parenteba3228b2a9875d268ff3990903d04e19f6cdb0c (diff)
downloadrust-3f6dc9a8abe9ffd804fed2ddaabb1c67de4c8fbd.tar.gz
rust-3f6dc9a8abe9ffd804fed2ddaabb1c67de4c8fbd.zip
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 | |     };
    | |______-
    |