rustc_errors: let DiagnosticBuilder::emit
return a "guarantee of emission".
This commit is contained in:
parent
0b9d70cf6d
commit
b7e95dee65
83 changed files with 842 additions and 471 deletions
|
@ -3,7 +3,7 @@ use std::ptr;
|
|||
use rustc_ast::{self as ast, Path};
|
||||
use rustc_ast_pretty::pprust;
|
||||
use rustc_data_structures::fx::FxHashSet;
|
||||
use rustc_errors::{struct_span_err, Applicability, Diagnostic, DiagnosticBuilder};
|
||||
use rustc_errors::{struct_span_err, Applicability, Diagnostic, DiagnosticBuilder, ErrorReported};
|
||||
use rustc_feature::BUILTIN_ATTRIBUTES;
|
||||
use rustc_hir::def::Namespace::{self, *};
|
||||
use rustc_hir::def::{self, CtorKind, CtorOf, DefKind, NonMacroAttrKind};
|
||||
|
@ -110,7 +110,7 @@ impl<'a> Resolver<'a> {
|
|||
&self,
|
||||
span: Span,
|
||||
resolution_error: ResolutionError<'_>,
|
||||
) -> DiagnosticBuilder<'_> {
|
||||
) -> DiagnosticBuilder<'_, ErrorReported> {
|
||||
match resolution_error {
|
||||
ResolutionError::GenericParamsFromOuterFunction(outer_res, has_generic_params) => {
|
||||
let mut err = struct_span_err!(
|
||||
|
@ -624,7 +624,10 @@ impl<'a> Resolver<'a> {
|
|||
}
|
||||
}
|
||||
|
||||
crate fn report_vis_error(&self, vis_resolution_error: VisResolutionError<'_>) {
|
||||
crate fn report_vis_error(
|
||||
&self,
|
||||
vis_resolution_error: VisResolutionError<'_>,
|
||||
) -> ErrorReported {
|
||||
match vis_resolution_error {
|
||||
VisResolutionError::Relative2018(span, path) => {
|
||||
let mut err = self.session.struct_span_err(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue