Skip to content

E0623: Incorrect or ambiguous message #59842

@vandenheuvel

Description

@vandenheuvel

I encountered the following error:

error[E0623]: lifetime mismatch
  --> src/algorithm/simplex/branch_and_bound/logic.rs:47:73
   |
34 |       tableau: Tableau<'data_provider, NonArtificial, AdaptedMatrixProvider<'original_data, MP>, PR>,
   |                ------------------------------------------------------------------------------------- these two types are declared with different lifetimes...
...
47 |           let lower_provider: AdaptedMatrixProvider<'original_data, MP> = tableau.provider().clone_with_extra_bound(branch_variable,
   |  _________________________________________________________________________^
48 | |                                                                                                                   new_lower_bound,
49 | |                                                                                                                   BoundType::Lower);
   | |___________________________________________________________________________________________________________________________________^ ...but data from `tableau` flows into `tableau` here

Looking at line 47, this seems to be incorrect: data doesn't flow into tableau. Merely, another reference is created to a value which is also referenced by the existing tableau.

Moreover, it doesn't look like there are two types being pointed at by the compiler. The two types being referenced might be the outer and inner type though, but this is unclear and if this is the case, I think it requires change.

I tried to reproduce this issue on the playground, but was not successful. The full code can be found here. A slightly different state of the codebase, with a similar error, can be found here.

@estebank Looking at related issues, I thought that this might be relevant to you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-lifetimesArea: Lifetimes / regionsC-enhancementCategory: An issue proposing an enhancement or a PR with one.D-confusingDiagnostics: Confusing error or lint that should be reworked.D-newcomer-roadblockDiagnostics: Confusing error or lint; hard to understand for new users.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions