Auto merge of #80754 - sunfishcode:path-cleanup/rustc-fs-util, r=davidtwco
Auto merge of #80754 - sunfishcode:path-cleanup/rustc-fs-util, r=davidtwco

Optimize away a `fs::metadata` call.

This also eliminates a use of a `Path` convenience function, in support
of #80741, refactoring `std::path` to focus on pure data structures and
algorithms.

aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust