Skip to content

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

@ahaoboy

Description

@ahaoboy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions