diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-16 14:19:07 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-27 16:31:40 +1100 |
| commit | d0267cb26bad39685d43d8c8a3f6cec79ceac0f7 (patch) | |
| tree | 4afbeff199903b1d92628d7d42240a2f46c30385 /compiler/rustc_resolve | |
| parent | c743e4a855645af740258bbe5d0f707099ab3235 (diff) | |
| download | rust-d0267cb26bad39685d43d8c8a3f6cec79ceac0f7.tar.gz rust-d0267cb26bad39685d43d8c8a3f6cec79ceac0f7.zip | |
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.
Diffstat (limited to 'compiler/rustc_resolve')
| -rw-r--r-- | compiler/rustc_resolve/src/diagnostics.rs | 8 | ||||
| -rw-r--r-- | compiler/rustc_resolve/src/ident.rs | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 222dd69dbc4..96025a26de7 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -554,8 +554,12 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { /// /// This takes the error provided, combines it with the span and any additional spans inside the /// error and emits it. - pub(crate) fn report_error(&mut self, span: Span, resolution_error: ResolutionError<'a>) { - self.into_struct_error(span, resolution_error).emit(); + pub(crate) fn report_error( + &mut self, + span: Span, + resolution_error: ResolutionError<'a>, + ) -> ErrorGuaranteed { + self.into_struct_error(span, resolution_error).emit() } pub(crate) fn into_struct_error( diff --git a/compiler/rustc_resolve/src/ident.rs b/compiler/rustc_resolve/src/ident.rs index 7e7424be303..c17ea00ec80 100644 --- a/compiler/rustc_resolve/src/ident.rs +++ b/compiler/rustc_resolve/src/ident.rs @@ -1,4 +1,5 @@ use rustc_ast::{self as ast, NodeId}; +use rustc_errors::ErrorGuaranteed; use rustc_hir::def::{DefKind, Namespace, NonMacroAttrKind, PartialRes, PerNS}; use rustc_middle::bug; use rustc_middle::ty; @@ -1066,7 +1067,6 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { original_rib_ident_def: Ident, all_ribs: &[Rib<'a>], ) -> Res { - const CG_BUG_STR: &str = "min_const_generics resolve check didn't stop compilation"; debug!("validate_res_from_ribs({:?})", res); let ribs = &all_ribs[rib_index + 1..]; @@ -1209,8 +1209,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { } } }; - self.report_error(span, error); - self.dcx().span_delayed_bug(span, CG_BUG_STR); + let _: ErrorGuaranteed = self.report_error(span, error); } return Res::Err; |
