]>
git.proxmox.com Git - rustc.git/blob - vendor/thiserror/tests/test_from.rs
4 #[derive(Error, Debug)]
6 pub struct ErrorStruct
{
11 #[derive(Error, Debug)]
13 pub struct ErrorStructOptional
{
15 source
: Option
<io
::Error
>,
18 #[derive(Error, Debug)]
20 pub struct ErrorTuple(#[from] io::Error);
22 #[derive(Error, Debug)]
24 pub struct ErrorTupleOptional(#[from] Option<io::Error>);
26 #[derive(Error, Debug)]
35 #[derive(Error, Debug)]
37 pub enum ErrorEnumOptional
{
40 source
: Option
<io
::Error
>,
44 #[derive(Error, Debug)]
47 Any(#[from] anyhow::Error),
48 Io(#[from] io::Error),
51 fn assert_impl
<T
: From
<io
::Error
>>() {}
55 assert_impl
::<ErrorStruct
>();
56 assert_impl
::<ErrorStructOptional
>();
57 assert_impl
::<ErrorTuple
>();
58 assert_impl
::<ErrorTupleOptional
>();
59 assert_impl
::<ErrorEnum
>();
60 assert_impl
::<ErrorEnumOptional
>();
61 assert_impl
::<Many
>();