Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Properly handle user-defined type #38

Open
scrabsha opened this issue Oct 11, 2021 · 0 comments · May be fixed by #39
Open

Properly handle user-defined type #38

scrabsha opened this issue Oct 11, 2021 · 0 comments · May be fixed by #39

Comments

@scrabsha
Copy link
Contributor

Let's consider the following code:

/// previous:
{
    pub struct S;
    pub fn f(_: S) {}
}
/// next:
{
    pub struct S;
    pub fn f(_: S) {}
}

Nothing has changed, but cargo-breaking detects a modification of function f.

This is caused by the fact that we compile the two versions as a dependency of a third one. As such, these two S declaration are handled as two different types, hence interpreted as a modification.

A simple workaround would be to create a bew method to the TyCtxt (perhaps by adding a trait), allowing it to better compare two types, we would call this method instead of checking for changes using ty_a == ty_b.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant