Debian Codegraph @

.cargo/vendor/thiserror-1.0.59/build/probe.rs

raw
1 // This code exercises the surface area that we expect of the Error generic
2 // member access API. If the current toolchain is able to compile it, then
3 // thiserror is able to provide backtrace support.
4
5 #![feature(error_generic_member_access)]
6
7 use std::error::{Error, Request};
8 use std::fmt::{self, Debug, Display};
9
10 struct MyError(Thing);
11 struct Thing;
12
13 impl Debug for MyError {
14 fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result {
15 unimplemented!()
16 }
17 }
18
19 impl Display for MyError {
20 fn fmt(&self, _formatter: &mut fmt::Formatter) -> fmt::Result {
21 unimplemented!()
22 }
23 }
24
25 impl Error for MyError {
26 fn provide<'a>(&'a self, request: &mut Request<'a>) {
27 request.provide_ref(&self.0);
28 }
29 }
30
31 // Include in sccache cache key.
32 const _: Option<&str> = option_env!("RUSTC_BOOTSTRAP");