Rework diagnostics for wrong number of generic args
This commit is contained in:
parent
34628e5b53
commit
d2f8e398f1
121 changed files with 2787 additions and 766 deletions
|
@ -221,6 +221,10 @@ fn def_span(tcx: TyCtxt<'_>, def_id: DefId) -> Span {
|
|||
tcx.hir().span_if_local(def_id).unwrap()
|
||||
}
|
||||
|
||||
fn def_ident_span(tcx: TyCtxt<'_>, def_id: DefId) -> Option<Span> {
|
||||
tcx.hir().get_if_local(def_id).and_then(|node| node.ident()).map(|ident| ident.span)
|
||||
}
|
||||
|
||||
/// If the given `DefId` describes an item belonging to a trait,
|
||||
/// returns the `DefId` of the trait that the trait item belongs to;
|
||||
/// otherwise, returns `None`.
|
||||
|
@ -491,6 +495,7 @@ pub fn provide(providers: &mut ty::query::Providers) {
|
|||
associated_items,
|
||||
adt_sized_constraint,
|
||||
def_span,
|
||||
def_ident_span,
|
||||
param_env,
|
||||
param_env_reveal_all_normalized,
|
||||
trait_of_item,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue