Skip to content

Return expressions without a semicolon compile #26425

Closed
@pmarcelll

Description

@pmarcelll

My "investigation": #17257 (comment)

Test case:

fn foo() -> i32 {
    return 1 // no semicolon
}

fn main() {
    println!("{}", foo());
}

This compiles, but the reference doesn't mention, that is should.

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