Add two new diagnostics: one for mismatch in generic arguments count, and another for mismatch in their kind

Also known as E0747 and E0107.

And by the way, rewrite how we lower generic arguments and deduplicate it between paths and method calls. The new version is taken almost straight from rustc.

This commit also changes the binders of `generic_defaults()`, to only include the binders of the arguments up to (and not including) the current argument. This make it easier to handle it in the rewritten lowering of generic args. It's also how rustc does it.
This commit is contained in:
Chayim Refael Friedman 2025-03-30 20:20:24 +03:00
parent 2b4b483af1
commit 99ce53b1d7
22 changed files with 1247 additions and 409 deletions

View file

@ -35,7 +35,9 @@ use crate::{
};
pub use self::body::{Body, BodySourceMap};
pub use self::lower::hir_segment_to_ast_segment;
pub use self::lower::{
hir_assoc_type_binding_to_ast, hir_generic_arg_to_ast, hir_segment_to_ast_segment,
};
/// A wrapper around [`span::SyntaxContextId`] that is intended only for comparisons.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]