-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing
Description
This is my project: https://github.com/matthiaskrgr/cargo-cache
With clippy, I was getting for example
warning: pub(crate) function inside private module
--> src/test_helpers.rs:38:1
|
38 | pub(crate) fn assert_path_end(path: &PathBuf, wanted_vector: &[&str]) {
| ----------^^^^^^^^^^^^^^^^^^^
| |
| help: consider using: `pub`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_pub_crate
However, when I make the function pub
pub fn assert_path_end(path: &PathBuf, wanted_vector: &[&str]) {
rustc warns:
Checking cargo-cache v0.4.1 (/home/matthias/vcs/github/cargo-cache)
warning: unreachable `pub` item
--> src/test_helpers.rs:38:1
|
38 | pub fn assert_path_end(path: &PathBuf, wanted_vector: &[&str]) {
| ---^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| help: consider restricting its visibility: `pub(crate)`
|
note: the lint level is defined here
--> src/main.rs:19:5
|
19 | unreachable_pub,
| ^^^^^^^^^^^^^^^
= help: or consider exporting it for use by other crates
Finished dev [unoptimized + debuginfo] target(s) in 0.40s
strohel, mohe2015, jwodder, BatmanAoD, GrantGryczan and 7 more
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thing