Skip to content

Commit

Permalink
Ignore cloned_instead_of_copied clippy lint
Browse files Browse the repository at this point in the history
The .clippy.toml declares this crate's msrv as 1.31.0, so it is a Clippy
bug that this lint is triggering in the first place. Option::copied is
from Rust 1.35.

rust-lang/rust-clippy#7127

    error: used `cloned` where `copied` could be used instead
       --> src/error.rs:248:14
        |
    248 |             .cloned()
        |              ^^^^^^ help: try: `copied`
        |
        = note: `-D clippy::cloned-instead-of-copied` implied by `-D clippy::pedantic`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cloned_instead_of_copied

    error: used `cloned` where `copied` could be used instead
       --> src/error.rs:250:39
        |
    250 |         let end = self.end_span.get().cloned().unwrap_or_else(Span::call_site);
        |                                       ^^^^^^ help: try: `copied`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cloned_instead_of_copied

    error: used `cloned` where `copied` could be used instead
       --> src/error.rs:337:14
        |
    337 |             .cloned()
        |              ^^^^^^ help: try: `copied`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cloned_instead_of_copied

    error: used `cloned` where `copied` could be used instead
       --> src/error.rs:339:39
        |
    339 |         let end = self.end_span.get().cloned().unwrap_or_else(Span::call_site);
        |                                       ^^^^^^ help: try: `copied`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cloned_instead_of_copied
  • Loading branch information
dtolnay committed Apr 25, 2021
1 parent 97a0f71 commit e75710d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@
// Ignored clippy_pedantic lints.
#![allow(
clippy::cast_possible_truncation,
// clippy bug: https://github.com/rust-lang/rust-clippy/issues/7127
clippy::cloned_instead_of_copied,
clippy::default_trait_access,
clippy::empty_enum,
clippy::expl_impl_clone_on_copy,
Expand Down

0 comments on commit e75710d

Please sign in to comment.