-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Document warning suppression heuristic #14337
Comments
We make passing references to cap lints at
iiuc we don't apply cap lints to local dependencies, assuming they are all in your repo and under your control. What is right for path patches is best described as "it depends". A question I have is where we could note this that people who need it can find it. In this case, the use case is confusion over patching. I'm unsure what other points of confusion there might be. We don't have a general "compilation" section in the docs. We could note this in one or several of
|
IMO there's no place in the docs currently where the info would fit nicely. Probably FAQ but then it's probably difficult to find. There's also #8546 which proposes an option to specify whether warnings from dependencies should be shown or not. To me (and the ones who commented on that issue), this sounds like a good addition. Additionally, if there was an optional key like Another idea would be to add a hint to the output of cargo when warnings from path dependencies are shown. Something like:
|
If we showed a note like that, we'd need to limit it to non-workspace member path dependencies. Even then, it could end up being annoying for people not in the |
Problem
Cargo suppresses warnings from depdendencies that are pulled in via git or crates.io. For path dependencies, warnings are shown.
I discovered this when I was patching a depdendency locally in a project that is compiled with
-D warnings
. There, the exact same crate that worked fine when pulled in via crates.io / git failed to compile when using a path dependency. That was pretty surprising and took me a while to figure out.I searched online but couldn't find any official documentation of this behavior. I think the heuristic makes sense, but it should be mentioned in the official docs.
Steps
I've created a small repo that demonstrates the different behavior for git and path dependencies: https:/felixwrt/cargo_warning_heuristic
Possible Solution(s)
Add some docs to the cargo book that explain this behavior.
Notes
I really hope I didn't miss that it's already in the docs. If that's the case: sry for the noise!
Version
The text was updated successfully, but these errors were encountered: