diff options
| author | León Orell Valerian Liehr <me@fmease.dev> | 2024-05-27 23:53:46 +0200 |
|---|---|---|
| committer | León Orell Valerian Liehr <me@fmease.dev> | 2024-05-30 22:52:33 +0200 |
| commit | 34c56c45cff1d0029dafd7d19c524975292382af (patch) | |
| tree | 0738ba0b43dc1693fd14104887bcf636b94a0d5b /compiler/rustc_hir_analysis/src/structured_errors | |
| parent | 0a59f113629aafb6e5ee55ad04a2d451a11d8466 (diff) | |
| download | rust-34c56c45cff1d0029dafd7d19c524975292382af.tar.gz rust-34c56c45cff1d0029dafd7d19c524975292382af.zip | |
Rename HIR `TypeBinding` to `AssocItemConstraint` and related cleanup
Diffstat (limited to 'compiler/rustc_hir_analysis/src/structured_errors')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs b/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs index 9ddba7a6e7a..5d435a8edf9 100644 --- a/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs +++ b/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs @@ -489,7 +489,11 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> { .in_definition_order() .filter(|item| item.kind == AssocKind::Type) .filter(|item| { - !self.gen_args.bindings.iter().any(|binding| binding.ident.name == item.name) + !self + .gen_args + .constraints + .iter() + .any(|constraint| constraint.ident.name == item.name) }) .map(|item| item.name.to_ident_string()) .collect() @@ -679,11 +683,11 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> { (last_lt.span().shrink_to_hi(), false) }; let has_non_lt_args = self.num_provided_type_or_const_args() != 0; - let has_bindings = !self.gen_args.bindings.is_empty(); + let has_constraints = !self.gen_args.constraints.is_empty(); let sugg_prefix = if is_first { "" } else { ", " }; let sugg_suffix = - if is_first && (has_non_lt_args || has_bindings) { ", " } else { "" }; + if is_first && (has_non_lt_args || has_constraints) { ", " } else { "" }; let sugg = format!("{sugg_prefix}{suggested_args}{sugg_suffix}"); debug!("sugg: {:?}", sugg); @@ -741,7 +745,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> { let sugg_prefix = if is_first { "" } else { ", " }; let sugg_suffix = - if is_first && !self.gen_args.bindings.is_empty() { ", " } else { "" }; + if is_first && !self.gen_args.constraints.is_empty() { ", " } else { "" }; let sugg = format!("{sugg_prefix}{suggested_args}{sugg_suffix}"); debug!("sugg: {:?}", sugg); |
