diff options
| author | bors <bors@rust-lang.org> | 2024-02-16 07:46:31 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-02-16 07:46:31 +0000 |
| commit | 1be468815cb7c6932fcc7ed3ee81e6a14376c05e (patch) | |
| tree | b0b4d37f0274c53c54e2245a73973c6ba1db47bd /compiler/rustc_errors/src/lib.rs | |
| parent | 0f806a9812b62c36bdab08d33c14cf2d3ecf4355 (diff) | |
| parent | a90cc05233858fcd16c3ca0e0b4320fc5ae09af2 (diff) | |
| download | rust-1be468815cb7c6932fcc7ed3ee81e6a14376c05e.tar.gz rust-1be468815cb7c6932fcc7ed3ee81e6a14376c05e.zip | |
Auto merge of #120486 - reitermarkus:use-generic-nonzero, r=dtolnay
Use generic `NonZero` internally. Tracking issue: https://github.com/rust-lang/rust/issues/120257
Diffstat (limited to 'compiler/rustc_errors/src/lib.rs')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index b0db3545ae7..7c6caf442dc 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -16,6 +16,7 @@ #![feature(box_patterns)] #![feature(error_reporter)] #![feature(extract_if)] +#![feature(generic_nonzero)] #![feature(let_chains)] #![feature(negative_impls)] #![feature(never_type)] @@ -77,7 +78,7 @@ use std::error::Report; use std::fmt; use std::hash::Hash; use std::io::Write; -use std::num::NonZeroUsize; +use std::num::NonZero; use std::ops::DerefMut; use std::panic; use std::path::{Path, PathBuf}; @@ -546,7 +547,7 @@ pub struct DiagCtxtFlags { pub can_emit_warnings: bool, /// If Some, the Nth error-level diagnostic is upgraded to bug-level. /// (rustc: see `-Z treat-err-as-bug`) - pub treat_err_as_bug: Option<NonZeroUsize>, + pub treat_err_as_bug: Option<NonZero<usize>>, /// Eagerly emit delayed bugs as errors, so that the compiler debugger may /// see all of the errors being emitted at once. pub eagerly_emit_delayed_bugs: bool, |
