Skip to content

ICE for adding block to str #10401

Closed
@klutzy

Description

@klutzy
fn main() {
    let a = "a";
    a += { "b" }; // oops
}

This causes ICE as well as normal error:

a.rs:3:4: 3:16 error: binary operation + cannot be applied to type `&'static str`
a.rs:3     a += { "b" }; // oops
           ^~~~~~~~~~~~
error: internal compiler error: no type for node 16: block { "b" } (id=16) in fcx 0x7fdaac1165b0

As a consequence, a += format!(...); triggers same error. Same for a += {};.

cc #9942 and #10091 since they just share same ICE message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions