mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-22 08:17:40 +03:00
Mark emplace_variable as must_use
This commit is contained in:
parent
33a9c39cfd
commit
ce5ca4a93c
@ -585,8 +585,9 @@ impl Types {
|
||||
/// # Safety
|
||||
///
|
||||
/// 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) {
|
||||
self.tags[index.index()] = TypeTag::Variable(var);
|
||||
#[must_use]
|
||||
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> {
|
||||
|
Loading…
Reference in New Issue
Block a user