-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions) A-type-systemArea: Type system C-bugCategory: This is a bug. S-has-bisectionStatus: A bisection has been found for this issue S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issue T-compilerRelevant to the compiler team, which will review and decide on the PR/issue. T-typesRelevant to the types team, which will review and decide on the PR/issue. regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.
@Vollbrecht
Description
Recent rust nigthly version can't compile previously working code, duo to compiler not being able to find associated type inside a "async fn in trait" definition.
Code
Compiling this code:
#![allow(async_fn_in_trait)] pub trait foo {} pub trait bar { type foo: foo; } pub trait baz { async fn boom<X: bar>() -> Result<(), X::foo>; }
I expected to see this happen: In previous version up to nightly-2024年10月28日
this code compiled
Instead, this happened: It stoped compiling with the error
error[E0220]: associated type `foo` not found for `X`
8 | async fn boom<X: bar>() -> Result<(), X::foo>;
| ^^^ there is an associated type `foo` in the trait `bar`
Version it worked on
nightly-2024年10月28日
Version with regression
nightly-2024年10月29日
rustc --version --verbose
:
rustc 1.84.0-nightly (1e4f10ba6 2024年10月29日)
binary: rustc
commit-hash: 1e4f10ba6476e48a42a79b9f846a2d9366525b9e
commit-date: 2024年10月29日
host: x86_64-unknown-linux-gnu
release: 1.84.0-nightly
LLVM version: 19.1.1
No, code just stops compiling.
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions) A-type-systemArea: Type system C-bugCategory: This is a bug. S-has-bisectionStatus: A bisection has been found for this issue S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issue T-compilerRelevant to the compiler team, which will review and decide on the PR/issue. T-typesRelevant to the types team, which will review and decide on the PR/issue. regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.