Requring `Display` is wrong here, because if this is actually an
Error, Display would be wrong because it doesn't display causes.
As it happens, the `error` parameter is only ever `&str`.
This is a fair amount of manual work to keep in sync. I would like to
disable this, at least as a mandatory check, for now.
Fixes#601 (the request for it to become non-blocking).
The underlying issue is #581 and remains open.
Co-authored-by: trinity-1686a <trinity@deuxfleurs.fr>
This logic is a bit tricky, so I've tried to document it and add
fairly good tests. The silver lining is that the external API for
all of this logic will make it invisible and hidden.
There are some cases where I added functions that I think might
eventually get lowered into MdConsensus: But I don't want to lower
too much right now, since the convention for our netdoc accessors is
that they are fairly unsophisticated, and they show you the document
as it is.
Closes#686
These are deliberately unsophisticated accessors, in that they return Option<>
rather than filling in missing values with the documented
fallbacks. It seems better to leave a way to distinguish the absent
case in the API.
Change ErrorHint so that, internally, it just holds an enum with a
lightweight reference to whatever parts of the error it needs to
generate a hint. Then we can move the formatting logic into a
Display function for ErrorHint, and do away with ErrorDetail entirely.
Move the "hint" function into Error, and use Option rather than Result.
(I'm using Option here because it's not really an error case not to have
a hint; we just either have a hint, or we don't.)
This commit replaces all occurrences of `llvm-tools-preview` with
`llvm-tools`, because it became a stable feature with Rust 1.60, thereby
making the `-preview` prefix obsolete. Beside this, `llvm-tools-preview`
is a redirection to the latter one anyway.
However, it does not work the other way around. At the moment, it is not
possible to execute the `maint/coverage` script on a NixOS system,
because the rustup component list only includes `llvm-tools`, but not
`llvm-tools-preview`, thereby making this change necessary.
Clippy now complains about `let _ = (expr_producing_a_future);`,
which is probably smart, since maybe you wanted to await that future
and ignore the result. So it seems that the right way to get rid of
an unwanted Receiver is now to drop it explicitly.
Closes#749
This warning kind of snuck up on us! (See #748) For now, let's
disable it. (I've cleaned it up in a couple of examples, since
those are meant to be more idiomatic and user-facing.)
Closes#748.
This commit adds a test called `shebang`, which checks if all shebangs
in scripts use relative paths through `#/usr/bin/env`, rather than
absolute paths, such as `#/bin/bash`.
See 833b10575b.