1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! Doc-tests not visible as part of the documentation.
/// It should not be possible to access the fields/variants of a derived factory type.
/// (This test isn't very good since it's trying to prove a negative with a guess...)
///
/// ```no_run
/// type _Foo = <Option<()> as ::exhaust::Exhaust>::Factory;
/// ```
///
/// ```compile_fail
/// type _Foo = <Option<()> as ::exhaust::Exhaust>::Factory;
/// _Foo::None;
/// ```
;
/// Conflicts with type names the macro defines.
/// Ideally, there would be no such conflicts possible, but until then, this test will fail if
/// *change* what names are generated, reminding us to think about it.
///
/// TODO: Reduce conflicts by having the macro avoid using identifiers that appear in the input.
///
/// ```compile_fail
/// type ExhaustFooIter = ();
///
/// #[derive(exhaust::Exhaust)]
/// struct Foo(ExhaustFooIter);
/// ```
///
/// ```compile_fail
/// type ExhaustFooFactory = ();
///
/// #[derive(exhaust::Exhaust)]
/// struct Foo(ExhaustFooFactory);
/// ```
;
/// Tests of the parsing of the `#[exhaust]` attribute.