-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have
Description
Summary
This isn't actually a false positive, because macro is expanded. But, may be some additional rules for macros from outside?
Lint Name
clippy::std_instead_of_core
Reproducer
I tried this code:
#![warn(clippy::std_instead_of_core)]
#[derive(Debug, thiserror::Error)]
enum Error {
#[error("empty")]
Empty,
}
fn main() {
let _ = Error::Empty;
}
I saw this happen:
warning: used import from `std` instead of `core`
--> src/main.rs:3:17
|
3 | #[derive(Debug, thiserror::Error)]
| ^^^^^^^^^^^^^^^^
|
= help: consider importing the item from `core`
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core
note: the lint level is defined here
--> src/main.rs:1:9
|
1 | #![warn(clippy::std_instead_of_core)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this warning originates in the derive macro `thiserror::Error` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: 1 warning emitted
Finished dev [unoptimized + debuginfo] target(s) in 0.43s
Process finished with exit code 0
Version
rustc 1.66.1 (90743e729 2023-01-10)
binary: rustc
commit-hash: 90743e7298aca107ddaa0c202a4d3604e29bfeb6
commit-date: 2023-01-10
host: x86_64-apple-darwin
release: 1.66.1
LLVM version: 15.0.2
Additional Labels
No response
vic1707
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have