Skip to content

Commit c3e91ae

Browse files
committed
Auto merge of rust-lang#109538 - matthiaskrgr:rollup-ct58npj, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - rust-lang#106964 (Clarify `Error::last_os_error` can be weird) - rust-lang#107718 (Add `-Z time-passes-format` to allow specifying a JSON output for `-Z time-passes`) - rust-lang#107880 (Lint ambiguous glob re-exports) - rust-lang#108549 (Remove issue number for `link_cfg`) - rust-lang#108588 (Fix the ffi_unwind_calls lint documentation) - rust-lang#109231 (Add `try_canonicalize` to `rustc_fs_util` and use it over `fs::canonicalize`) - rust-lang#109472 (Add parentheses properly for method calls) - rust-lang#109487 (Move useless_anynous_reexport lint into unused_imports) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 9832e13 + c80ac4a commit c3e91ae

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

std/src/io/error.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ pub enum ErrorKind {
370370

371371
// "Unusual" error kinds which do not correspond simply to (sets
372372
// of) OS error codes, should be added just above this comment.
373-
// `Other` and `Uncategorised` should remain at the end:
373+
// `Other` and `Uncategorized` should remain at the end:
374374
//
375375
/// A custom error that does not fall under any other I/O error kind.
376376
///
@@ -882,6 +882,13 @@ impl Error {
882882

883883
/// Returns the corresponding [`ErrorKind`] for this error.
884884
///
885+
/// This may be a value set by Rust code constructing custom `io::Error`s,
886+
/// or if this `io::Error` was sourced from the operating system,
887+
/// it will be a value inferred from the system's error encoding.
888+
/// See [`last_os_error`] for more details.
889+
///
890+
/// [`last_os_error`]: Error::last_os_error
891+
///
885892
/// # Examples
886893
///
887894
/// ```
@@ -892,7 +899,8 @@ impl Error {
892899
/// }
893900
///
894901
/// fn main() {
895-
/// // Will print "Uncategorized".
902+
/// // As no error has (visibly) occurred, this may print anything!
903+
/// // It likely prints a placeholder for unidentified (non-)errors.
896904
/// print_error(Error::last_os_error());
897905
/// // Will print "AddrInUse".
898906
/// print_error(Error::new(ErrorKind::AddrInUse, "oh no!"));

0 commit comments

Comments
 (0)