-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Compiler panicks when impl for async trait has a mismatch #104183
Labels
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
7 tasks
This happens for all type mismatches in the arguments (but not the arity!) #![feature(async_fn_in_trait)]
trait A {
async fn uwu(x: ());
}
impl A for () {
async fn uwu(x: u8) {}
} With the following backtrace:
|
When not using a normal rust/compiler/rustc_hir_analysis/src/check/compare_method.rs Lines 71 to 74 in 8d36948
But something gets messed up with the return position impl trait in trait desugaring that doesn't make this work (the arity check above does work). @rustbot claim |
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Nov 10, 2022
…iler-errors Emit error in `collecting_trait_impl_trait_tys` on mismatched signatures Previously, a `delay_span_bug` was isssued, failing normalization. This create a `TyKind::Error` in the signature, which caused `compare_predicate_entailment` to swallow its signature mismatch error, causing ICEs because no error was emitted. fixes rust-lang#104183 r? `@compiler-errors`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Nov 10, 2022
…iler-errors Emit error in `collecting_trait_impl_trait_tys` on mismatched signatures Previously, a `delay_span_bug` was isssued, failing normalization. This create a `TyKind::Error` in the signature, which caused `compare_predicate_entailment` to swallow its signature mismatch error, causing ICEs because no error was emitted. fixes rust-lang#104183 r? ``@compiler-errors``
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.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Essentially, if my trait has
async fn do(s: &String)
and my impl hasasync fn do(s: String)
the compiler panics.Note that the code is invalid and compilation should fail.
Meta
rustc --version --verbose
:Error output
Note that I'm using
#![feature(async_fn_in_trait)]
which is experimental.The text was updated successfully, but these errors were encountered: