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

The path in the error message on Windows contains multiple separators #13078

Closed
ahaoboy opened this issue Jul 9, 2024 · 3 comments
Closed

The path in the error message on Windows contains multiple separators #13078

ahaoboy opened this issue Jul 9, 2024 · 3 comments
Labels
C-bug Category: Clippy is not doing the correct thing

Comments

@ahaoboy
Copy link

ahaoboy commented Jul 9, 2024

Summary

image

warning: unused variable: `a`
 --> mpv-easy-ext\./src/main.rs:2:9
  |
2 |     let a = 1;
  |         ^ help: if this is intentional, prefix it with an underscore: `_a`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: `mpv-easy-ext` (bin "mpv-easy-ext") generated 1 warning
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.19s

Reproducer

I can’t reproduce this bug in a new cargo project.

git clone https://github.com/mpv-easy/mpv-easy.git

./mpv-easy/mpv-easy-ext/src/main.rs

fn main() {
    let a = 1;
}
cd  ./mpv-easy/mpv-easy-ext
 cargo clippy

I expected to see this happen:

warning: unused variable: `a`
 --> mpv-easy-ext/src/main.rs:2:9

Instead, this happened:

warning: unused variable: `a`
 --> mpv-easy-ext\./src/main.rs:2:9

Version

rustc 1.79.0 (129f3b996 2024-06-10)
binary: rustc
commit-hash: 129f3b9964af4d4a709d1383930ade12dfe7c081
commit-date: 2024-06-10
host: x86_64-pc-windows-gnu
release: 1.79.0
LLVM version: 18.1.7

Additional Labels

No response

@ahaoboy ahaoboy added the C-bug Category: Clippy is not doing the correct thing label Jul 9, 2024
@Alexendoo
Copy link
Member

Alexendoo commented Jul 9, 2024

It's because of the specified path in

[[bin]]
name = "mpv-easy-ext"
path = "./src/main.rs"

It would be a cargo issue that happens with cargo check/cargo build too so worth opening an issue there, I couldn't find an existing one from a quick search

@ahaoboy
Copy link
Author

ahaoboy commented Jul 9, 2024

It's because of the specified path in

[[bin]]
name = "mpv-easy-ext"
path = "./src/main.rs"

Thx

@Alexendoo
Copy link
Member

Closing in favour of the Cargo issue

@Alexendoo Alexendoo closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing
Projects
None yet
Development

No branches or pull requests

2 participants