Skip to content

Document that leading blocks are never expressions #13012

Closed
@comex

Description

@comex

Updated description

The fact that leading blocks are never expressions needs to be documented in the language reference both in the grammar section and likely elsewhere to make it known

Original description

Can't use operators on unsafe { }

/tmp/test.rs:2:18: 2:19 error: unexpected token: `+`
/tmp/test.rs:2     unsafe { 1 } + 1;
                                ^

You need parentheses:

(unsafe { 1 }) + 1;

but it doesn't seem like that should be necessary.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions