Skip to content

const fn arguments not properly checked for destructors. #47351

Closed
@eddyb

Description

@eddyb

These currently compile, even if they can be used from compile-time code to trigger a drop:

#![feature(const_fn)]
pub const fn drop<T>(_: T) {}
pub const fn drop2<T>(x: T) { (x, ()).1 }

cc @alexreg

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions