Skip to content

Commit 7a58365

Browse files
committed
moved new test to updated test location
1 parent e8c8c6e commit 7a58365

File tree

2 files changed

+8
-39
lines changed

2 files changed

+8
-39
lines changed

core/tests/panic/location.rs

Lines changed: 0 additions & 39 deletions
This file was deleted.

coretests/tests/panic/location.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ fn location_const_column() {
4747
assert_eq!(COLUMN, 40);
4848
}
4949

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+
5058
#[test]
5159
fn location_debug() {
5260
let f = format!("{:?}", Location::caller());

0 commit comments

Comments
 (0)