Update to latest Rust nightly
This commit is contained in:
parent
1f62391b58
commit
a08a1e560a
@ -1123,7 +1123,9 @@ impl<'src> Compiler<'src> {
|
||||
|
||||
// TODO: Check if the right type is boolean
|
||||
|
||||
if self.instructions.len() == instruction_count_before_right + 1 {
|
||||
let instruction_count = self.instructions.len();
|
||||
|
||||
if instruction_count == instruction_count_before_right + 1 {
|
||||
self.instructions
|
||||
.last_mut()
|
||||
.unwrap()
|
||||
@ -1138,11 +1140,16 @@ impl<'src> Compiler<'src> {
|
||||
Operation::LOAD_ENCODED | Operation::LOAD_CONSTANT,
|
||||
])
|
||||
) {
|
||||
let instruction_count = self.instructions.len();
|
||||
let loaders = self
|
||||
.instructions
|
||||
.get_many_mut([instruction_count - 1, instruction_count - 2])
|
||||
.unwrap(); // Safe because the indices in bounds and do not overlap
|
||||
let loaders = if cfg!(debug_assertions) {
|
||||
self.instructions
|
||||
.get_disjoint_mut([instruction_count - 1, instruction_count - 2])
|
||||
.unwrap() // Safe because the indices in bounds and do not overlap
|
||||
} else {
|
||||
unsafe {
|
||||
self.instructions
|
||||
.get_disjoint_unchecked_mut([instruction_count - 1, instruction_count - 2])
|
||||
}
|
||||
};
|
||||
|
||||
loaders[0].0.set_a_field(left.index());
|
||||
loaders[1].0.set_a_field(left.index());
|
||||
|
@ -27,7 +27,6 @@
|
||||
//!
|
||||
//! println!("{}", report);
|
||||
//! ```
|
||||
#![feature(get_many_mut)]
|
||||
|
||||
pub mod chunk;
|
||||
pub mod compiler;
|
||||
|
@ -197,9 +197,9 @@ where
|
||||
|
||||
pub fn get_many_mut(&mut self, indices: RangeInclusive<usize>) -> &mut [Register<T>] {
|
||||
let registers = if cfg!(debug_assertions) {
|
||||
self.registers.get_many_mut([indices]).unwrap()
|
||||
self.registers.get_disjoint_mut([indices]).unwrap()
|
||||
} else {
|
||||
unsafe { self.registers.get_many_unchecked_mut([indices]) }
|
||||
unsafe { self.registers.get_disjoint_unchecked_mut([indices]) }
|
||||
};
|
||||
|
||||
registers[0]
|
||||
@ -231,18 +231,6 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
pub fn close_many(&mut self, indices: RangeInclusive<usize>) {
|
||||
let registers = if cfg!(debug_assertions) {
|
||||
&mut self.registers.get_many_mut([indices]).unwrap()[0]
|
||||
} else {
|
||||
unsafe { &mut self.registers.get_many_unchecked_mut([indices])[0] }
|
||||
};
|
||||
|
||||
for register in registers.iter_mut() {
|
||||
register.close();
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_closed(&self, index: usize) -> bool {
|
||||
if cfg!(debug_assertions) {
|
||||
self.registers.get(index).unwrap().is_closed()
|
||||
|
Loading…
x
Reference in New Issue
Block a user