Skip to content

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

Closed

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

Activity

  1. alexcrichton commented on Mar 10, 2015

    @alexcrichton
    Member
  2. added a commit that references this issue on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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