-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
Generating rustdoc with --all-features
exposes APIs in an unstable feature
#321
Comments
Sorry about the false-positive error, and thanks for reporting it. I'm already in the middle of a rework of our import-handling system to make renaming re-exports and glob re-exports work, so I'll make sure this case is correctly handled as part of that as well: obi1kenobi/trustfall-rustdoc-adapter#34 We'll also add your crate to our list of crates that we use for integration tests, so that we never have this issue again. |
No worries and thanks for the fast response :) |
I just had a chance to look into this, and unfortunately the
This means that for #315 is describes the feature for only enabling a user-specified set of features while checking. If you agree that's the underlying cause here, I'd like to consolidate this issue into that one. Is that okay? In the meantime, a workaround is available: |
pub struct
in a pub(crate)
module as public API--all-features
exposes APIs in an unstable feature
Ah I see, that makes a lot of sense. These features are "internal" features that are only enabled for testing purposes. I saw that other crates are prefixing such features with underscores. Maybe for the time being that could also be used as a hint to Otherwise yes, this would be a duplicate of #315 and/or the missing feature in cargo. |
If we weren't looking to merge cargo-semver-checks into cargo soonish, I'd feel absolutely fine with adding the "ignore features starting with But with the merge coming up, I don't feel comfortable making that kind of decision unilaterally without consulting the cargo maintainers first. @epage what do you think? |
When we last talked about However, that feature isn't implemented yet and there is a gap between semver-checks being merged, so it might be ok to implement support for it now and then we rip it out pre-merge (adding that removal to the merge task list). I've gone ahead and added the two related cargo issues to the "nice to have" list in #61. @obi1kenobi do you know of any other relevant cargo improvements? |
It would be great if cargo-semver-checks could somehow get cargo to generate rustdoc for a yanked version. Right now, generating rustdoc for a crate version requires making a lockfile, which isn't allowed for yanked versions (relevant: #275, rust-lang/cargo#4225). This is a bit unfortunate because e.g. it's hampering @tonowak's research into how often crates get yanked due to semver violations and for which reasons — having this real-world data would help us prioritize which lints to build next. |
Related: #181. Perhaps worth closing this issue in favor of that one, I attempted to summarize the discussion here: #181 (comment) |
I've hit this on the serenity crate. In the latest version, a feature was removed and replaced with a |
Thanks for bringing this up. Out of curiosity, why not remove the feature altogether? It's already non-additive, which cargo doesn't like, and both removing it and leaving |
Valid point. I added the compile_error to point migrating users directly to the new API, so they don't have to search around in the changelog. But I guess I could also add a feature-gated deprecation warning to a part of the API that the user definitely calls, so the migration message is seen EDIT: Hm... Is this really better? kangalio/serenity@7a3f1c1 |
I think that would probably make both users and tooling happier! |
This will be part of the next release, sometime in the next week or so — just need to finish the docs for the new feature flags. Sorry for the wait! |
Steps to reproduce the bug with the above code
Running on https://github.com/sdroege/ebur128 gives the following error
Actual Behaviour
Expected Behaviour
This should pass because the type is not exported from the crate
Generated System Information
Software version
cargo-semver-checks 0.16.1
Operating system
Linux 6.0.18-300.fc37.x86_64
Command-line
~/.cargo/bin/cargo-semver-checks semver-checks --bugreport
cargo version
Compile time information
Build Configuration
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: