cargo-semver-checks icon indicating copy to clipboard operation
cargo-semver-checks copied to clipboard

Unsatisfactory UX when items are no longer importable by the old path

Open obi1kenobi opened this issue 2 years ago • 0 comments

Consider the following code, in an imaginary lib crate.

pub mod foo {
  pub struct Bar;
}

pub use foo::Bar;

Bar is now importable both directly as lib::Bar and as lib::foo::Bar. If one of these import paths becomes unavailable in a future release, that's a breaking change.

I believe (but haven't verified) that this should get caught by the current checks, but the error message will be misleading: it will say that the item was removed or renamed, and will not provide the import path that stopped being available.

There is currently a test case that non-breaking moves do not cause false-positive errors. We'll also need a test that breaking moves and import changes cause true-positive errors with a good error message.

obi1kenobi avatar Aug 07 '22 03:08 obi1kenobi