diff --git a/compiler/solve/src/ability.rs b/compiler/solve/src/ability.rs index c66efdebb1..d36836d547 100644 --- a/compiler/solve/src/ability.rs +++ b/compiler/solve/src/ability.rs @@ -36,7 +36,6 @@ pub enum Unfulfilled { Incomplete { typ: Symbol, ability: Symbol, - specialized_members: Vec>, missing_members: Vec>, }, /// Cannot derive implementation of an ability for a type. @@ -170,17 +169,15 @@ impl ObligationCache<'_> { match typ { Obligated::Opaque(typ) => { let members_of_ability = self.abilities_store.members_of_ability(ability).unwrap(); - let mut specialized_members = Vec::with_capacity(members_of_ability.len()); - let mut missing_members = Vec::with_capacity(members_of_ability.len()); + let mut missing_members = Vec::new(); for &member in members_of_ability { - match self.abilities_store.get_specialization(member, typ) { - None => { - let root_data = self.abilities_store.member_def(member).unwrap(); - missing_members.push(Loc::at(root_data.region, member)); - } - Some(specialization) => { - specialized_members.push(Loc::at(specialization.region, member)); - } + if self + .abilities_store + .get_specialization(member, typ) + .is_none() + { + let root_data = self.abilities_store.member_def(member).unwrap(); + missing_members.push(Loc::at(root_data.region, member)); } } @@ -190,7 +187,6 @@ impl ObligationCache<'_> { Unfulfilled::Incomplete { typ, ability, - specialized_members, missing_members, }, ); diff --git a/reporting/src/error/type.rs b/reporting/src/error/type.rs index 32275ebb54..6adc13329f 100644 --- a/reporting/src/error/type.rs +++ b/reporting/src/error/type.rs @@ -232,7 +232,6 @@ fn report_unfulfilled_ability<'a>( Unfulfilled::Incomplete { typ, ability, - specialized_members, missing_members, } => { debug_assert!(!missing_members.is_empty()); @@ -254,24 +253,6 @@ fn report_unfulfilled_ability<'a>( stack.push(alloc.region(lines.convert_region(member.region))); } - if !specialized_members.is_empty() { - stack.push(alloc.concat([ - alloc.note(""), - alloc.symbol_unqualified(typ), - alloc.reflow(" specializes the following members of "), - alloc.symbol_unqualified(ability), - alloc.reflow(":"), - ])); - - for spec in specialized_members { - stack.push(alloc.concat([ - alloc.symbol_unqualified(spec.value), - alloc.reflow(", specialized here:"), - ])); - stack.push(alloc.region(lines.convert_region(spec.region))); - } - } - alloc.stack(stack) } Unfulfilled::Underivable { diff --git a/reporting/tests/test_reporting.rs b/reporting/tests/test_reporting.rs index 5288c58a95..562c5b9dc3 100644 --- a/reporting/tests/test_reporting.rs +++ b/reporting/tests/test_reporting.rs @@ -9379,13 +9379,6 @@ All branches in an `if` must have the same type! 5│ le : a, a -> Bool | a has Eq ^^ - - Note: `Id` specializes the following members of `Eq`: - - `eq`, specialized here: - - 9│ eq = \@Id m, @Id n -> m == n - ^^ "# ), )