mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Mark emplace_variable as must_use
This commit is contained in:
parent
33a9c39cfd
commit
ce5ca4a93c
1 changed files with 3 additions and 2 deletions
|
@ -585,8 +585,9 @@ impl Types {
|
||||||
/// # Safety
|
/// # Safety
|
||||||
///
|
///
|
||||||
/// May only be called if `var` is known to represent the type at `index`.
|
/// May only be called if `var` is known to represent the type at `index`.
|
||||||
pub unsafe fn emplace_variable(&mut self, index: Index<TypeTag>, var: Variable) {
|
#[must_use]
|
||||||
self.tags[index.index()] = TypeTag::Variable(var);
|
pub unsafe fn emplace_variable(&mut self, index: Index<TypeTag>, var: Variable) -> TypeTag {
|
||||||
|
std::mem::replace(&mut self.tags[index.index()], TypeTag::Variable(var))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn reserve_type_tags(&mut self, length: usize) -> Slice<TypeTag> {
|
fn reserve_type_tags(&mut self, length: usize) -> Slice<TypeTag> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue