Skip to content

Commit

Permalink
section_mangler: Change API for SectionMangler::with_return_type
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenArthur committed Jun 11, 2024
1 parent b36dcbd commit 7ad554f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions compiler/section_mangler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ impl SectionMangler {
}
}

pub fn with_return_type(self, return_type: Option<Type>) -> SectionMangler {
pub fn with_return_type(self, return_type: Type) -> SectionMangler {
match self {
SectionMangler::Function(f) => SectionMangler::Function(FunctionMangler { return_type, ..f }),
SectionMangler::Function(f) => {
SectionMangler::Function(FunctionMangler { return_type: Some(return_type), ..f })
}
SectionMangler::Variable(_) => unreachable!("global variables do not have a return type."),
}
}
Expand Down

0 comments on commit 7ad554f

Please sign in to comment.