obi1kenobi / cargo-semver-checks

Scan your Rust crate for semver violations.
Apache License 2.0
1.21k stars 76 forks source link

Error type change doesn't cause a semver fail #1005

Open jalil-salame opened 3 days ago

jalil-salame commented 3 days ago

Is this about an existing lint, or proposing a new one?

new

Known issues that might be causing this

Steps to reproduce the bug with the above code

pub fn foo() -> Result<(), u32> { ... }

To:

pub fn foo() -> Result<(), String> { ... }

Actual Behaviour

No semver issues are found

Expected Behaviour

A semver breakeage should be reported

Generated System Information

System information:

Software version

cargo-semver-checks 0.36.0

Operating system

Linux 6.6.63

Command-line

/home/jalil/.local/share/cargo/bin/cargo-semver-checks semver-checks --bugreport

cargo version

> cargo -V
cargo 1.85.0-nightly (4c39aaff6 2024-11-25)

Compile time information

Cargo build configuration:

Build Configuration

No configuration, default cargo new --lib project basically.

Additional Context

I found this while working on https://github.com/scontain/sgx-quote. I changed the parser from nom to winnow, this is mostly an implementation detail, but the nom error was directly returned, this error no longer implemented Display or Debug (I don't remember which) so it couldn't be printed anymore.

obi1kenobi commented 2 days ago

Yeah, we can't catch any type changes like this at the moment. We're making progress toward it, albeit slowly.