Skip to content

Commit b4a13f9

Browse files
Remove E0719
This hard error serves no purpose. Fixes #143143
1 parent 5c54aa7 commit b4a13f9

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
@@ -597,11 +597,6 @@ hir_analysis_unused_generic_parameter_ty_alias_help =
597597
598598
hir_analysis_useless_impl_item = this item cannot be used as its where bounds are not satisfied for the `Self` type
599599
600-
hir_analysis_value_of_associated_struct_already_specified =
601-
the value of the associated type `{$item_name}` in trait `{$def_path}` is already specified
602-
.label = re-bound here
603-
.previous_bound_label = `{$item_name}` bound here first
604-
605600
hir_analysis_variadic_function_compatible_convention = C-variadic function must have a compatible calling convention, like {$conventions}
606601
.label = C-variadic function must have a compatible calling convention
607602

compiler/rustc_hir_analysis/src/errors.rs

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

405-
#[derive(Diagnostic)]
406-
#[diag(hir_analysis_value_of_associated_struct_already_specified, code = E0719)]
407-
pub(crate) struct ValueOfAssociatedStructAlreadySpecified {
408-
#[primary_span]
409-
#[label]
410-
pub span: Span,
411-
#[label(hir_analysis_previous_bound_label)]
412-
pub prev_span: Span,
413-
pub item_name: Ident,
414-
pub def_path: String,
415-
}
416-
417405
#[derive(Diagnostic)]
418406
#[diag(hir_analysis_unconstrained_opaque_type)]
419407
#[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;
@@ -418,14 +418,13 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
418418
/// the `trait_ref` here will be `for<'a> T: Iterator`.
419419
/// The `constraint` data however is from *inside* the binder
420420
/// (e.g., `&'a u32`) and hence may reference bound regions.
421-
#[instrument(level = "debug", skip(self, bounds, duplicates, path_span))]
421+
#[instrument(level = "debug", skip(self, bounds, path_span))]
422422
pub(super) fn lower_assoc_item_constraint(
423423
&self,
424424
hir_ref_id: hir::HirId,
425425
trait_ref: ty::PolyTraitRef<'tcx>,
426426
constraint: &hir::AssocItemConstraint<'tcx>,
427427
bounds: &mut Vec<(ty::Clause<'tcx>, Span)>,
428-
duplicates: &mut FxIndexMap<DefId, Span>,
429428
path_span: Span,
430429
predicate_filter: PredicateFilter,
431430
) -> Result<(), ErrorGuaranteed> {
@@ -481,18 +480,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
481480
)
482481
.expect("failed to find associated item");
483482

484-
duplicates
485-
.entry(assoc_item.def_id)
486-
.and_modify(|prev_span| {
487-
self.dcx().emit_err(errors::ValueOfAssociatedStructAlreadySpecified {
488-
span: constraint.span,
489-
prev_span: *prev_span,
490-
item_name: constraint.ident,
491-
def_path: tcx.def_path_str(assoc_item.container_id(tcx)),
492-
});
493-
})
494-
.or_insert(constraint.span);
495-
496483
let projection_term = if let ty::AssocTag::Fn = assoc_tag {
497484
let bound_vars = tcx.late_bound_vars(constraint.hir_id);
498485
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,
@@ -778,7 +778,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
778778
poly_trait_ref,
779779
constraint,
780780
&mut Default::default(),
781-
&mut Default::default(),
782781
constraint.span,
783782
predicate_filter,
784783
);
@@ -880,7 +879,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
880879
}
881880
}
882881

883-
let mut dup_constraints = FxIndexMap::default();
884882
for constraint in trait_segment.args().constraints {
885883
// Don't register any associated item constraints for negative bounds,
886884
// since we should have emitted an error for them earlier, and they
@@ -899,7 +897,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
899897
poly_trait_ref,
900898
constraint,
901899
bounds,
902-
&mut dup_constraints,
903900
constraint.span,
904901
predicate_filter,
905902
);

0 commit comments

Comments
 (0)