Skip to content

#[splat] is allowed in closures and does nothing. #158605

Description

@theemathas

This code probably shouldn't compile, but it does.

#![feature(splat)]
#![expect(incomplete_features)]

fn main() {
    (|#[splat] x: i32| {
        println!("{x}");
    })(1);
}

cc @teor2345

Meta

Reproducible on the playground with version 1.98.0-nightly (2026-06-29 096694416a4184070914)

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.F-splat`#![feature(splat)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Fields

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