Skip to content

Commit

Permalink
chore: Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Marwes committed Sep 9, 2023
1 parent 32937a3 commit 86acf32
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 21 deletions.
2 changes: 1 addition & 1 deletion base/src/fixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ impl<T> Buffer<T> {
// SAFETY This effectively works as a RefCell since the mutable reference is limited to
// this module
unsafe {
let mut values = self.values.unsafe_get_mut();
let values = self.values.unsafe_get_mut();
let cap = match values.current().map(|vec| (vec.len(), vec.capacity())) {
Some((len, capacity)) => {
if len == capacity {
Expand Down
7 changes: 1 addition & 6 deletions scripts/install_mdbook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

set -ex

#Getting issue error: unrecognized subcommand '/home/travis/.rustup/toolchains/nightly-2023-09-05-x86_64-unknown-linux-gnu/bin/rustc'
ls /home/travis/.rustup/toolchains/nightly-2023-09-05-x86_64-unknown-linux-gnu/bin/*
/home/travis/.rustup/toolchains/nightly-2023-09-05-x86_64-unknown-linux-gnu/bin/rustc --version



if [[ $1 == *"apple"* ]]; then
exit 0
Expand All @@ -17,4 +12,4 @@ fi
MDBOOK_VERSION="mdbook-v0.2.1-${TARGET}"
curl -L "https://github.com/rust-lang-nursery/mdBook/releases/download/v0.2.1/$MDBOOK_VERSION.tar.gz" | tar -xvz
chmod +x ./mdbook
mv ./mdbook $HOME/bin/
mv ./mdbook $HOME/bin/
4 changes: 2 additions & 2 deletions vm/src/lazy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ fn force(
let lazy_lock = lazy.value.lock().unwrap();
match *lazy_lock {
Lazy_::Value(ref value) => {
vm.current_context().push(value.clone());
vm.current_context().push(value);
Pushed::default()
}
_ => unreachable!(),
Expand All @@ -176,7 +176,7 @@ fn force(
))
}
Lazy_::Value(ref value) => {
vm.current_context().push(value.clone());
vm.current_context().push(value);
Either::Left(future::ready(RuntimeResult::Return(Pushed::default())))
}
_ => unreachable!(),
Expand Down
24 changes: 12 additions & 12 deletions vm/src/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,18 +574,18 @@ impl<'de, 'gc> serde::de::DeserializeState<'de, crate::serialization::DeSeed<'gc

impl Drop for Thread {
fn drop(&mut self) {
// The child threads need to refer to `self` so drop the gc (and thus the child threads)
// first so that `self` is valid while dropping them
let context = self.context.get_mut().unwrap_or_else(|err| {
// Ignore poisoning since we don't need to interact with the Gc values, only
// drop them
err.into_inner()
});
let mut gc_to_drop =
::std::mem::replace(&mut context.gc, Gc::new(Generation::default(), 0));
// Make sure that the RefMut is dropped before the Gc itself as the RwLock is dropped
// Make sure that context reference is dropped before the Gc itself as the RwLock is dropped
// when the Gc is dropped
drop(context);
let mut gc_to_drop = {
// The child threads need to refer to `self` so drop the gc (and thus the child threads)
// first so that `self` is valid while dropping them
let context = self.context.get_mut().unwrap_or_else(|err| {
// Ignore poisoning since we don't need to interact with the Gc values, only
// drop them
err.into_inner()
});
::std::mem::replace(&mut context.gc, Gc::new(Generation::default(), 0))
};

// SAFETY GcPtr's may not leak outside of the `Thread` so we can safely clear it when
// droppting the thread
Expand Down Expand Up @@ -2574,7 +2574,7 @@ where
where
T: StackState,
{
let stack = self.stack.enter_scope_excess(args, state.clone(), excess)?;
let stack = self.stack.enter_scope_excess(args, state, excess)?;
self.hook.previous_instruction_index = usize::max_value();
Ok(ExecuteContext {
thread: self.thread,
Expand Down

0 comments on commit 86acf32

Please sign in to comment.