Repository navigation
Closed
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)C-bugCategory: This is a bug.Category: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall 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. GATs`#![feature(generic_associated_types)]` a.k.a. GATsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Metadata
Metadata
Assignees
Labels
A-GATsArea: Generic associated types (GATs)Area: Generic associated types (GATs)C-bugCategory: This is a bug.Category: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall 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. GATs`#![feature(generic_associated_types)]` a.k.a. GATsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Activity
jackh726 commentedon Nov 11, 2021
@rustbot ping cleanup
It would be really nice to get a minimal test for this. The intent for this lint was that in theory, existing code shouldn't break. So, either we need to update the outlives lint code to not error here or decide that this pattern isn't correct and we should figure out the correct fix and make sure it's documented.
rustbot commentedon Nov 11, 2021
Hey Cleanup Crew ICE-breakers! This bug has been identified as a good
"Cleanup ICE-breaking candidate". In case it's useful, here are some
instructions for tackling these sorts of bugs. Maybe take a look?
Thanks! <3
cc @AminArria @ayazhafiz @camelid @chrissimpkins @contrun @elshize @h-michael @HallerPatrick @hdhoang @hellow554 @henryboisdequin @imtsuki @JamesPatrickGill @kanru @KarlK90 @matheus-consoli @mental32 @nmccarty @Noah-Kennedy @pard68 @PeytonT @pierreN @Redblueflame @RobbieClarken @RobertoSnap @robjtede @SarthakSingh31 @shekohex @sinato @smmalis37 @steffahn @Stupremee @tamuhey @turboladen @woshilapin @yerke
jackh726 commentedon Nov 11, 2021
For clarification, the most ideal MCVE would be of the code at this commit.
vandenheuvel commentedon Nov 12, 2021
This issue might be related.
vandenheuvel commentedon Nov 12, 2021
I am almost certain that this bug has to do with this line:
The problem does not occur when the following change is applied before the
where Self: 'abound is added:On this branch, I applied the commits of this branch (where the original issue occured) in a different order. After starting with the commit above, I remove a few ugly HRTB's in an intermediate commit. After that, adding the
Self: 'aclauses works as expected.jackh726 commentedon Dec 13, 2021
@vandenheuvel were you able to fix your project and also include the required bounds?
jackh726 commentedon Feb 7, 2022
GATs issue triage: not blocking. It's really not clear what an actionable path forward here is. It would be nice to know what exactly led to these problems, but I can't see anything that changes the outlives lint rules. We also have the flexibility in the future to make the outlives lint more lenient.
jackh726 commentedon Sep 8, 2022
I'm going to go ahead and close this. As said in previous comment, not sure what is actionable here.