Skip to content

const generic ty's with lifetimes cause opaque types to ICE #111911

Closed
@mappum

Description

@mappum

Due to the desugaring of async functions, the adt_const_params feature prevents usage of non-numeric const params as parameters to async functions, or to impl blocks containing async functions.

For example:

#![feature(adt_const_params)]

pub async fn foo<const X: &'static str>() {}

yields the following error:

error: const parameter `X` is part of concrete type but not used in parameter list for the `impl Trait` type alias
 --> src/lib.rs:3:43
  |
3 | pub async fn foo<const X: &'static str>() {}
  |                                           ^^

#95174

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-genericsArea: const generics (parameters and arguments)C-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.F-adt_const_params`#![feature(adt_const_params)]`I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️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.glacierICE tracked in rust-lang/glacier.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions