I would like to write a function that accesses the file and line number of the location in which it gets called.
It would look like this:
fn main() {
prints_calling_location(); // would print `called from line: 2`
prints_calling_location(); // would print `called from line: 3`
}
fn prints_calling_location() {
let caller_line_number = /* ??? */;
println!("called from line: {}", caller_line_number);
}