Closed
Description
Summary
I want to forbid std::time::Instant::now
, because it doesn't work on web/wasm:
❯ cat clippy.toml
disallowed-methods = ["std::time::Instant::now"]
Instead I want to use https://crates.io/crates/instant
However, when I use instant::Instant::now
I get a false-positive error.
Lint Name
disallowed_methods
Reproducer
I tried this code:
fn main() {
instant::Instant::now();
}
I saw this happen:
warning: use of a disallowed method `std::time::Instant::now`
--> src/main.rs:2:15
|
2 | let now = instant::Instant::now();
| ^^^^^^^^^^^^^^^^^^^^^^^
|
I expected to see this happen: No warning
Version
rustc 1.67.1 (d5a82bbd2 2023-02-07)
binary: rustc
commit-hash: d5a82bbd26e1ad8b7401f6a718a9c57c96905483
commit-date: 2023-02-07
host: aarch64-apple-darwin
release: 1.67.1
LLVM version: 15.0.6
Additional Labels
No response