这是indexloc提供的服务,不要输入任何密码
Skip to content

#[inline] affects whether consteval happens #144460

@theemathas

Description

@theemathas

I tried this code:

fn foo<T>() {
    const { panic!() }
}

// uncommenting this line makes it compile
// #[inline]
pub fn wut() {
    foo::<i32>();
}

I expected #[inline] to not affect whether the code compiles or not. However, the code compiles with #[inline], and fails to compile without #[inline]. I'm not sure if this is a bug or not.

Discovered in #144363

@rustbot labels +A-const-eval

Meta

Reproducible on the playground with stable rust 1.88.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-discussionCategory: Discussion or questions that doesn't represent real issues.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions