Skip to content

Commit 48ae5a0

Browse files
committed
fix lint docs
1 parent 1603715 commit 48ae5a0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

clippy_lints/src/default_constructed_unit_structs.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ declare_clippy_lint! {
1515
///
1616
/// ### Example
1717
/// ```rust
18+
/// # use std::marker::PhantomData;
1819
/// #[derive(Default)]
1920
/// struct S<T> {
2021
/// _marker: PhantomData<T>
@@ -26,9 +27,14 @@ declare_clippy_lint! {
2627
/// ```
2728
/// Use instead:
2829
/// ```rust
29-
/// let _: S<i32> = Something {
30-
/// _marker: PhantomData
30+
/// # use std::marker::PhantomData;
31+
/// struct S<T> {
32+
/// _marker: PhantomData<T>
3133
/// }
34+
///
35+
/// let _: S<i32> = S {
36+
/// _marker: PhantomData
37+
/// };
3238
/// ```
3339
#[clippy::version = "1.71.0"]
3440
pub DEFAULT_CONSTRUCTED_UNIT_STRUCTS,

0 commit comments

Comments
 (0)