You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Weird interaction between specialization and RPITITs #108309
#108203 didn't fully fix this. the bug still persists when using polymorphic indirection via specialization:
#![feature(async_fn_in_trait)]#![feature(min_specialization)]structMyStruct;traitMyTrait<T>{asyncfnfoo(_:T);}impl<T>MyTrait<T>forMyStruct{defaultasyncfnfoo(_:T){println!("default");}}implMyTrait<i32>forMyStruct{asyncfnfoo(_:i32){println!("specialized");}}#[tokio::main]asyncfnmain(){MyStruct::foo(42).await;indirection(42).await;}asyncfnindirection<T>(x:T){//explicit type coercion is currently necessary because of https://github.com/rust-lang/rust/issues/67918
<MyStructasMyTrait<T>>::foo(x).await;}
(note that <MyStruct as MyTrait<i32>>::foo(42).await works just fine, so #67918 probably isn't at fault)
Activity
compiler-errors commentedon Feb 21, 2023
I'll look into this when I actually wake up in a few hours lol
LastExceed commentedon Feb 22, 2023
why does this issue have the
F-return_position_impl_trait_in_traitlabel ?compiler-errors commentedon Feb 22, 2023
Because async fn in trait is just return position impl trait in trait, and the specialization problems are equally as broken with the latter?
Auto merge of rust-lang#115822 - compiler-errors:stabilize-rpitit, r=…