We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8c8c6e commit 7a58365Copy full SHA for 7a58365
core/tests/panic/location.rs
coretests/tests/panic/location.rs
@@ -47,6 +47,14 @@ fn location_const_column() {
47
assert_eq!(COLUMN, 40);
48
}
49
50
+#[test]
51
+fn location_file_lifetime<'x>() {
52
+ // Verify that the returned `&str`s lifetime is derived from the generic
53
+ // lifetime 'a, not the lifetime of `&self`, when calling `Location::file`.
54
+ // Test failure is indicated by a compile failure, not a runtime panic.
55
+ let _: for<'a> fn(&'a Location<'x>) -> &'x str = Location::file;
56
+}
57
+
58
#[test]
59
fn location_debug() {
60
let f = format!("{:?}", Location::caller());
0 commit comments