Not compiling after adding the GAT Self: 'a
bounds (original) (raw)
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>,
+pub fn primal<'provider, IM, MP, PR>(
- tableau: &mut Tableau<IM, NonArtificial<'provider, MP>>,
) -> OptimizationResultIM::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.