Rollup merge of #132374 - fmease:rm-dead-eff-code, r=compiler-errors

Remove dead code stemming from the old effects desugaring

r? project-const-traits
This commit is contained in:
Matthias Krüger 2024-10-31 01:14:04 +01:00 committed by GitHub
commit 7d0dbc5f53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 4 additions and 40 deletions

View file

@ -821,8 +821,7 @@ pub(super) fn check_specialization_validity<'tcx>(
let result = opt_result.unwrap_or(Ok(()));
if let Err(parent_impl) = result {
// FIXME(effects) the associated type from effects could be specialized
if !tcx.is_impl_trait_in_trait(impl_item) && !tcx.is_effects_desugared_assoc_ty(impl_item) {
if !tcx.is_impl_trait_in_trait(impl_item) {
report_forbidden_specialization(tcx, impl_item, parent_impl);
} else {
tcx.dcx().delayed_bug(format!("parent item: {parent_impl:?} not marked as default"));

View file

@ -2042,7 +2042,7 @@ pub(super) fn check_type_bounds<'tcx>(
// A synthetic impl Trait for RPITIT desugaring or assoc type for effects desugaring has no HIR,
// which we currently use to get the span for an impl's associated type. Instead, for these,
// use the def_span for the synthesized associated type.
let impl_ty_span = if impl_ty.is_impl_trait_in_trait() || impl_ty.is_effects_desugaring {
let impl_ty_span = if impl_ty.is_impl_trait_in_trait() {
tcx.def_span(impl_ty_def_id)
} else {
match tcx.hir_node_by_def_id(impl_ty_def_id) {

View file

@ -379,9 +379,6 @@ pub(super) fn explicit_item_bounds_with_filter(
}
let bounds = match tcx.hir_node_by_def_id(def_id) {
_ if tcx.is_effects_desugared_assoc_ty(def_id.to_def_id()) => {
associated_type_bounds(tcx, def_id, &[], tcx.def_span(def_id), filter)
}
hir::Node::TraitItem(hir::TraitItem {
kind: hir::TraitItemKind::Type(bounds, _),
span,

View file

@ -140,9 +140,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
tcx.associated_items(pred.def_id())
.in_definition_order()
.filter(|item| item.kind == ty::AssocKind::Type)
.filter(|item| {
!item.is_impl_trait_in_trait() && !item.is_effects_desugaring
})
.filter(|item| !item.is_impl_trait_in_trait())
.map(|item| item.def_id),
);
}