Skip to content

.unsafe code snippet on const {} expr results in unsafe const {} which is invalid Rust #20998

@Paladynee

Description

@Paladynee

where $0 is the cursor,

const MY_CONST: usize = const { 1 }.unsafe$0;

after completion of the unsafe snippet becomes

const APPLES: usize = unsafe const { 1 }$0;

which is invalid rust.

i expected to see

const APPLES: usize = unsafe { const { 1 }$0 };

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions