From df29c8730383b81ae1c1d24f71d684fc20ab5d16 Mon Sep 17 00:00:00 2001 From: Andre Bogus Date: Fri, 1 Sep 2017 22:43:34 +0200 Subject: [PATCH] some small doc improvements --- clippy_lints/src/overflow_check_conditional.rs | 1 - clippy_lints/src/regex.rs | 7 +++---- clippy_lints/src/types.rs | 6 +++++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/clippy_lints/src/overflow_check_conditional.rs b/clippy_lints/src/overflow_check_conditional.rs index 41ea6fbc461..ee44cc70b43 100644 --- a/clippy_lints/src/overflow_check_conditional.rs +++ b/clippy_lints/src/overflow_check_conditional.rs @@ -13,7 +13,6 @@ use utils::span_lint; /// ```rust /// a + b < a /// ``` - declare_lint! { pub OVERFLOW_CHECK_CONDITIONAL, Warn, diff --git a/clippy_lints/src/regex.rs b/clippy_lints/src/regex.rs index 2ee33013791..6ee357fd81f 100644 --- a/clippy_lints/src/regex.rs +++ b/clippy_lints/src/regex.rs @@ -11,10 +11,9 @@ use syntax::codemap::{Span, BytePos}; use syntax::symbol::InternedString; use utils::{is_expn_of, match_def_path, match_type, paths, span_lint, span_help_and_lint}; -/// **What it does:** Checks [regex] creation (with `Regex::new`, -/// `RegexBuilder::new` or `RegexSet::new`) for correct regex syntax. -/// -/// [regex]: https://crates.io/crates/regex +/// **What it does:** Checks [regex](https://crates.io/crates/regex) creation +/// (with `Regex::new`,`RegexBuilder::new` or `RegexSet::new`) for correct +/// regex syntax. /// /// **Why is this bad?** This will lead to a runtime panic. /// diff --git a/clippy_lints/src/types.rs b/clippy_lints/src/types.rs index 29a7bb75011..eaa01fb1d82 100644 --- a/clippy_lints/src/types.rs +++ b/clippy_lints/src/types.rs @@ -1008,7 +1008,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for CharLitAsU8 { /// that is is possible for `x` to be less than the minimum. Expressions like /// `max < x` are probably mistakes. /// -/// **Known problems:** None. +/// **Known problems:** For `usize` the size of the current compile target will +/// be assumed (e.g. 64 bits on 64 bit systems). This means code that uses such +/// a comparison to detect target pointer width will trigger this lint. One can +/// use `mem::sizeof` and compare its value or conditional compilation attributes +/// like `#[cfg(target_pointer_width = "64")] ..` instead. /// /// **Example:** /// ```rust