Introduce -Z remap-cwd-prefix switch by danakj · Pull Request #87320 · rust-lang/rust (original) (raw)

It’s cleaner without the path separator but there’s no less functionality with it, right?

If you wanted to specify a different prefix you can with something like “/foo/.” which would translate “/home/me/src/file.rs” into “/foo/./src/file.rs”. It’s not how you’d normally write it by hand, but it functions just fine, and is universally deterministic. Is it worth it to you to add extra code in here to avoid some dots in command lines?

This implementation also has the pitfall that it will remap /home/meat/src/bar.rs to at/src/bar.rs

Yes, true. However as this path will be rooted at the current working directory, all paths have the same prefix, so this shouldn’t actually come up, right?

Is there something we need to change here with the preexisting flag? Or could that be considered separately? The way this new flag is defined, as an alias for —remap-path-prefix, would allow for the existing flag to evolve and both command line flags could change in tandem.