Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unknown tool name \redpen\ in scoped lint when invoking redpen #7

Open
jrvanwhy opened this issue Dec 26, 2023 · 0 comments
Open

unknown tool name \redpen\ in scoped lint when invoking redpen #7

jrvanwhy opened this issue Dec 26, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@jrvanwhy
Copy link

I'm unable to successfully run Redpen 0.3.0. I think there's a bug in either redpen or redpen_wrapper, but it's also possible that this is user error.

Reproduction steps: Install Redpen using cargo +nightly-2023-11-01 install redpen-linter, and create a project with the following sources:

Cargo.toml:

[package]
name = "redpen_test"
version = "0.1.0"
edition = "2021"

rust-toolchain.toml:

[toolchain]
channel = "nightly-2023-11-01"

src/lib.rs:

//#![feature(register_tool)]
//#![register_tool(redpen)]
#[deny(redpen::panics)]
pub fn redpen_test() {
    panic!("Explicit panic that should make redpen error.");
}

When I invoke redpen, I get:

jrvanwhy@jrvanwhy:~/playground$ redpen
[... Cargo compiling dependency crates snipped ...]
   Compiling redpen_test v0.1.0 (/home/jrvanwhy/playground)
error[E0710]: unknown tool name `redpen` found in scoped lint: `redpen::panics`
 --> src/lib.rs:3:8
  |
3 | #[deny(redpen::panics)]
  |        ^^^^^^
  |
  = help: add `#![register_tool(redpen)]` to the crate root

For more information about this error, try `rustc --explain E0710`.
    Finished dev [unoptimized + debuginfo] target(s) in 26.11s

If I uncomment the #![feature(register_tool)] and #![register_tool(redpen)] lines, I get:

jrvanwhy@jrvanwhy:~/playground$ redpen
   Compiling redpen_test v0.1.0 (/home/jrvanwhy/playground)
error: tool `redpen` was already registered
 --> <crate attribute>:1:15
  |
1 | register_tool(redpen)
  |               ^^^^^^
  |
 ::: src/lib.rs:2:18
  |
2 | #![register_tool(redpen)]
  |                  ------ already registered here

error[E0636]: the feature `register_tool` has already been declared
 --> <crate attribute>:1:9
  |
1 | feature(register_tool)
  |         ^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0636`.
    Finished dev [unoptimized + debuginfo] target(s) in 0.09s
@estebank estebank added the bug Something isn't working label Dec 26, 2023
@estebank estebank self-assigned this Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants