Skip to content

Commit fe3e682

Browse files
committed
Auto merge of #12144 - blyxyas:10283-postfix, r=llogiq
Add . to end of lint lists in configuration + Fix typo in pub_underscore_fields_behavior Fixes #10283 (comment) In the "/// Lint: " list on each configuration option, you have to end with a dot. If the lint list doesn't have a dot, the configuration won't have documentation. This PR adds those missing dots in some of the configuration, thus also adding their documentation. changelog: Fix bug where a lot of config documentation wasn't showing. changelog: Fix typo in `pub_underscore_fields_behavior` (`PublicallyExported` -> `PubliclyExported`)
2 parents 70573af + 44f5d96 commit fe3e682

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

book/src/lint_configuration.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,8 @@ Additional dotfiles (files or directories starting with a dot) to allow
769769

770770

771771
## `enforce-iter-loop-reborrow`
772+
Whether to recommend using implicit into iter for reborrowed values.
773+
772774
#### Example
773775
```no_run
774776
let mut vec = vec![1, 2, 3];
@@ -793,7 +795,7 @@ for _ in &mut *rmvec {}
793795

794796

795797
## `check-private-items`
796-
798+
Whether to also run the listed lints on private items.
797799

798800
**Default Value:** `false`
799801

@@ -806,9 +808,10 @@ for _ in &mut *rmvec {}
806808

807809

808810
## `pub-underscore-fields-behavior`
811+
Lint "public" fields in a struct that are prefixed with an underscore based on their
812+
exported visibility, or whether they are marked as "pub".
809813

810-
811-
**Default Value:** `"PublicallyExported"`
814+
**Default Value:** `"PubliclyExported"`
812815

813816
---
814817
**Affected lints:**

clippy_config/src/conf.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ define_Conf! {
523523
///
524524
/// Additional dotfiles (files or directories starting with a dot) to allow
525525
(allowed_dotfiles: FxHashSet<String> = FxHashSet::default()),
526-
/// Lint: EXPLICIT_ITER_LOOP
526+
/// Lint: EXPLICIT_ITER_LOOP.
527527
///
528528
/// Whether to recommend using implicit into iter for reborrowed values.
529529
///
@@ -543,15 +543,15 @@ define_Conf! {
543543
/// for _ in &mut *rmvec {}
544544
/// ```
545545
(enforce_iter_loop_reborrow: bool = false),
546-
/// Lint: MISSING_SAFETY_DOC, UNNECESSARY_SAFETY_DOC, MISSING_PANICS_DOC, MISSING_ERRORS_DOC
546+
/// Lint: MISSING_SAFETY_DOC, UNNECESSARY_SAFETY_DOC, MISSING_PANICS_DOC, MISSING_ERRORS_DOC.
547547
///
548548
/// Whether to also run the listed lints on private items.
549549
(check_private_items: bool = false),
550-
/// Lint: PUB_UNDERSCORE_FIELDS
550+
/// Lint: PUB_UNDERSCORE_FIELDS.
551551
///
552552
/// Lint "public" fields in a struct that are prefixed with an underscore based on their
553553
/// exported visibility, or whether they are marked as "pub".
554-
(pub_underscore_fields_behavior: PubUnderscoreFieldsBehaviour = PubUnderscoreFieldsBehaviour::PublicallyExported),
554+
(pub_underscore_fields_behavior: PubUnderscoreFieldsBehaviour = PubUnderscoreFieldsBehaviour::PubliclyExported),
555555
}
556556

557557
/// Search for the configuration file.

clippy_config/src/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,6 @@ unimplemented_serialize! {
129129

130130
#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)]
131131
pub enum PubUnderscoreFieldsBehaviour {
132-
PublicallyExported,
132+
PubliclyExported,
133133
AllPubFields,
134134
}

clippy_lints/src/pub_underscore_fields.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl<'tcx> LateLintPass<'tcx> for PubUnderscoreFields {
5454
};
5555

5656
let is_visible = |field: &FieldDef<'_>| match self.behavior {
57-
PubUnderscoreFieldsBehaviour::PublicallyExported => cx.effective_visibilities.is_reachable(field.def_id),
57+
PubUnderscoreFieldsBehaviour::PubliclyExported => cx.effective_visibilities.is_reachable(field.def_id),
5858
PubUnderscoreFieldsBehaviour::AllPubFields => {
5959
// If there is a visibility span then the field is marked pub in some way.
6060
!field.vis_span.is_empty()
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pub-underscore-fields-behavior = "PublicallyExported"
1+
pub-underscore-fields-behavior = "PubliclyExported"

0 commit comments

Comments
 (0)