Skip to content

Commit 66ab8f8

Browse files
Remove E0719
This hard error serves no purpose. Fixes #143143
1 parent b63223c commit 66ab8f8

File tree

12 files changed

+176
-965
lines changed

12 files changed

+176
-965
lines changed

compiler/rustc_error_codes/src/error_codes/E0719.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#### Note: this error code is no longer emitted by the compiler.
2+
13
An associated type value was specified more than once.
24

35
Erroneous code example:

compiler/rustc_error_codes/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ E0716: 0716,
464464
E0711: 0711,
465465
E0717: 0717,
466466
E0718: 0718,
467-
E0719: 0719,
467+
E0719: 0719, // REMOVED: no longer an error
468468
E0720: 0720,
469469
E0722: 0722,
470470
E0724: 0724,

compiler/rustc_hir_analysis/messages.ftl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,11 +600,6 @@ hir_analysis_unused_generic_parameter_ty_alias_help =
600600
601601
hir_analysis_useless_impl_item = this item cannot be used as its where bounds are not satisfied for the `Self` type
602602
603-
hir_analysis_value_of_associated_struct_already_specified =
604-
the value of the associated type `{$item_name}` in trait `{$def_path}` is already specified
605-
.label = re-bound here
606-
.previous_bound_label = `{$item_name}` bound here first
607-
608603
hir_analysis_variadic_function_compatible_convention = C-variadic functions with the {$convention} calling convention are not supported
609604
.label = C-variadic function must have a compatible calling convention
610605

compiler/rustc_hir_analysis/src/errors.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -401,18 +401,6 @@ pub(crate) struct TypeofReservedKeywordUsed<'tcx> {
401401
pub opt_sugg: Option<(Span, Applicability)>,
402402
}
403403

404-
#[derive(Diagnostic)]
405-
#[diag(hir_analysis_value_of_associated_struct_already_specified, code = E0719)]
406-
pub(crate) struct ValueOfAssociatedStructAlreadySpecified {
407-
#[primary_span]
408-
#[label]
409-
pub span: Span,
410-
#[label(hir_analysis_previous_bound_label)]
411-
pub prev_span: Span,
412-
pub item_name: Ident,
413-
pub def_path: String,
414-
}
415-
416404
#[derive(Diagnostic)]
417405
#[diag(hir_analysis_unconstrained_opaque_type)]
418406
#[note]

compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use std::ops::ControlFlow;
22

3-
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
3+
use rustc_data_structures::fx::FxIndexSet;
44
use rustc_errors::codes::*;
55
use rustc_errors::struct_span_code_err;
66
use rustc_hir as hir;
@@ -524,14 +524,13 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
524524
/// the `trait_ref` here will be `for<'a> T: Iterator`.
525525
/// The `constraint` data however is from *inside* the binder
526526
/// (e.g., `&'a u32`) and hence may reference bound regions.
527-
#[instrument(level = "debug", skip(self, bounds, duplicates, path_span))]
527+
#[instrument(level = "debug", skip(self, bounds, path_span))]
528528
pub(super) fn lower_assoc_item_constraint(
529529
&self,
530530
hir_ref_id: hir::HirId,
531531
trait_ref: ty::PolyTraitRef<'tcx>,
532532
constraint: &hir::AssocItemConstraint<'tcx>,
533533
bounds: &mut Vec<(ty::Clause<'tcx>, Span)>,
534-
duplicates: &mut FxIndexMap<DefId, Span>,
535534
path_span: Span,
536535
predicate_filter: PredicateFilter,
537536
) -> Result<(), ErrorGuaranteed> {
@@ -587,18 +586,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
587586
)
588587
.expect("failed to find associated item");
589588

590-
duplicates
591-
.entry(assoc_item.def_id)
592-
.and_modify(|prev_span| {
593-
self.dcx().emit_err(errors::ValueOfAssociatedStructAlreadySpecified {
594-
span: constraint.span,
595-
prev_span: *prev_span,
596-
item_name: constraint.ident,
597-
def_path: tcx.def_path_str(assoc_item.container_id(tcx)),
598-
});
599-
})
600-
.or_insert(constraint.span);
601-
602589
let projection_term = if let ty::AssocTag::Fn = assoc_tag {
603590
let bound_vars = tcx.late_bound_vars(constraint.hir_id);
604591
ty::Binder::bind_with_vars(

compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use std::assert_matches::assert_matches;
2424
use std::slice;
2525

2626
use rustc_ast::TraitObjectSyntax;
27-
use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet};
27+
use rustc_data_structures::fx::{FxHashSet, FxIndexSet};
2828
use rustc_errors::codes::*;
2929
use rustc_errors::{
3030
Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, FatalError, struct_span_code_err,
@@ -801,7 +801,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
801801
poly_trait_ref,
802802
constraint,
803803
&mut Default::default(),
804-
&mut Default::default(),
805804
constraint.span,
806805
predicate_filter,
807806
);
@@ -907,7 +906,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
907906
}
908907
}
909908

910-
let mut dup_constraints = FxIndexMap::default();
911909
for constraint in trait_segment.args().constraints {
912910
// Don't register any associated item constraints for negative bounds,
913911
// since we should have emitted an error for them earlier, and they
@@ -926,7 +924,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
926924
poly_trait_ref,
927925
constraint,
928926
bounds,
929-
&mut dup_constraints,
930927
constraint.span,
931928
predicate_filter,
932929
);

0 commit comments

Comments
 (0)