Skip to content

impl traits in consts through const fns are allowed but shouldn't #87277

Closed
@spastorino

Description

@spastorino

The following code compiles after #87141 but shouldn't

#![feature(const_impl_trait)]
#![feature(min_type_alias_impl_trait)]

type Foo = impl Send;

struct A;

const VALUE: Foo = value();

 const fn value() -> Foo {
     A
 }

fn main() {
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    F-type_alias_impl_trait`#[feature(type_alias_impl_trait)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions