Skip to content

#[inline] is no longer accepted on closures #49632

Closed
@Amanieu

Description

@Amanieu

Since #49291 #[inline] is no longer accepted on closures, despite the fact that this attribute does have an effect on code generation.

The generated LLVM IR (in debug builds) for this example is different if you remove #[inline(always)]:

#![feature(stmt_expr_attributes)] 
#![crate_type="rlib"]

pub fn main() {
    let x = #[inline(always)] || {};
    x();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions