tint: add [[nodiscard]] on utils::Result class

Helps when changing the return type of a function from `void` to
`Result<T>`. The compiler fails in places where the return value is
ignored, which is never what we want with Result.

Change-Id: Id3271ea9fb1128f8f493030f013b2b577235be8f
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/99160
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Antonio Maiorano <amaiorano@google.com>
This commit is contained in:
Antonio Maiorano 2022-08-15 19:31:51 +00:00 committed by Dawn LUCI CQ
parent c935b497e6
commit fa4a7291f2
1 changed files with 1 additions and 1 deletions

View File

@ -32,7 +32,7 @@ static constexpr const FailureType Failure;
/// information about the failure, except that something failed. Must not be the same type
/// as SUCCESS_TYPE.
template <typename SUCCESS_TYPE, typename FAILURE_TYPE = FailureType>
struct Result {
struct [[nodiscard]] Result {
static_assert(!std::is_same_v<SUCCESS_TYPE, FAILURE_TYPE>,
"Result must not have the same type for SUCCESS_TYPE and FAILURE_TYPE");