Skip to content

internal compiler error: const expr(10: &*"sth") of type &'static str has size 8 instead of 16 #33648

Closed
@gui1117

Description

@gui1117

I raise an internal compiler error on play.rust-lang.org stable beta and nightly and on my machine.

I tried this code:

fn main() {
    let _ = &*"sth";
}

I expect no error even if I would write it differently.
instead I got error: internal compiler error: const expr(10: &*"sth") of type &'static str has size 8 instead of 16

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions