-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async fn
doesn't compile if it includes at least two generic lifetimes and at least one 'static
lifetime
#99190
Labels
A-async-await
Area: Async & Await
A-lifetimes
Area: Lifetimes / regions
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
note: if the 2 generic lifetimes are named and you relate them, then this will compile, because having one outlive the other will offer a "least choice" and be picked. This looks to me to be #63033 indeed, and will be fixed by #89056. The tests there are virtually the same as the examples in the OP. |
claymcleod
added a commit
to stjude-rust-labs/ngs
that referenced
this issue
Sep 27, 2022
Previously, the tool simply had a hardcoded set of PRIMARY_CHROMOSOMES that were hardcoded to the hg38 primary chromosomes. Now, the tool has a supported set of reference genomes, namely (to start): * GRCh38NoAlt (from the NCBI) * hs37d5 (from the 1000 Genomes Project) These two genomes were selected simply because (a) GRCh38NoAlt is probably the most popular GRCh38 genome and (b) hs37d5 is the genome used for phase 2 and phase 3 of the 1000 Genomes project: a fairly popular publicly available resource and the subject of many QC papers. Introducing a reference genome into the code required multiple QC facets to be updated to use this functionality. For each of these, I chose to simply pass the reference genome to the initialization function for the facet: it's up to the facet to take what it needs from the reference genome and store it for later use (as opposed to adding a lifecycle hook injecting it). Other notable, related changes: * I include now a check at the beginning of the `qc` command to ensure that the sequences in the header of the file match the reference genome the user specified on the commmand line. In the future, I also plan to add checks that the actual FASTA file matches the specified reference genome (if provided) _and_ that the GFF file matches the specified reference genome (if provided). There were some other changes that are introduced in this changeset that, at first, don't appear directly related: * We've now moved away from using `async`/`await` for the `qc` subcommand, as there is an obscure bug that doesn't allow two generic lifetimes and one static lifetime with an `async` function. Thus, I decided to just move away from using `async`/`await` altogether, as I had been considering that regardless (we already moved away from using the lazy evaluation facilities in noodles). See issues rust-lang/rust#63033 and rust-lang/rust#99190 for more details. * In testing this code, I was running into an error where a record fell outside of the valid range of a sequence. This was annoying, so I just decided to fix it as part of this changeset. There is no other deep reason why those changes are included here.
This was fixed in 1.69. |
fmease
added
A-lifetimes
Area: Lifetimes / regions
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
A-async-await
Area: Async & Await
and removed
needs-triage-legacy
labels
Jan 25, 2024
All snippets now compile successfully. Closing as fixed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-async-await
Area: Async & Await
A-lifetimes
Area: Lifetimes / regions
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
I expected to see this happen: It compiles successfully
Instead, this happened: explanation: It fails to compile with this error message:
Details
This bug appears on any async function that includes at least two generic lifetimes and at least one concrete (
'static
) lifetime. Some additional examples:Meta
This bug is present on stable (1.62.0), beta (1.63.0-beta.5 2022-07-10 93ef0cd), and nightly (1.64.0-nightly 2022-07-11 38b7215).
Possibly related to #63033.
Diagnostics
Separate from the compiler bug here, there seems to be a related diagnostics bug, where the compiler describes some lifetime called
'_#23r
without pointing it out in the message.The text was updated successfully, but these errors were encountered: