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

lint message paths are absolute in some cases #82276

Open
matthiaskrgr opened this issue Feb 18, 2021 · 0 comments
Open

lint message paths are absolute in some cases #82276

matthiaskrgr opened this issue Feb 18, 2021 · 0 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Feb 18, 2021

mkdir test
cd test
wget https://crates.io/api/v1/crates/crc/1.8.1/download
mv download crc-1.8.1.tar.gz
tar -xvf crc-1.8.1.tar.gz
cd crc-1.8.1
cargo clippy -- -Wclippy::pedantic

The crate seems to generate some code as part of its build.rs and that code is dumped somewhere into the target dir.
Now when we issue lint warnings about that code (that is inside the target dir), the path to the file is an absolute (canonicalized?) path and not a relative path from the crate root, as usual:

warning: long literal lacking separators
   --> /tmp/test/crc-1.8.1/target/debug/build/crc-a8ff9075a6d24ab1/out/crc64_constants.rs:509:5
    |
509 |     11317545863582056448,
    |     ^^^^^^^^^^^^^^^^^^^^ help: consider: `11_317_545_863_582_056_448`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unreadable_literal

Is that intentional?
Why is it not a relative path from the crate root like all the warnings (something like target/debug/build/crc-a8ff9075a6d24ab1/out/crc64_constants.rs:509:5)

@jyn514 jyn514 added the A-diagnostics Area: Messages for errors, warnings, and lints label Feb 19, 2021
@Noratrieb Noratrieb added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants