Rework diagnostics for wrong number of generic args

This commit is contained in:
Patryk Wychowaniec 2021-01-02 19:45:11 +01:00
parent 34628e5b53
commit d2f8e398f1
No known key found for this signature in database
GPG key ID: F62547D075E09767
121 changed files with 2787 additions and 766 deletions

View file

@ -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,