summaryrefslogtreecommitdiffstats
path: root/library/core/src/panic/location.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--library/core/src/panic/location.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/library/core/src/panic/location.rs b/library/core/src/panic/location.rs
index 8eefd9ff2..6dcf23dde 100644
--- a/library/core/src/panic/location.rs
+++ b/library/core/src/panic/location.rs
@@ -123,8 +123,9 @@ impl<'a> Location<'a> {
/// ```
#[must_use]
#[stable(feature = "panic_hooks", since = "1.10.0")]
+ #[rustc_const_unstable(feature = "const_location_fields", issue = "102911")]
#[inline]
- pub fn file(&self) -> &str {
+ pub const fn file(&self) -> &str {
self.file
}
@@ -147,8 +148,9 @@ impl<'a> Location<'a> {
/// ```
#[must_use]
#[stable(feature = "panic_hooks", since = "1.10.0")]
+ #[rustc_const_unstable(feature = "const_location_fields", issue = "102911")]
#[inline]
- pub fn line(&self) -> u32 {
+ pub const fn line(&self) -> u32 {
self.line
}
@@ -171,8 +173,9 @@ impl<'a> Location<'a> {
/// ```
#[must_use]
#[stable(feature = "panic_col", since = "1.25.0")]
+ #[rustc_const_unstable(feature = "const_location_fields", issue = "102911")]
#[inline]
- pub fn column(&self) -> u32 {
+ pub const fn column(&self) -> u32 {
self.col
}
}