Skip to content

Commit

Permalink
Merge branch 'master' into macos-arm-runner-2
Browse files Browse the repository at this point in the history
  • Loading branch information
aarroyoc committed May 30, 2024
2 parents af796a5 + 2d18e0d commit b22d1b1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 35 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ jobs:
- { os: ubuntu-22.04, rust-version: stable, target: 'x86_64-unknown-linux-gnu', publish: true }
- { os: ubuntu-22.04, rust-version: stable, target: 'i686-unknown-linux-gnu', publish: true }
# FIXME(issue #2138): run wasm tests, failing to run since https://github.com/mthom/scryer-prolog/pull/2137 removed wasm-pack
- { os: ubuntu-22.04, rust-version: nightly, target: 'wasm32-unknown-unknown', publish: true, args: '--no-default-features' , test-args: '--no-run --no-default-features' }
- { os: ubuntu-22.04, rust-version: nightly, target: 'wasm32-unknown-unknown', publish: true, args: '--no-default-features' , test-args: '--no-run --no-default-features', use_swap: true }
# Cargo.toml rust-version
- { os: ubuntu-22.04, rust-version: "1.77", target: 'x86_64-unknown-linux-gnu'}
# rust versions
- { os: ubuntu-22.04, rust-version: beta, target: 'x86_64-unknown-linux-gnu'}
- { os: ubuntu-22.04, rust-version: nightly, target: 'x86_64-unknown-linux-gnu'}
Expand All @@ -55,6 +57,10 @@ jobs:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actionhippie/swap-space@v1
if: matrix.use_swap
with:
size: 10G
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
Expand Down
2 changes: 0 additions & 2 deletions src/machine/machine_indices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ use std::collections::BTreeSet;
use std::ops::{Deref, DerefMut};

use crate::types::*;
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub(crate) struct OrderedOpDirKey(pub(crate) Atom, pub(crate) Fixity);

// 7.2
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
Expand Down
13 changes: 6 additions & 7 deletions src/machine/streams.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use std::io;
#[cfg(feature = "http")]
use std::io::BufRead;
use std::io::{Cursor, ErrorKind, Read, Seek, SeekFrom, Write};
use std::mem;
use std::net::{Shutdown, TcpStream};
use std::ops::{Deref, DerefMut};
use std::path::PathBuf;
Expand Down Expand Up @@ -296,9 +295,9 @@ impl Read for HttpReadStream {
#[cfg(feature = "http")]
pub struct HttpWriteStream {
status_code: u16,
headers: mem::ManuallyDrop<hyper::HeaderMap>,
headers: std::mem::ManuallyDrop<hyper::HeaderMap>,
response: TypedArenaPtr<HttpResponse>,
buffer: mem::ManuallyDrop<Vec<u8>>,
buffer: std::mem::ManuallyDrop<Vec<u8>>,
}

#[cfg(feature = "http")]
Expand All @@ -325,8 +324,8 @@ impl Write for HttpWriteStream {
#[cfg(feature = "http")]
impl HttpWriteStream {
fn drop(&mut self) {
let headers = unsafe { mem::ManuallyDrop::take(&mut self.headers) };
let buffer = unsafe { mem::ManuallyDrop::take(&mut self.buffer) };
let headers = unsafe { std::mem::ManuallyDrop::take(&mut self.headers) };
let buffer = unsafe { std::mem::ManuallyDrop::take(&mut self.buffer) };

let (ready, response, cvar) = &**self.response;

Expand Down Expand Up @@ -1228,8 +1227,8 @@ impl Stream {
StreamLayout::new(CharReader::new(HttpWriteStream {
response,
status_code,
headers: mem::ManuallyDrop::new(headers),
buffer: mem::ManuallyDrop::new(Vec::new()),
headers: std::mem::ManuallyDrop::new(headers),
buffer: std::mem::ManuallyDrop::new(Vec::new()),
})),
arena
))
Expand Down
24 changes: 0 additions & 24 deletions src/machine/unify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,30 +453,6 @@ pub(crate) trait Unifier: DerefMut<Target = MachineState> {
}
}

fn unify_big_num<N>(&mut self, n1: TypedArenaPtr<N>, value: HeapCellValue)
where
N: PartialEq<Rational> + PartialEq<Integer> + PartialEq<i64> + ArenaAllocated,
{
if let Some(r) = value.as_var() {
Self::bind(self, r, typed_arena_ptr_as_cell!(n1));
return;
}

match Number::try_from(value) {
Ok(n2) => match n2 {
Number::Fixnum(n2) if *n1 == n2.get_num() => {}
Number::Integer(n2) if *n1 == *n2 => {}
Number::Rational(n2) if *n1 == *n2 => {}
_ => {
self.fail = true;
}
},
Err(_) => {
self.fail = true;
}
}
}

fn unify_big_integer(&mut self, n1: TypedArenaPtr<Integer>, value: HeapCellValue) {
if let Some(r) = value.as_var() {
Self::bind(self, r, typed_arena_ptr_as_cell!(n1));
Expand Down
2 changes: 1 addition & 1 deletion src/parser/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub(crate) fn as_partial_string(
tail_ref = succ;
}
Term::PartialString(_, pstr, tail) => {
string += &pstr;
string += pstr;
tail_ref = tail;
}
Term::CompleteString(_, cstr) => {
Expand Down

0 comments on commit b22d1b1

Please sign in to comment.