Skip to content

Commit a898b31

Browse files
committed
Rename to InvalidFilename
1 parent 861f3c7 commit a898b31

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

library/std/src/io/error.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,11 @@ pub enum ErrorKind {
296296
/// The filesystem does not support making so many hardlinks to the same file.
297297
#[unstable(feature = "io_error_more", issue = "86442")]
298298
TooManyLinks,
299-
/// Filename too long.
299+
/// A filename was invalid.
300300
///
301-
/// The limit might be from the underlying filesystem or API, or an administratively imposed
302-
/// resource limit.
301+
/// This error can also cause if it exceeded the filename length limit.
303302
#[unstable(feature = "io_error_more", issue = "86442")]
304-
FilenameInvalid,
303+
InvalidFilename,
305304
/// Program argument list too long.
306305
///
307306
/// When trying to run an external program, a system or process limit on the size of the
@@ -382,12 +381,12 @@ impl ErrorKind {
382381
DirectoryNotEmpty => "directory not empty",
383382
ExecutableFileBusy => "executable file busy",
384383
FileTooLarge => "file too large",
385-
FilenameInvalid => "filename invalid",
386384
FilesystemLoop => "filesystem loop or indirection limit (e.g. symlink loop)",
387385
FilesystemQuotaExceeded => "filesystem quota exceeded",
388386
HostUnreachable => "host unreachable",
389387
Interrupted => "operation interrupted",
390388
InvalidData => "invalid data",
389+
InvalidFilename => "invalid filename",
391390
InvalidInput => "invalid input parameter",
392391
IsADirectory => "is a directory",
393392
NetworkDown => "network down",

library/std/src/io/error/repr_bitpacked.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ fn kind_from_prim(ek: u32) -> Option<ErrorKind> {
315315
Deadlock,
316316
CrossesDevices,
317317
TooManyLinks,
318-
FilenameTooLong,
318+
InvalidFilename,
319319
ArgumentListTooLong,
320320
Interrupted,
321321
Other,

library/std/src/sys/unix/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
159159
libc::ENOSPC => StorageFull,
160160
libc::ENOSYS => Unsupported,
161161
libc::EMLINK => TooManyLinks,
162-
libc::ENAMETOOLONG => FilenameInvalid,
162+
libc::ENAMETOOLONG => InvalidFilename,
163163
libc::ENETDOWN => NetworkDown,
164164
libc::ENETUNREACH => NetworkUnreachable,
165165
libc::ENOTCONN => NotConnected,

library/std/src/sys/windows/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
7171
c::ERROR_FILE_NOT_FOUND => return NotFound,
7272
c::ERROR_PATH_NOT_FOUND => return NotFound,
7373
c::ERROR_NO_DATA => return BrokenPipe,
74-
c::ERROR_INVALID_NAME => return FilenameInvalid,
74+
c::ERROR_INVALID_NAME => return InvalidFilename,
7575
c::ERROR_INVALID_PARAMETER => return InvalidInput,
7676
c::ERROR_NOT_ENOUGH_MEMORY | c::ERROR_OUTOFMEMORY => return OutOfMemory,
7777
c::ERROR_SEM_TIMEOUT
@@ -105,7 +105,7 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind {
105105
c::ERROR_POSSIBLE_DEADLOCK => return Deadlock,
106106
c::ERROR_NOT_SAME_DEVICE => return CrossesDevices,
107107
c::ERROR_TOO_MANY_LINKS => return TooManyLinks,
108-
c::ERROR_FILENAME_EXCED_RANGE => return FilenameInvalid,
108+
c::ERROR_FILENAME_EXCED_RANGE => return InvalidFilename,
109109
_ => {}
110110
}
111111

0 commit comments

Comments
 (0)