nhwn: make treat_err_as_bug Option<NonZeroUsize>
This commit is contained in:
parent
93f6a4b9d8
commit
8ddd846ce1
4 changed files with 16 additions and 11 deletions
|
@ -2313,6 +2313,7 @@ crate mod dep_tracking {
|
|||
use std::collections::hash_map::DefaultHasher;
|
||||
use std::collections::BTreeMap;
|
||||
use std::hash::Hash;
|
||||
use std::num::NonZeroUsize;
|
||||
use std::path::PathBuf;
|
||||
|
||||
pub trait DepTrackingHash {
|
||||
|
@ -2353,6 +2354,7 @@ crate mod dep_tracking {
|
|||
impl_dep_tracking_hash_via_hash!(lint::Level);
|
||||
impl_dep_tracking_hash_via_hash!(Option<bool>);
|
||||
impl_dep_tracking_hash_via_hash!(Option<usize>);
|
||||
impl_dep_tracking_hash_via_hash!(Option<NonZeroUsize>);
|
||||
impl_dep_tracking_hash_via_hash!(Option<String>);
|
||||
impl_dep_tracking_hash_via_hash!(Option<(String, u64)>);
|
||||
impl_dep_tracking_hash_via_hash!(Option<Vec<String>>);
|
||||
|
|
|
@ -16,6 +16,7 @@ use std::collections::BTreeMap;
|
|||
|
||||
use std::collections::hash_map::DefaultHasher;
|
||||
use std::hash::Hasher;
|
||||
use std::num::NonZeroUsize;
|
||||
use std::path::PathBuf;
|
||||
use std::str;
|
||||
|
||||
|
@ -591,10 +592,10 @@ macro_rules! options {
|
|||
true
|
||||
}
|
||||
|
||||
fn parse_treat_err_as_bug(slot: &mut Option<usize>, v: Option<&str>) -> bool {
|
||||
fn parse_treat_err_as_bug(slot: &mut Option<NonZeroUsize>, v: Option<&str>) -> bool {
|
||||
match v {
|
||||
Some(s) => { *slot = s.parse().ok().filter(|&x| x != 0); slot.unwrap_or(0) != 0 }
|
||||
None => { *slot = Some(1); true }
|
||||
Some(s) => { *slot = s.parse().ok(); slot.is_some() }
|
||||
None => { *slot = NonZeroUsize::new(1); true }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1141,7 +1142,7 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
|
|||
"for every macro invocation, print its name and arguments (default: no)"),
|
||||
trap_unreachable: Option<bool> = (None, parse_opt_bool, [TRACKED],
|
||||
"generate trap instructions for unreachable intrinsics (default: use target setting, usually yes)"),
|
||||
treat_err_as_bug: Option<usize> = (None, parse_treat_err_as_bug, [TRACKED],
|
||||
treat_err_as_bug: Option<NonZeroUsize> = (None, parse_treat_err_as_bug, [TRACKED],
|
||||
"treat error number `val` that occurs as bug"),
|
||||
trim_diagnostic_paths: bool = (true, parse_bool, [UNTRACKED],
|
||||
"in diagnostics, use heuristics to shorten paths referring to items"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue