Skip to content

inline_call and inline_into_callers should check if it inlines into the left side of a binary expression #10359

@Veykril

Description

@Veykril
fn foo$0() -> u32 {
    let x = 0;
    x
}
fn bar() -> u32 {
    foo() + foo()
}

gives us

fn bar() -> u32 {
    {
        let x = 0;
        x
    } + {
        let x = 0;
        x
    }
}

which is invalid, as the first block will be parsed as a statement and as such we need to wrap the first block in () parentheses to force an expression parse.

cc #10352 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-assistsC-bugCategory: bugS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions