Rollup merge of #103970 - oli-obk:unhide_unknown_spans, r=estebank
Unhide unknown spans r? ```@estebank```
This commit is contained in:
commit
fcbe990093
17 changed files with 121 additions and 69 deletions
|
@ -241,10 +241,12 @@ impl<'a> Resolver<'a> {
|
|||
));
|
||||
|
||||
err.span_label(span, format!("`{}` re{} here", name, new_participle));
|
||||
err.span_label(
|
||||
self.session.source_map().guess_head_span(old_binding.span),
|
||||
format!("previous {} of the {} `{}` here", old_noun, old_kind, name),
|
||||
);
|
||||
if !old_binding.span.is_dummy() && old_binding.span != span {
|
||||
err.span_label(
|
||||
self.session.source_map().guess_head_span(old_binding.span),
|
||||
format!("previous {} of the {} `{}` here", old_noun, old_kind, name),
|
||||
);
|
||||
}
|
||||
|
||||
// See https://github.com/rust-lang/rust/issues/32354
|
||||
use NameBindingKind::Import;
|
||||
|
|
|
@ -807,14 +807,16 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> {
|
|||
err.code(rustc_errors::error_code!(E0411));
|
||||
err.span_label(span, "`Self` is only available in impls, traits, and type definitions");
|
||||
if let Some(item_kind) = self.diagnostic_metadata.current_item {
|
||||
err.span_label(
|
||||
item_kind.ident.span,
|
||||
format!(
|
||||
"`Self` not allowed in {} {}",
|
||||
item_kind.kind.article(),
|
||||
item_kind.kind.descr()
|
||||
),
|
||||
);
|
||||
if !item_kind.ident.span.is_dummy() {
|
||||
err.span_label(
|
||||
item_kind.ident.span,
|
||||
format!(
|
||||
"`Self` not allowed in {} {}",
|
||||
item_kind.kind.article(),
|
||||
item_kind.kind.descr()
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
true
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue