diff options
| author | David Tolnay <dtolnay@gmail.com> | 2021-02-07 16:54:09 -0800 |
|---|---|---|
| committer | David Tolnay <dtolnay@gmail.com> | 2021-02-07 16:54:09 -0800 |
| commit | fd35517bd47372a4c9bbd436f3d6885cdc452e7f (patch) | |
| tree | 17fb5a3cd3ffe879122df72b2b645273e6e72a98 | |
| parent | de35c297bf7464e891ada4899470b60aa60db87f (diff) | |
| download | rust-fd35517bd47372a4c9bbd436f3d6885cdc452e7f.tar.gz rust-fd35517bd47372a4c9bbd436f3d6885cdc452e7f.zip | |
Downgrade trivial_regex to nursery
| -rw-r--r-- | clippy_lints/src/lib.rs | 3 | ||||
| -rw-r--r-- | clippy_lints/src/regex.rs | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/clippy_lints/src/lib.rs b/clippy_lints/src/lib.rs index fe4aa584b18..6e693ccd75c 100644 --- a/clippy_lints/src/lib.rs +++ b/clippy_lints/src/lib.rs @@ -1628,7 +1628,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(&reference::DEREF_ADDROF), LintId::of(&reference::REF_IN_DEREF), LintId::of(®ex::INVALID_REGEX), - LintId::of(®ex::TRIVIAL_REGEX), LintId::of(&repeat_once::REPEAT_ONCE), LintId::of(&returns::LET_AND_RETURN), LintId::of(&returns::NEEDLESS_RETURN), @@ -1791,7 +1790,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(&ranges::MANUAL_RANGE_CONTAINS), LintId::of(&redundant_field_names::REDUNDANT_FIELD_NAMES), LintId::of(&redundant_static_lifetimes::REDUNDANT_STATIC_LIFETIMES), - LintId::of(®ex::TRIVIAL_REGEX), LintId::of(&returns::LET_AND_RETURN), LintId::of(&returns::NEEDLESS_RETURN), LintId::of(&single_component_path_imports::SINGLE_COMPONENT_PATH_IMPORTS), @@ -2021,6 +2019,7 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf: LintId::of(&needless_borrow::NEEDLESS_BORROW), LintId::of(&path_buf_push_overwrite::PATH_BUF_PUSH_OVERWRITE), LintId::of(&redundant_pub_crate::REDUNDANT_PUB_CRATE), + LintId::of(®ex::TRIVIAL_REGEX), LintId::of(&strings::STRING_LIT_AS_BYTES), LintId::of(&transmute::USELESS_TRANSMUTE), LintId::of(&use_self::USE_SELF), diff --git a/clippy_lints/src/regex.rs b/clippy_lints/src/regex.rs index d06ab143482..1edea613148 100644 --- a/clippy_lints/src/regex.rs +++ b/clippy_lints/src/regex.rs @@ -35,14 +35,16 @@ declare_clippy_lint! { /// `str::starts_with`, `str::ends_with` or `std::contains` or other `str` /// methods. /// - /// **Known problems:** None. + /// **Known problems:** If the same regex is going to be applied to multiple + /// inputs, the precomputations done by `Regex` construction can give + /// significantly better performance than any of the `str`-based methods. /// /// **Example:** /// ```ignore /// Regex::new("^foobar") /// ``` pub TRIVIAL_REGEX, - style, + nursery, "trivial regular expressions" } |
