diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/rfc-2091-track-caller/const-caller-location.rs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/rfc-2091-track-caller/const-caller-location.rs')
-rw-r--r-- | src/test/ui/rfc-2091-track-caller/const-caller-location.rs | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/test/ui/rfc-2091-track-caller/const-caller-location.rs b/src/test/ui/rfc-2091-track-caller/const-caller-location.rs deleted file mode 100644 index 6e15cf3fe..000000000 --- a/src/test/ui/rfc-2091-track-caller/const-caller-location.rs +++ /dev/null @@ -1,43 +0,0 @@ -// run-pass -// revisions: default mir-opt -//[mir-opt] compile-flags: -Zmir-opt-level=4 - -#![feature(const_caller_location)] - -use std::panic::Location; - -const LOCATION: &Location = Location::caller(); - -const TRACKED: &Location = tracked(); -#[track_caller] -const fn tracked() -> &'static Location <'static> { - Location::caller() -} - -const NESTED: &Location = nested_location(); -const fn nested_location() -> &'static Location<'static> { - Location::caller() -} - -const CONTAINED: &Location = contained(); -const fn contained() -> &'static Location<'static> { - tracked() -} - -fn main() { - assert_eq!(LOCATION.file(), file!()); - assert_eq!(LOCATION.line(), 9); - assert_eq!(LOCATION.column(), 29); - - assert_eq!(TRACKED.file(), file!()); - assert_eq!(TRACKED.line(), 11); - assert_eq!(TRACKED.column(), 28); - - assert_eq!(NESTED.file(), file!()); - assert_eq!(NESTED.line(), 19); - assert_eq!(NESTED.column(), 5); - - assert_eq!(CONTAINED.file(), file!()); - assert_eq!(CONTAINED.line(), 24); - assert_eq!(CONTAINED.column(), 5); -} |