Closed
Description
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.
#![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
Metadata
Metadata
Assignees
Labels
Area: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.Area: Trait systemCall for participation: An issue has been fixed and does not reproduce, but no test has been added.`#[feature(type_alias_impl_trait)]`Relevant to the compiler team, which will review and decide on the PR/issue.