Skip to content

Commit adb9dba

Browse files
authored
Merge pull request JohnTitor/ctest2#56 from safinaskar/addr_of
2 parents fefeba2 + 6f55e5c commit adb9dba

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

ctest/.github/workflows/linux.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
version:
15-
- 1.56.0 # MSRV
15+
- 1.63.0 # MSRV
1616
- stable
1717
- beta
1818
- nightly
@@ -29,7 +29,7 @@ jobs:
2929
run: TOOLCHAIN=${{ matrix.version }} TARGET=${{ matrix.target }} sh ./ci/install-rust.sh
3030

3131
- name: Check MSRV
32-
if: matrix.version == '1.56.0'
32+
if: matrix.version == '1.63.0'
3333
run: cargo check
3434

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

4444
- name: Run libc tests
45-
if: matrix.version != '1.56.0'
45+
if: matrix.version != '1.63.0'
4646
run: sh ./ci/run-docker.sh ${{ matrix.target }}

ctest/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Automated tests of FFI bindings.
1111
"""
1212
include = ["src/lib.rs", "LICENSE-*", "README.md"]
1313
edition = "2021"
14-
rust-version = "1.56.0"
14+
rust-version = "1.63.0"
1515

1616
[dependencies]
1717
garando_syntax = "0.1"

ctest/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ APIs in Rust match the APIs defined in C.
1414

1515
## MSRV (Minimum Supported Rust Version)
1616

17-
The MSRV is 1.56.0 because of the transitive dependencies.
17+
The MSRV is 1.63.0 because of the transitive dependencies.
1818
Note that MSRV may be changed anytime by dependencies.
1919

2020
## Example

ctest/ci/docker/x86_64-unknown-linux-gnu/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:22.04
1+
FROM ubuntu:23.10
22
RUN apt-get update
33
RUN apt-get install -y --no-install-recommends \
44
gcc libc6-dev ca-certificates linux-headers-generic git

ctest/src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,8 @@ impl<'a> Generator<'a> {
17161716
fn __test_static_{name}() -> {ty};
17171717
}}
17181718
unsafe {{
1719-
same(*(&{name} as *const _ as *const {ty}) as usize,
1719+
// We must use addr_of! here because of https://github.com/rust-lang/rust/issues/114447
1720+
same(*(std::ptr::addr_of!({name}) as *const {ty}) as usize,
17201721
__test_static_{name}() as usize,
17211722
"{name} static");
17221723
}}
@@ -1760,7 +1761,8 @@ impl<'a> Generator<'a> {
17601761
fn __test_static_{name}() -> *{mutbl} {ty};
17611762
}}
17621763
unsafe {{
1763-
same(&{name} as *const _ as usize,
1764+
// We must use addr_of! here because of https://github.com/rust-lang/rust/issues/114447
1765+
same(std::ptr::addr_of!({name}) as usize,
17641766
__test_static_{name}() as usize,
17651767
"{name} static");
17661768
}}
@@ -1804,7 +1806,8 @@ impl<'a> Generator<'a> {
18041806
fn __test_static_{name}() -> *{mutbl} {ty};
18051807
}}
18061808
unsafe {{
1807-
same(&{name} as *const _ as usize,
1809+
// We must use addr_of! here because of https://github.com/rust-lang/rust/issues/114447
1810+
same(std::ptr::addr_of!({name}) as usize,
18081811
__test_static_{name}() as usize,
18091812
"{name} static");
18101813
}}

0 commit comments

Comments
 (0)