Skip to content

Commit 3a2a1d1

Browse files
authored
Remove unecessary unsafe, remove generated file in extra_snippets. (RustPython#4998)
1 parent 531f4ba commit 3a2a1d1

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

extra_tests/snippets/stdlib_os.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
assert os.read(src_fd, src_len) == os.read(dest_fd, bytes_sent)
3333
os.close(src_fd)
3434
os.close(dest_fd)
35+
os.remove('destination.md')
3536

3637
try:
3738
os.open('DOES_NOT_EXIST', 0)

vm/src/stdlib/thread.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,8 @@ pub(crate) mod _thread {
233233
}
234234
let new_mut = RawRMutex::INIT;
235235

236-
unsafe {
237-
let old_mutex: AtomicCell<&RawRMutex> = AtomicCell::new(&self.mu);
238-
old_mutex.swap(&new_mut);
239-
}
236+
let old_mutex: AtomicCell<&RawRMutex> = AtomicCell::new(&self.mu);
237+
old_mutex.swap(&new_mut);
240238

241239
Ok(())
242240
}

0 commit comments

Comments
 (0)