Skip to content

Commit 1fb5e6c

Browse files
committed
Remove an unnecessary span_delayed_bug in Resolver::valid_res_from_ribs.
`Resolver::report_error` always emits (this commit makes that clearer), so the `span_delayed_bug` is unnecessary.
1 parent c97b86c commit 1fb5e6c

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

compiler/rustc_resolve/src/diagnostics.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,12 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
554554
///
555555
/// This takes the error provided, combines it with the span and any additional spans inside the
556556
/// error and emits it.
557-
pub(crate) fn report_error(&mut self, span: Span, resolution_error: ResolutionError<'a>) {
558-
self.into_struct_error(span, resolution_error).emit();
557+
pub(crate) fn report_error(
558+
&mut self,
559+
span: Span,
560+
resolution_error: ResolutionError<'a>,
561+
) -> ErrorGuaranteed {
562+
self.into_struct_error(span, resolution_error).emit()
559563
}
560564

561565
pub(crate) fn into_struct_error(

compiler/rustc_resolve/src/ident.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use rustc_ast::{self as ast, NodeId};
2+
use rustc_errors::ErrorGuaranteed;
23
use rustc_hir::def::{DefKind, Namespace, NonMacroAttrKind, PartialRes, PerNS};
34
use rustc_middle::bug;
45
use rustc_middle::ty;
@@ -1056,7 +1057,6 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
10561057
original_rib_ident_def: Ident,
10571058
all_ribs: &[Rib<'a>],
10581059
) -> Res {
1059-
const CG_BUG_STR: &str = "min_const_generics resolve check didn't stop compilation";
10601060
debug!("validate_res_from_ribs({:?})", res);
10611061
let ribs = &all_ribs[rib_index + 1..];
10621062

@@ -1200,7 +1200,6 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
12001200
}
12011201
};
12021202
self.report_error(span, error);
1203-
self.dcx().span_delayed_bug(span, CG_BUG_STR);
12041203
}
12051204

12061205
return Res::Err;

0 commit comments

Comments
 (0)