Skip to content

Commit

Permalink
Use a Vector for TraitImpl.type_clauses
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadrieril committed Oct 31, 2024
1 parent 16a37de commit 73c98b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charon/src/ast/gast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ pub struct TraitImpl {
/// The `Vec` corresponds to the same `Vector` in `TraitDecl`. In the same way, this is
/// empty after the `lift_associated_item_clauses` pass.
#[charon::opaque]
pub type_clauses: Vec<(TraitItemName, Vec<TraitRef>)>,
pub type_clauses: Vec<(TraitItemName, Vector<TraitClauseId, TraitRef>)>,
/// The implemented required methods
pub required_methods: Vec<(TraitItemName, FunDeclId)>,
/// The re-implemented provided methods
Expand Down
14 changes: 5 additions & 9 deletions charon/src/bin/charon-driver/translate/translate_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,15 +285,11 @@ impl BodyTransCtx<'_, '_, '_> {
let ty = self.translate_ty(item_span, erase_regions, &ty)?;
types.push((name.clone(), ty));

// TODO: use clause ids
let trait_refs = self
.translate_trait_impl_exprs(
item_span,
erase_regions,
&impl_item.required_impl_exprs,
)?
.into_iter()
.collect();
let trait_refs = self.translate_trait_impl_exprs(
item_span,
erase_regions,
&impl_item.required_impl_exprs,
)?;
type_clauses.push((name, trait_refs));
}
_ => panic!("Unexpected definition for trait item: {item_def:?}"),
Expand Down

0 comments on commit 73c98b3

Please sign in to comment.