Skip to content

Syntax error when using 'type const' #22038

@reddevilmidzy

Description

@reddevilmidzy

rust-analyzer version: : 0.3.2862-standalone (7b6e124 2026-04-12)

rustc version: rustc 1.97.0-nightly (17584a181 2026-04-13)

editor or extension: Zed (0.231.2 cc335b70f85a17974a4c61f852dbebff8c4b1db7)
(I checked it in VSCode as well, and the same error occurred.)

code snippet to reproduce:

#![feature(min_generic_const_args)]
#![allow(incomplete_features, unused)]

type const FOO: i32 = 2i32;

fn main() {}

The code is compilable, but 8 syntax errors occur.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions