2 // revisions: default mir-opt
3 //[mir-opt] compile-flags: -Zmir-opt-level=4
11 let expected_line = line!() - 1;
12 let location = std::panic::Location::caller();
13 assert_eq!(location.file(), file!());
14 assert_eq!(location.line(), expected_line, "call shims report location as fn definition");
24 let expected_line = line!() - 1;
25 let location = std::panic::Location::caller();
26 assert_eq!(location.file(), file!());
27 assert_eq!(location.line(), expected_line, "call shims report location as fn definition");
33 fn trait_tracked_default() {
34 let expected_line = line!() - 1;
35 let location = std::panic::Location::caller();
36 assert_eq!(location.file(), file!());
37 assert_eq!(location.line(), expected_line, "call shims report location as fn definition");
41 impl TrackedTrait for () {}
43 trait TraitBlanketTracked {
48 impl TraitBlanketTracked for () {
49 fn tracked_blanket() {
50 let expected_line = line!() - 1;
51 let location = std::panic::Location::caller();
52 assert_eq!(location.file(), file!());
53 assert_eq!(location.line(), expected_line, "call shims report location as fn definition");
59 ptr_call(<() as Trait>::trait_tracked);
60 ptr_call(<() as TrackedTrait>::trait_tracked_default);
61 ptr_call(<() as TraitBlanketTracked>::tracked_blanket);