Skip to content

demonstrate incorrect usage of RelPath::new_unchecked - #23291

Closed
BenjaminBrienen wants to merge 1 commit into
rust-lang:masterfrom
BenjaminBrienen:relpath-oops
Closed

demonstrate incorrect usage of RelPath::new_unchecked#23291
BenjaminBrienen wants to merge 1 commit into
rust-lang:masterfrom
BenjaminBrienen:relpath-oops

Conversation

@BenjaminBrienen

Copy link
Copy Markdown
Contributor

No description provided.

@ChayimFriedman2

Copy link
Copy Markdown
Contributor

I do not object to this specifically, but I don't want to start documenting internal APIs. Keep that in mind.

@Wilfred

Wilfred commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

The fact that unit tests are failing with this new assertion suggests that perhaps it's worthwhile? It looks like it's trivial stuff where we have e.g. //- /submod.rs in tests but being extra defensive around any foo_unchecked seems nice to me.

@Veykril

Veykril commented Sep 11, 2026

Copy link
Copy Markdown
Member

odd this does not fail on windows 🤔

It looks like it's trivial stuff where we have e.g. //- /submod.rs in tests but being extra defensive around any foo_unchecked seems nice to me.

its not those, otherwise almost every test ought to fail. It seems to be a bug in our strip_prefix implementation?

@Veykril

Veykril commented Sep 11, 2026

Copy link
Copy Markdown
Member

Ah I think this happens if you strip_prefix with an empty path arg?

Yea, and the fact that our VirtualPath implements pop incorrectly. It turns a rooted path into an empty path, thats also a bug

@BenjaminBrienen

Copy link
Copy Markdown
Contributor Author

Just close this when you feel like you don't need the demo anymore

@Veykril Veykril closed this Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants