Add path info to AbsPathBuf::assert's assert

This commit is contained in:
Lukas Wirth 2024-06-02 21:28:25 +02:00
parent 6b9baed80e
commit cdb4f9631c

View file

@ -197,7 +197,7 @@ impl AbsPath {
///
/// Panics if `path` is not absolute.
pub fn assert(path: &Utf8Path) -> &AbsPath {
assert!(path.is_absolute());
assert!(path.is_absolute(), "{path} is not absolute");
unsafe { &*(path as *const Utf8Path as *const AbsPath) }
}