librustc_errors: Extract sugg/subst handling into method
An initial refactoring before working on #61809. This moves the whole block into a method so that it can be reused in the annotate-snippet output. It's already used in the new emitter, but there's no UI tests with suggestions included in this PR. A first look at some UI tests with suggestions showed that there's some more work to do in [annotate-snippet-rs][annotate-snippet-rs] before the new output is closer to the current one.
This commit is contained in:
parent
2d851b3318
commit
84ccbe2076
2 changed files with 32 additions and 12 deletions
|
@ -30,10 +30,8 @@ pub struct AnnotateSnippetEmitterWriter {
|
|||
impl Emitter for AnnotateSnippetEmitterWriter {
|
||||
/// The entry point for the diagnostics generation
|
||||
fn emit_diagnostic(&mut self, db: &DiagnosticBuilder<'_>) {
|
||||
let primary_span = db.span.clone();
|
||||
let children = db.children.clone();
|
||||
// FIXME(#59346): Collect suggestions (see emitter.rs)
|
||||
let suggestions: &[_] = &[];
|
||||
let (primary_span, suggestions) = self.primary_span_formatted(&db);
|
||||
|
||||
// FIXME(#59346): Add `fix_multispans_in_std_macros` function from emitter.rs
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue