-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.F-never_type`#![feature(never_type)]``#![feature(never_type)]`T-langRelevant to the language teamRelevant to the language team
Description
#![feature(never_type)]
fn will_not_fail() -> Result<i32, !> {
Ok(5)
}
pub fn main() {
will_not_fail();
}
This code yields a warning:
warning: unused `std::result::Result` that must be used
--> main.rs:8:5
|
8 | will_not_fail();
| ^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_must_use)]` on by default
= note: this `Result` may be an `Err` variant, which should be handled
However since a Result<T, !>
can never have the Err
branch, having to handle the resulting error seems kind of pointless. Would it be possible to disable the unused_must_use
lint for this particular case?
david-sawatzke, Schuwi, BatmanAoD, Globidev and RossPorter506
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.F-never_type`#![feature(never_type)]``#![feature(never_type)]`T-langRelevant to the language teamRelevant to the language team