Skip to content

Not compiling after adding the GAT Self: 'a bounds #90808

Closed

Description

After #89970 was merged, project relp no longer compiled as expected: I needed to add a few Self: 'a bounds.

After I did just that, I was left with the following error:

error[E0477]: the type `RemoveRows<'_, MP>` does not fulfill the required lifetime
  --> src/algorithm/two_phase/mod.rs:57:21
   |
57 |                     phase_two::primal::<_, _, SteepestDescentAlongObjective<_>>(&mut non_artificial)
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0477`.

After I made the following change:

-pub fn primal<IM, MP, PR>(
-    tableau: &mut Tableau<IM, NonArtificial<MP>>,
+pub fn primal<'provider, IM, MP, PR>(
+    tableau: &mut Tableau<IM, NonArtificial<'provider, MP>>,
 ) -> OptimizationResult<IM::F>
 where
-    IM: InverseMaintener<F: im_ops::FieldHR + im_ops::Column<<MP::Column as Column>::F>>,
-    for<'r> IM::F: im_ops::Cost<MP::Cost<'r>>,
+    IM: InverseMaintener<F:
+        im_ops::FieldHR +
+        im_ops::Column<<MP::Column as Column>::F> +
+        im_ops::Cost<MP::Cost<'provider>> +
+    >,

cargo build succeeded.

The core of this bug report is the question why the extra change above could have been necessary, as #89970 should not have influenced that.

Summarized from a private conversation with @jackh726.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleF-generic_associated_types`#![feature(generic_associated_types)]` a.k.a. GATsGATs-triagedIssues using the `generic_associated_types` feature that have been triagedICEBreaker-Cleanup-CrewHelping to "clean up" bugs with minimal examples and bisectionsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions