-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
False positive caused by cross-crate pub use ... as ...
.
#573
Comments
I agree, this looks like a false positive. Sorry about that! I'm looking into it. I'm also in the middle of moving to a new apartment, so it might take me a few days longer than usual 😅 |
Ah wait, the cargo-semver-checks can currently only do local analysis, which means that it doesn't see items from foreign crates at all. This is due to several reasons. The biggest one is that there's currently no reliable way to determine which specific (possibly among multiple major versions) other crate an item came from: rust-lang/compiler-team#635 Once that's resolved, we're hoping for an update to the rustdoc JSON format to include the identifiers mentioned in that link, and we'll then need to generate multiple crates' rustdoc JSON (possibly on-the-fly) and combine them in the query engine. In the meantime, cargo-semver-checks is oblivious to foreign crates' items, including their local re-exports. So long story short, both "bug" and "works as intended" at the same time for the moment 😅 Resolving this will require a lot of work (not just from me but also from folks working on rustdoc JSON and the folks in the linked issue) so the best way to make this work happen faster is for someone on the zerocopy team to take a look at our GitHub Sponsors accounts :) |
pub use ... as ...
.pub use ... as ...
.
Makes sense! Is there any way to instruct cargo-semver-checks to skip a particular symbol? Either a CLI flag or an |
Unfortunately not at the moment. CLI flag per symbol is really clunky, and Thankfully, since |
Okay gotcha, thanks! It's not particularly high priority for us, but good to know there's an option if we decide to put more engineering effort towards it! |
In general if you decide to allocate some engineering effort toward |
Sounds good! Realistically, I think it's likely that we'll have higher priorities for at least the next few months, but if/when priorities change or we have more engineering hours to throw around, cargo-semver-checks will definitely be on the list! |
Steps to reproduce the bug with the above code
In google/zerocopy@10cb29b (in PR google/zerocopy#562), we are attempting to simplify our re-export of
core
(which we do so that our macros work across a variety of Rust editions and versions). Previously, we defined a modulecore_reexport
that re-exported a sub-set of core. Then, we realized we could just use-renamecore
ascore_reexport
:Actual Behaviour
This causes a semver check failure:
Expected Behaviour
I think this isn't a semver breaking change.
Generated System Information
Software version
cargo-semver-checks 0.24.2
Operating system
Linux 5.13.0-1031-aws
Command-line
cargo version
Compile time information
Build Configuration
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: