-
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
Additional SemVer compatibility items. #8736
Comments
Another thing that might be worth mentioning is the standback crate in the MSRV bit. It does exactly what is recommended — copies code from stdlib — but also re-exports when possible based on the compiler version in use. I created it specifically for that reason, and have yet to run into any issues. Imports are essentially identical, as a bonus. |
#75180 is a blanket trait impl (and thus a major breaking change) as per RFC 2451: it's an impl for |
Another thing I believe is missing is updating dependencies whose types are part of your public API. |
We talked about this in the cargo team meeting and we are leaning towards automating this, see #374, like with cargo-crate-api |
I don't know if this falls under here (or if there's a duplicate issue or any prior discussion), but due to the way that the cargo resolver currently works removing a feature flag even from a non-public dependency appears to constitute a breaking change. Consider crate [package]
name = "a"
version = "1.0.0"
[dependencies]
uuid = { version = "1.0.0", features = ["serde"] } [package]
name = "a"
[dependencies]
a = "1.0.0"
uuid = "1.0.0" Crate If crate [package]
name = "a"
version = "1.0.1"
[dependencies]
uuid = "1.0.0" Once crate If we bring Example of breakage in the wild: tokio-rs/tokio#4663 |
Add semver rule for lints This adds a new rule to the semver compatibility list explaining the expectations around diagnostic lints. cc #8736
FWIW I don't think this should lead to a docs change; it should lead to a rustc change instead, similar to rust-lang/rust#99020. |
This is a dump of some elements that I considered adding to the SemVer compatibility chapter, but didn't have time or knowledge to finish.
--no-default-features
explicitly.SomeType<'static>
tofn some<'a>(i: &'a str) -> SomeType<'a>
.impl trait
vs generic parameters. Converting betweenfoo(x: impl Trait)
andfoo<T: Trait>(x: T)
.impl trait
and generics conversion here: Remove outdated info about impl Trait in parameters and generics in the same function reference#1495-> impl trait
return value converted to a concrete type-> Foo
Drop
,Copy
,Send
,Sync
, etc. I think removing any public trait is a breaking change? I believe addingDrop
is a major change, not sure what the rules are there.const
can be a breaking change (https://internals.rust-lang.org/t/should-we-be-more-strict-with-const-and-semver/14302).#[derive(Serialize)]
, private fields will leak in the serialized output.struct B<T> { x: Box<T> }
with a user havingstruct A { b: B<A> }
. ChangeBox<T>
to justT
causesA
to be infinitely sized.[lib]
target, that would break anything depending on that package. This will be more important with artifact-dependencies.repr(packed)
type. See Handling of packed fields causes semver hazard: layout details from other crates affect type-checking rust#115305 (comment) and closure field capturing: don't depend on alignment of packed fields rust#115315.use<>
) can be a breaking change. discussionAs an alternative to documentation, we could make these lints in a tool like cargo-crate-api
The text was updated successfully, but these errors were encountered: