Skip to content

unsafe fn coerces to &fn without an unsafe block #9582

Closed
@lilyball

Description

@lilyball

The following code compiles, surprisingly:

let x: Option<&[u8]> = Some("foo").map(std::cast::transmute);

The coercion of std::cast::transmute to &fn should only be allowed inside an unsafe block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions