Skip to content

Path::relative_from() doesn't account for case insensitivity on Windows #23264

Closed
@nukep

Description

@nukep

This has resulted in an issue in Cargo where rustdocs cannot be generated on Windows machines:
rust-lang/cargo#1393

use std::path::Path;
fn main() {
    let p = Path::new(r"C:\src\rust\cargo-test\test\Cargo.toml");
    println!("{:?}", p.relative_from(r"C:\src\rust\cargo-test\test"));
    println!("{:?}", p.relative_from(r"c:\src\rust\cargo-test\test"));
}
Some("Cargo.toml")
None

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