1
Fork 0

Rollup merge of #133449 - joboet:io_const_error, r=tgross35

std: expose `const_io_error!` as `const_error!`

ACP: https://github.com/rust-lang/libs-team/issues/205
Tracking issue: https://github.com/rust-lang/rust/issues/133448

Probably best reviewed commit-by-commit, the first one does the API change, the second does the mass-rename.
This commit is contained in:
Matthias Krüger 2024-11-27 08:13:47 +01:00 committed by GitHub
commit dcebc5eddd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
54 changed files with 250 additions and 266 deletions

View file

@ -3581,7 +3581,7 @@ impl Error for StripPrefixError {
pub fn absolute<P: AsRef<Path>>(path: P) -> io::Result<PathBuf> {
let path = path.as_ref();
if path.as_os_str().is_empty() {
Err(io::const_io_error!(io::ErrorKind::InvalidInput, "cannot make an empty path absolute",))
Err(io::const_error!(io::ErrorKind::InvalidInput, "cannot make an empty path absolute",))
} else {
sys::path::absolute(path)
}