Fix separation of public vs internal parts of Location
This commit is contained in:
@@ -83,18 +83,6 @@ impl<'a> Location<'a> {
|
|||||||
pub const fn caller() -> &'static Location<'static> {
|
pub const fn caller() -> &'static Location<'static> {
|
||||||
crate::intrinsics::caller_location()
|
crate::intrinsics::caller_location()
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
impl<'a> Location<'a> {
|
|
||||||
#![unstable(
|
|
||||||
feature = "panic_internals",
|
|
||||||
reason = "internal details of the implementation of the `panic!` and related macros",
|
|
||||||
issue = "none"
|
|
||||||
)]
|
|
||||||
#[doc(hidden)]
|
|
||||||
pub const fn internal_constructor(file: &'a str, line: u32, col: u32) -> Self {
|
|
||||||
Location { file, line, col }
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns the name of the source file from which the panic originated.
|
/// Returns the name of the source file from which the panic originated.
|
||||||
///
|
///
|
||||||
@@ -179,6 +167,18 @@ impl<'a> Location<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[unstable(
|
||||||
|
feature = "panic_internals",
|
||||||
|
reason = "internal details of the implementation of the `panic!` and related macros",
|
||||||
|
issue = "none"
|
||||||
|
)]
|
||||||
|
impl<'a> Location<'a> {
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub const fn internal_constructor(file: &'a str, line: u32, col: u32) -> Self {
|
||||||
|
Location { file, line, col }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[stable(feature = "panic_hook_display", since = "1.26.0")]
|
#[stable(feature = "panic_hook_display", since = "1.26.0")]
|
||||||
impl fmt::Display for Location<'_> {
|
impl fmt::Display for Location<'_> {
|
||||||
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
|||||||
Reference in New Issue
Block a user