Auto merge of #17337 - Veykril:assert-info, r=Veykril

Add path info to `AbsPathBuf::assert`'s assert

cc https://github.com/rust-lang/rust-analyzer/issues/17335
This commit is contained in:
bors 2024-06-02 19:30:55 +00:00
commit 1bed783846

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) }
}