| 1 |
#![no_std] |
| 2 |
#![allow(unused)] |
| 3 |
|
| 4 |
// This test ensures that the generated code doesn't reference any stdlib items. |
| 5 |
|
| 6 |
use displaydoc::Display; |
| 7 |
|
| 8 |
#[derive(Display)] |
| 9 |
/// Just a basic struct {thing} |
| 10 |
struct HappyStruct { |
| 11 |
thing: &'static str, |
| 12 |
} |
| 13 |
|
| 14 |
#[derive(Display)] |
| 15 |
#[ignore_extra_doc_attributes] |
| 16 |
/// Just a basic struct {thing} |
| 17 |
/// and this line should get ignored |
| 18 |
struct HappyStruct2 { |
| 19 |
thing: &'static str, |
| 20 |
} |
| 21 |
|
| 22 |
#[derive(Display)] |
| 23 |
enum Happy { |
| 24 |
/// I really like Variant1 |
| 25 |
Variant1, |
| 26 |
/// Variant2 is pretty swell 2 |
| 27 |
Variant2, |
| 28 |
/// Variant3 is okay {sometimes} |
| 29 |
Variant3 { sometimes: &'static str }, |
| 30 |
/** |
| 31 |
* Variant4 wants to have a lot of lines |
| 32 |
* |
| 33 |
* Lets see how this works out for it |
| 34 |
*/ |
| 35 |
Variant4, |
| 36 |
/// Variant5 has a parameter {0} and some regular comments |
| 37 |
// A regular comment that won't get picked |
| 38 |
Variant5(u32), |
| 39 |
|
| 40 |
/// These docs are ignored |
| 41 |
#[displaydoc("Variant7 has a parameter {0} and uses #[displaydoc]")] |
| 42 |
/// These docs are also ignored |
| 43 |
Variant7(u32), |
| 44 |
} |