X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_errors%2Flib.rs;h=bc943f2c09cdf915354b69c4ec3016dcebf7ee15;hb=5f3ffee6b77f073b78bdc76e7a0f4811bc39e7f9;hp=1a0fe3435213000aa14b28b55f426860b6b5a245;hpb=d050b00759b206458ba23a863d6a985198ee5588;p=rust.git diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 1a0fe343521..bc943f2c09c 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -786,8 +786,12 @@ fn print_error_count(&mut self, registry: &Registry) { .emitted_diagnostic_codes .iter() .filter_map(|x| match &x { - DiagnosticId::Error(s) if registry.find_description(s).is_some() => { - Some(s.clone()) + DiagnosticId::Error(s) => { + if let Ok(Some(_explanation)) = registry.try_find_description(s) { + Some(s.clone()) + } else { + None + } } _ => None, })