about summary refs log tree commit diff
path: root/library/coretests
diff options
context:
space:
mode:
authorJakub Beránek <berykubik@gmail.com>2025-06-16 14:31:11 +0200
committerGitHub <noreply@github.com>2025-06-16 14:31:11 +0200
commitd9c83bb033c1c135c7f558116b8afdf90c0d0b50 (patch)
tree18db3d545c6c0ce0430a0c69cfef63a91969e07d /library/coretests
parent6092c1a074966d5c9eb81df2997c3729cca779b7 (diff)
parent5ac1cd9c7da72eed5bce611755ca185a88aef84f (diff)
downloadrust-d9c83bb033c1c135c7f558116b8afdf90c0d0b50.tar.gz
rust-d9c83bb033c1c135c7f558116b8afdf90c0d0b50.zip
Rollup merge of #142373 - m-ou-se:debug-for-location, r=tgross35
Fix Debug for Location

Fixes https://github.com/rust-lang/rust/issues/142279
Diffstat (limited to 'library/coretests')
-rw-r--r--library/coretests/tests/panic/location.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/library/coretests/tests/panic/location.rs b/library/coretests/tests/panic/location.rs
index d20241d8380..5ce0b06e90e 100644
--- a/library/coretests/tests/panic/location.rs
+++ b/library/coretests/tests/panic/location.rs
@@ -29,3 +29,11 @@ fn location_const_column() {
     const COLUMN: u32 = CALLER.column();
     assert_eq!(COLUMN, 40);
 }
+
+#[test]
+fn location_debug() {
+    let f = format!("{:?}", Location::caller());
+    assert!(f.contains(&format!("{:?}", file!())));
+    assert!(f.contains("35"));
+    assert!(f.contains("29"));
+}