Forbid canonicalization of paths and normalize all rust-project.json paths

This commit is contained in:
Lukas Wirth 2023-05-04 14:20:52 +02:00
parent 60f4b3e26e
commit 939ebb4454
4 changed files with 17 additions and 25 deletions

View file

@ -166,9 +166,8 @@ impl AbsPath {
AbsPathBuf::try_from(self.0.to_path_buf()).unwrap()
}
/// Equivalent of [`Path::canonicalize`] for `AbsPath`.
pub fn canonicalize(&self) -> Result<AbsPathBuf, std::io::Error> {
Ok(self.as_ref().canonicalize()?.try_into().unwrap())
pub fn canonicalize(&self) -> ! {
panic!("We explicitly do not provide canonicalization API, as that is almost always a wrong solution, see #14430")
}
/// Equivalent of [`Path::strip_prefix`] for `AbsPath`.