Skip to content

Internal compiler error when compiling simple code using OsStr and Path #55676

Closed
@lucatrv

Description

@lucatrv

Compiling the following simple code triggers an internal compiler error. You can reproduce this issue also on the Rust playground website, with all "stable", "beta" and "nightly" channels.

use std::{ffi::OsStr, path::Path};

fn main() {
    match Path::new("test.log").extension() {
        Some(OsStr::new("log")) => println!("log"),
        _ => println!("not log"),
    }
}

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