-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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_in_trait: lifetime of implemented async trait fn wrongly evaluates to static #104678
Labels
C-bug
Category: This is a bug.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Comments
ufoscout
changed the title
async_fn_in_trait: return type of method impl is not checked in default bodies
async_fn_in_trait: lifetime of implemented async trait fn wrongly evaluates to static
Nov 22, 2022
@compiler-errors
I reported this issue because I considered it different than #102681, but you know it better than me, so I am not sure. |
The code is now accepted, can be closed with a test. |
cjgillot
added
the
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
label
Nov 27, 2022
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this issue
Dec 14, 2022
Signed-off-by: Yuki Okushi <[email protected]>
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Dec 14, 2022
…-errors Add regression test for rust-lang#104678 Closes rust-lang#104678 r? `@compiler-errors` Signed-off-by: Yuki Okushi <[email protected]>
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Dec 14, 2022
…-errors Add regression test for rust-lang#104678 Closes rust-lang#104678 r? ``@compiler-errors`` Signed-off-by: Yuki Okushi <[email protected]>
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Dec 15, 2022
…-errors Add regression test for rust-lang#104678 Closes rust-lang#104678 r? ```@compiler-errors``` Signed-off-by: Yuki Okushi <[email protected]>
This was referenced Dec 15, 2022
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Dec 15, 2022
…-errors Add regression test for rust-lang#104678 Closes rust-lang#104678 r? ````@compiler-errors```` Signed-off-by: Yuki Okushi <[email protected]>
bors
added a commit
to rust-lang-ci/rust
that referenced
this issue
Dec 15, 2022
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#104592 (Ensure async trait impls are async (or otherwise return an opaque type)) - rust-lang#105623 (Fix `-Z print-type-sizes` for generators with discriminant field ordered first) - rust-lang#105627 (Auto traits in `dyn Trait + Auto` are suggestable) - rust-lang#105633 (Make `report_projection_error` more `Term` agnostic) - rust-lang#105683 (Various cleanups to dest prop) - rust-lang#105692 (Add regression test for rust-lang#104678) - rust-lang#105707 (rustdoc: remove unnecessary CSS `kbd { cursor: default }`) - rust-lang#105715 (Do not mention long types in E0599 label) - rust-lang#105722 (more clippy::complexity fixes) - rust-lang#105724 (rustdoc: remove no-op CSS `.scrape-example .src-line-numbers { margin: 0 }`) - rust-lang#105730 (rustdoc: remove no-op CSS `.item-info:before { color }`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: This is a bug.
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
In the following code, the trait compiles but not the struct implementing it:
I expected to see this happen:
The code should compile and the expected lifetime of
Self::Conn
should be'a
.Instead, this happened:
The compilation fails. The error says that the expected lifetime of
Self::Conn
in the struct is'static
even if it is declared as'a
in the trait:Please note that the code compiles if you remove the
async
modifier from both the trait and the struct.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: