Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace references of static externs to addr_of!. We need to do this … #56

Merged
merged 3 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading