Closed
Description
Location
The unclear example is located here.
Summary
I originally interpreted this example to mean that constructing an error from a raw error code always resulted in ErrorKind::Uncategorized
. I think it might help to be explicit that no error has occurred yet and that is the reason that this shows up as uncategorized.
Activity
amab8901 commentedon Jan 16, 2023
can you give us a running example to help us reproduce the issue?
jbaublitz commentedon Jan 16, 2023
I apologize if I missed this in the doc report template, but I've never reported a doc issue before. Can you clarify what you mean by a running example? Do you mean the command to build the docs highlighted in the link?
workingjubilee commentedon Jan 17, 2023
The variant is
#[doc(hidden)]
, I assume quite deliberately. There is an argument that we should not be mentioning it in the documentation at all. It certainly is confusing, I agree.ChrisDenton commentedon Jan 17, 2023
To summarise the above points, the relevant part of the example is the following:
This is weird for two reasons:
Uncategorized
is hidden and unstable.last_os_error()
without first calling an OS function that failed (this will be highly system specific or may even be affected by pre-main shenanigans but will likely be a success code, henceUncategorized
).Maybe the example could use
from_raw_os_error
with a note that the returned kind will depend on how that error code is interpreted by the OS.Error::last_os_error
can be weird #106964Rollup merge of rust-lang#106964 - workingjubilee:crouching-ioerror-h…
Rollup merge of rust-lang#106964 - workingjubilee:crouching-ioerror-h…