1 use core::panic::Location;
3 // Note: Some of the following tests depend on the source location,
4 // so please be careful when editing this file.
7 fn location_const_caller() {
8 const _CALLER_REFERENCE: &Location<'static> = Location::caller();
9 const _CALLER: Location<'static> = *Location::caller();
13 fn location_const_file() {
14 const CALLER: &Location<'static> = Location::caller();
15 const FILE: &str = CALLER.file();
16 assert_eq!(FILE, file!());
20 fn location_const_line() {
21 const CALLER: &Location<'static> = Location::caller();
22 const LINE: u32 = CALLER.line();
27 fn location_const_column() {
28 const CALLER: &Location<'static> = Location::caller();
29 const COLUMN: u32 = CALLER.column();
30 assert_eq!(COLUMN, 40);