Skip to content

Fix undefined behaviour by removing MayebUninit usage #4

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

Merged
merged 22 commits into from
Sep 3, 2022
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
74 changes: 51 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,16 @@ jobs:
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true

- name: Check without default features
run: |
cargo check --all \
--no-default-features

- name: Check with the default features
run: |
cargo check --all
- name: Install power tools
uses: taiki-e/install-action@cargo-hack

- name: Check with all features
- name: Check the powerset
run: |
cargo check --all \
--all-features
cargo hack check --all \
--feature-powerset --keep-going

test:
name: Test Suite
Expand All @@ -62,11 +57,16 @@ jobs:
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true

- name: Install power tools
uses: taiki-e/install-action@cargo-hack

- name: Run the test-suite
- name: Run the test-suite powerset
run: |
cargo test --workspace --no-fail-fast
cargo hack test --workspace \
--no-fail-fast --feature-powerset --keep-going

fmt:
name: Rustfmt
Expand All @@ -80,6 +80,7 @@ jobs:
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
profile: minimal
components: rustfmt
override: true

Expand All @@ -102,22 +103,49 @@ jobs:
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
components: clippy
override: true

- name: Check the code style without default features
- name: Install power tools
uses: taiki-e/install-action@cargo-hack

- name: Check the code style powerset
run: |
cargo clippy --all \
--no-default-features \
cargo hack clippy --all \
--feature-powerset --keep-going \
-- -D warnings

- name: Check the code style with the default features
miri:
name: Miri
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
rust: [nightly]

steps:
- name: Checkout the Repository
uses: actions/checkout@v2

- name: Install the Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
components: miri, rust-src
override: true

- name: Install power tools
uses: taiki-e/install-action@cargo-hack

- name: Run the miri powerset tests
run: |
cargo clippy --all \
-- -D warnings
cargo hack miri test --workspace \
--no-fail-fast --feature-powerset --keep-going

- name: Check the code style with all features
- name: Run the miri trycrate powerset
run: |
cargo clippy --all \
--all-features \
-- -D warnings
cd try-crate
cargo hack miri run \
--feature-powerset --keep-going
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# const-type-layout   [![CI Status]][workflow] [![Rust Doc]][docs] [![License Status]][fossa] [![Code Coverage]][codecov] [![Gitpod Ready-to-Code]][gitpod]
# const-type-layout   [![CI Status]][workflow] [![MSRV]][repo] [![Rust Doc]][docs] [![License Status]][fossa] [![Code Coverage]][codecov] [![Gitpod Ready-to-Code]][gitpod]

[CI Status]: https://img.shields.io/github/workflow/status/MomoLangenstein/const-type-layout/CI/main?label=CI
[workflow]: https://github.com/MomoLangenstein/const-type-layout/actions/workflows/ci.yml?query=branch%3Amain

[MSRV]: https://img.shields.io/badge/MSRV-1.60.0-orange
[repo]: https://github.com/ron-rs/ron

[Rust Doc]: https://img.shields.io/badge/docs-main-blue
[docs]: https://momolangenstein.github.io/const-type-layout/const_type_layout

Expand Down Expand Up @@ -32,7 +35,7 @@ The layout of types is only defined if they're `#[repr(C)]`. This crate works on
non-`#[repr(C)]` types, but their layout is unpredictable.

```rust
use type_layout::TypeLayout;
use const_type_layout::TypeLayout;

#[derive(TypeLayout)]
#[repr(C)]
Expand Down Expand Up @@ -70,7 +73,7 @@ Over-aligned types have trailing padding, which can be a source of bugs in some
FFI scenarios:

```rust
use type_layout::TypeLayout;
use const_type_layout::TypeLayout;

#[derive(TypeLayout)]
#[repr(C, align(128))]
Expand Down
Loading