Skip to content

regression: parameter type may not live long enough #97607

Closed
@Mark-Simulacrum

Description

@Mark-Simulacrum

See https://crater-reports.s3.amazonaws.com/beta-1.62-1/beta-2022-05-20/gh/FSMaxB.rust-genealogy/log.txt:

[INFO] [stdout] error[E0311]: the parameter type `Extracted` may not live long enough
[INFO] [stdout]   --> genealogy-java-apis/src/comparator.rs:24:13
[INFO] [stdout]    |
[INFO] [stdout] 24 |             compare: Box::new(move |left, right| match (self.compare)(left, right) {
[INFO] [stdout]    |                      ^^^^^^^^ ...so that the type `Extracted` will meet its required lifetime bounds...
[INFO] [stdout]    |
[INFO] [stdout] note: ...that is required by this bound
[INFO] [stdout]   --> genealogy-java-apis/src/comparator.rs:21:28
[INFO] [stdout]    |
[INFO] [stdout] 21 |         for<'a> Extracted: Ord + 'a,
[INFO] [stdout]    |                                  ^^
[INFO] [stdout] help: consider adding an explicit lifetime bound...
[INFO] [stdout]    |
[INFO] [stdout] 21 |         for<'a> Extracted: Ord + 'a + 'a,
[INFO] [stdout]    |                                     ++++
[INFO] [stdout] 
[INFO] [stdout] 
[INFO] [stdout] error: aborting due to previous error

This is a 1.62 regression, it seems, based on Crater. At the very least, it's a diagnostics issue that we're suggesting adding an already existing lifetime bound.

Metadata

Metadata

Assignees

Labels

E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions