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.
2 parents c595742 + 10c3f60 commit 4599842Copy full SHA for 4599842
src/error.rs
@@ -19,6 +19,17 @@ pub struct Error {
19
type_name: Option<&'static str>,
20
}
21
22
+#[allow(unreachable_pub)]
23
+#[derive(Debug)]
24
+#[doc(hidden)]
25
+pub struct BacktracePlaceholder;
26
+
27
+impl Display for BacktracePlaceholder {
28
+ fn fmt(&self, _: &mut fmt::Formatter<'_>) -> fmt::Result {
29
+ unreachable!()
30
+ }
31
+}
32
33
impl Error {
34
/// Create a new error object from any error type.
35
///
@@ -108,7 +119,7 @@ impl Error {
108
119
109
120
#[cfg(not(backtrace))]
110
121
#[allow(missing_docs)]
111
- pub fn backtrace(&self) -> Option<()> {
122
+ pub const fn backtrace(&self) -> Option<BacktracePlaceholder> {
112
123
None
113
124
114
125
0 commit comments