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

Properly handle user-defined type #38

@scrabsha

Description

@scrabsha

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions