mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Fix documentation
This commit is contained in:
parent
4c347320be
commit
8ac545d0fe
@ -72,7 +72,7 @@ All notable changes to this project will be documented in this file.
|
||||
## ~~0.0.52~~
|
||||
|
||||
## 0.0.51 — 2016-03-13
|
||||
* Add `str` to types considered by `len_zero`
|
||||
* Add `str` to types considered by [`len_zero`]
|
||||
* New lints: [`indexing_slicing`]
|
||||
|
||||
## 0.0.50 — 2016-03-11
|
||||
|
@ -74,7 +74,7 @@ name
|
||||
[ineffective_bit_mask](https://github.com/Manishearth/rust-clippy/wiki#ineffective_bit_mask) | warn | expressions where a bit mask will be rendered useless by a comparison, e.g. `(x | 1) > 2`
|
||||
[inline_always](https://github.com/Manishearth/rust-clippy/wiki#inline_always) | warn | `#[inline(always)]` is a bad idea in most cases
|
||||
[integer_arithmetic](https://github.com/Manishearth/rust-clippy/wiki#integer_arithmetic) | allow | Any integer arithmetic statement
|
||||
[invalid_regex](https://github.com/Manishearth/rust-clippy/wiki#invalid_regex) | deny | finds invalid regular expressions in `Regex::new(_)` invocations
|
||||
[invalid_regex](https://github.com/Manishearth/rust-clippy/wiki#invalid_regex) | deny | finds invalid regular expressions
|
||||
[invalid_upcast_comparisons](https://github.com/Manishearth/rust-clippy/wiki#invalid_upcast_comparisons) | allow | a comparison involving an upcast which is always true or false
|
||||
[items_after_statements](https://github.com/Manishearth/rust-clippy/wiki#items_after_statements) | allow | finds blocks where an item comes after a statement
|
||||
[iter_next_loop](https://github.com/Manishearth/rust-clippy/wiki#iter_next_loop) | warn | for-looping over `_.next()` which is probably not intended
|
||||
@ -150,7 +150,7 @@ name
|
||||
[too_many_arguments](https://github.com/Manishearth/rust-clippy/wiki#too_many_arguments) | warn | functions with too many arguments
|
||||
[toplevel_ref_arg](https://github.com/Manishearth/rust-clippy/wiki#toplevel_ref_arg) | warn | An entire binding was declared as `ref`, in a function argument (`fn foo(ref x: Bar)`), or a `let` statement (`let ref x = foo()`). In such cases, it is preferred to take references with `&`.
|
||||
[transmute_ptr_to_ref](https://github.com/Manishearth/rust-clippy/wiki#transmute_ptr_to_ref) | warn | transmutes from a pointer to a reference type
|
||||
[trivial_regex](https://github.com/Manishearth/rust-clippy/wiki#trivial_regex) | warn | finds trivial regular expressions in `Regex::new(_)` invocations
|
||||
[trivial_regex](https://github.com/Manishearth/rust-clippy/wiki#trivial_regex) | warn | finds trivial regular expressions
|
||||
[type_complexity](https://github.com/Manishearth/rust-clippy/wiki#type_complexity) | warn | usage of very complex types; recommends factoring out parts into `type` definitions
|
||||
[unicode_not_nfc](https://github.com/Manishearth/rust-clippy/wiki#unicode_not_nfc) | allow | using a unicode literal not in NFC normal form (see [unicode tr15](http://www.unicode.org/reports/tr15/) for further information)
|
||||
[unit_cmp](https://github.com/Manishearth/rust-clippy/wiki#unit_cmp) | warn | comparing unit values (which is always `true` or `false`, respectively)
|
||||
|
12
src/regex.rs
12
src/regex.rs
@ -11,7 +11,8 @@ use syntax::codemap::{Span, BytePos};
|
||||
use syntax::parse::token::InternedString;
|
||||
use utils::{is_expn_of, match_def_path, match_type, paths, span_lint, span_help_and_lint};
|
||||
|
||||
/// **What it does:** This lint checks `Regex::new(_)` invocations for correct regex syntax.
|
||||
/// **What it does:** This lint checks [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.
|
||||
///
|
||||
@ -21,10 +22,11 @@ use utils::{is_expn_of, match_def_path, match_type, paths, span_lint, span_help_
|
||||
declare_lint! {
|
||||
pub INVALID_REGEX,
|
||||
Deny,
|
||||
"finds invalid regular expressions in `Regex::new(_)` invocations"
|
||||
"finds invalid regular expressions"
|
||||
}
|
||||
|
||||
/// **What it does:** This lint checks for `Regex::new(_)` invocations with trivial regex.
|
||||
/// **What it does:** This lint checks for trivial [regex] creation (with `Regex::new`,
|
||||
/// `RegexBuilder::new` or `RegexSet::new`).
|
||||
///
|
||||
/// **Why is this bad?** This can likely be replaced by `==` or `str::starts_with`,
|
||||
/// `str::ends_with` or `std::contains` or other `str` methods.
|
||||
@ -32,10 +34,12 @@ declare_lint! {
|
||||
/// **Known problems:** None.
|
||||
///
|
||||
/// **Example:** `Regex::new("^foobar")`
|
||||
///
|
||||
/// [regex]: https://crates.io/crates/regex
|
||||
declare_lint! {
|
||||
pub TRIVIAL_REGEX,
|
||||
Warn,
|
||||
"finds trivial regular expressions in `Regex::new(_)` invocations"
|
||||
"finds trivial regular expressions"
|
||||
}
|
||||
|
||||
/// **What it does:** This lint checks for usage of `regex!(_)` which as of now is usually slower than `Regex::new(_)` unless called in a loop (which is a bad idea anyway).
|
||||
|
Loading…
Reference in New Issue
Block a user