Replacing -> impl Sized with -> F in fn spawn makes it compile, so it feels to me the RPIT version should be accepted too.
This is minimized from the embassy-executor task macro.
playground
#![feature(type_alias_impl_trait)]
fn spawn<T, F>(future: F) -> impl Sized
where
F: FnOnce() -> T,
{
future
}
fn spawn_task(sender: &'static ()) -> impl Sized {
type Tait = impl Sized + 'static;
spawn::<Tait, _>(move || sender)
}
error: concrete type differs from previous defining opaque type use
--> src/lib.rs:12:30
|
12 | spawn::<Tait, _>(move || sender)
| ^^^^^^ expected `Tait`, got `&'static ()`
|
note: previous use here
--> src/lib.rs:12:5
|
12 | spawn::<Tait, _>(move || sender)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
bisected:
searched nightlies: from nightly-2024-03-14 to nightly-2024-03-20
regressed nightly: nightly-2024-03-16
searched commit range: f4b771b...c67326b
regressed commit: 1ca424c
bisected with cargo-bisect-rustc v0.6.8
Host triple: x86_64-unknown-linux-gnu
Reproduce with:
cargo bisect-rustc --preserve
@rustbot label F-type-alias-impl-trait
Replacing
-> impl Sizedwith-> Finfn spawnmakes it compile, so it feels to me the RPIT version should be accepted too.This is minimized from the
embassy-executortask macro.playground
bisected:
searched nightlies: from nightly-2024-03-14 to nightly-2024-03-20
regressed nightly: nightly-2024-03-16
searched commit range: f4b771b...c67326b
regressed commit: 1ca424c
bisected with cargo-bisect-rustc v0.6.8
Host triple: x86_64-unknown-linux-gnu
Reproduce with:
@rustbot label F-type-alias-impl-trait