diff options
| author | bors <bors@rust-lang.org> | 2023-02-26 12:40:05 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-02-26 12:40:05 +0000 |
| commit | c4e0cd966062ca67daed20775f4e8a60c28e57df (patch) | |
| tree | a76fa48fe30ba83326439fadaae6a62890573e4b /compiler/rustc_errors/src/lib.rs | |
| parent | 43ee4d15bf201f72c36abd7f02961df87dead441 (diff) | |
| parent | 9c27fc7d34512a6b3d34247beab4a6ada2476c58 (diff) | |
| download | rust-c4e0cd966062ca67daed20775f4e8a60c28e57df.tar.gz rust-c4e0cd966062ca67daed20775f4e8a60c28e57df.zip | |
Auto merge of #108488 - matthiaskrgr:rollup-i61epcw, r=matthiaskrgr
Rollup of 9 pull requests
Successful merges:
- #107941 (Treat `str` as containing `[u8]` for auto trait purposes)
- #108299 (Require `literal`s for some `(u)int_impl!` parameters)
- #108337 (hir-analysis: make a helpful note)
- #108379 (Add `ErrorGuaranteed` to `hir::{Expr,Ty}Kind::Err` variants)
- #108418 (Replace parse_[sth]_expr with parse_expr_[sth] function names)
- #108424 (rustc_infer: Consolidate obligation elaboration de-duplication)
- #108475 (Fix `VecDeque::shrink_to` and add tests.)
- #108482 (statically guarantee that current error codes are documented)
- #108484 (Remove `from` lang item)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_errors/src/lib.rs')
| -rw-r--r-- | compiler/rustc_errors/src/lib.rs | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/compiler/rustc_errors/src/lib.rs b/compiler/rustc_errors/src/lib.rs index edec8cce92f..cbf595089cc 100644 --- a/compiler/rustc_errors/src/lib.rs +++ b/compiler/rustc_errors/src/lib.rs @@ -42,7 +42,7 @@ pub use rustc_error_messages::{ pub use rustc_lint_defs::{pluralize, Applicability}; use rustc_macros::fluent_messages; use rustc_span::source_map::SourceMap; -use rustc_span::HashStableContext; +pub use rustc_span::ErrorGuaranteed; use rustc_span::{Loc, Span}; use std::borrow::Cow; @@ -1477,9 +1477,7 @@ impl HandlerInner { .emitted_diagnostic_codes .iter() .filter_map(|x| match &x { - DiagnosticId::Error(s) - if registry.try_find_description(s).map_or(false, |o| o.is_some()) => - { + DiagnosticId::Error(s) if registry.try_find_description(s).is_ok() => { Some(s.clone()) } _ => None, @@ -1846,17 +1844,3 @@ pub enum TerminalUrl { Yes, Auto, } - -/// Useful type to use with `Result<>` indicate that an error has already -/// been reported to the user, so no need to continue checking. -#[derive(Clone, Copy, Debug, Encodable, Decodable, Hash, PartialEq, Eq, PartialOrd, Ord)] -#[derive(HashStable_Generic)] -pub struct ErrorGuaranteed(()); - -impl ErrorGuaranteed { - /// To be used only if you really know what you are doing... ideally, we would find a way to - /// eliminate all calls to this method. - pub fn unchecked_claim_error_was_emitted() -> Self { - ErrorGuaranteed(()) - } -} |
