diff options
Diffstat (limited to 'src/test/ui/rfc-2091-track-caller/track-caller-attribute.rs')
-rw-r--r-- | src/test/ui/rfc-2091-track-caller/track-caller-attribute.rs | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/src/test/ui/rfc-2091-track-caller/track-caller-attribute.rs b/src/test/ui/rfc-2091-track-caller/track-caller-attribute.rs deleted file mode 100644 index 9d28eb9de..000000000 --- a/src/test/ui/rfc-2091-track-caller/track-caller-attribute.rs +++ /dev/null @@ -1,40 +0,0 @@ -// run-pass -// revisions: default mir-opt -//[mir-opt] compile-flags: -Zmir-opt-level=4 - -use std::panic::Location; - -#[track_caller] -fn tracked() -> &'static Location<'static> { - Location::caller() -} - -fn nested_intrinsic() -> &'static Location<'static> { - Location::caller() -} - -fn nested_tracked() -> &'static Location<'static> { - tracked() -} - -fn main() { - let location = Location::caller(); - assert_eq!(location.file(), file!()); - assert_eq!(location.line(), 21); - assert_eq!(location.column(), 20); - - let tracked = tracked(); - assert_eq!(tracked.file(), file!()); - assert_eq!(tracked.line(), 26); - assert_eq!(tracked.column(), 19); - - let nested = nested_intrinsic(); - assert_eq!(nested.file(), file!()); - assert_eq!(nested.line(), 13); - assert_eq!(nested.column(), 5); - - let contained = nested_tracked(); - assert_eq!(contained.file(), file!()); - assert_eq!(contained.line(), 17); - assert_eq!(contained.column(), 5); -} |