Skip to content

Commit

Permalink
Merge pull request #56 from safinaskar/addr_of
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor authored Jun 25, 2024
2 parents 7819c5b + 13c909f commit 875b40e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
version:
- 1.56.0 # MSRV
- 1.63.0 # MSRV
- stable
- beta
- nightly
Expand All @@ -29,7 +29,7 @@ jobs:
run: TOOLCHAIN=${{ matrix.version }} TARGET=${{ matrix.target }} sh ./ci/install-rust.sh

- name: Check MSRV
if: matrix.version == '1.56.0'
if: matrix.version == '1.63.0'
run: cargo check

# FIXME: Some symbols cause multiple definitions error on the same line:
Expand All @@ -38,9 +38,9 @@ jobs:
# /home/runner/work/ctest2/ctest2/target/debug/deps/libtestcrate-a072d428f9532abb.rlib(t1.o):
# /home/runner/work/ctest2/ctest2/testcrate/src/t1.h:65: first defined here
# - name: Run tests
# if: matrix.version != '1.56.0'
# if: matrix.version != '1.63.0'
# run: cargo test --all -- --nocapture

- name: Run libc tests
if: matrix.version != '1.56.0'
if: matrix.version != '1.63.0'
run: sh ./ci/run-docker.sh ${{ matrix.target }}
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Automated tests of FFI bindings.
"""
include = ["src/lib.rs", "LICENSE-*", "README.md"]
edition = "2021"
rust-version = "1.56.0"
rust-version = "1.63.0"

[dependencies]
garando_syntax = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ APIs in Rust match the APIs defined in C.

## MSRV (Minimum Supported Rust Version)

The MSRV is 1.56.0 because of the transitive dependencies.
The MSRV is 1.63.0 because of the transitive dependencies.
Note that MSRV may be changed anytime by dependencies.

## Example
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/x86_64-unknown-linux-gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:23.10
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
gcc libc6-dev ca-certificates linux-headers-generic git
Expand Down
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1716,7 +1716,8 @@ impl<'a> Generator<'a> {
fn __test_static_{name}() -> {ty};
}}
unsafe {{
same(*(&{name} as *const _ as *const {ty}) as usize,
// We must use addr_of! here because of https://github.com/rust-lang/rust/issues/114447
same(*(std::ptr::addr_of!({name}) as *const {ty}) as usize,
__test_static_{name}() as usize,
"{name} static");
}}
Expand Down Expand Up @@ -1760,7 +1761,8 @@ impl<'a> Generator<'a> {
fn __test_static_{name}() -> *{mutbl} {ty};
}}
unsafe {{
same(&{name} as *const _ as usize,
// We must use addr_of! here because of https://github.com/rust-lang/rust/issues/114447
same(std::ptr::addr_of!({name}) as usize,
__test_static_{name}() as usize,
"{name} static");
}}
Expand Down Expand Up @@ -1804,7 +1806,8 @@ impl<'a> Generator<'a> {
fn __test_static_{name}() -> *{mutbl} {ty};
}}
unsafe {{
same(&{name} as *const _ as usize,
// We must use addr_of! here because of https://github.com/rust-lang/rust/issues/114447
same(std::ptr::addr_of!({name}) as usize,
__test_static_{name}() as usize,
"{name} static");
}}
Expand Down

0 comments on commit 875b40e

Please sign in to comment.