From 7329cdeed11bc703ff55e3a733e455c7e104db21 Mon Sep 17 00:00:00 2001 From: Alex Huszagh Date: Wed, 1 Jul 2026 17:00:07 -0500 Subject: [PATCH] Migrate from Travis CI to Github actions. --- .github/ISSUE_TEMPLATE/bug_report.md | 33 +++++++++++++++++++ .github/ISSUE_TEMPLATE/custom.md | 22 +++++++++++++ .github/ISSUE_TEMPLATE/documentation.md | 20 +++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 24 ++++++++++++++ .github/ISSUE_TEMPLATE/question.md | 12 +++++++ .github/PULL_REQUEST_TEMPLATE/bug_fix.md | 27 +++++++++++++++ .github/PULL_REQUEST_TEMPLATE/custom.md | 23 +++++++++++++ .../PULL_REQUEST_TEMPLATE/documentation.md | 23 +++++++++++++ .github/workflows/miri.yml | 23 +++++++++++++ .github/workflows/test.yml | 31 +++++++++++++++++ .travis.yml | 18 ---------- Cargo.toml | 3 -- src/lib.rs | 6 ++-- 13 files changed, 242 insertions(+), 23 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/custom.md create mode 100644 .github/ISSUE_TEMPLATE/documentation.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/question.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/bug_fix.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/custom.md create mode 100644 .github/PULL_REQUEST_TEMPLATE/documentation.md create mode 100644 .github/workflows/miri.yml create mode 100644 .github/workflows/test.yml delete mode 100644 .travis.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..fe59b47 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,33 @@ +--- +name: Bug report +about: Create a report to help us improve. +title: "[BUG]" +labels: bug +assignees: Alexhuszagh + +--- + +## Description + +Please include a clear and concise description of the bug. If the bug includes a security vulnerability, please privately report the issue to the [maintainer](mailto:ahuszagh@gmail.com). + +## Test case + +Please provide a short, complete (with crate import, etc) test case for +the issue, showing clearly the expected and obtained results. + +Example test case: + +```rust +use stackvector::StackVec; + +fn main() { + let buf = [1, 2, 3, 4, 5]; + let stack_vec: StackVec = StackVec::from_buf(buf); + assert_eq!(&*stack_vec, &[1, 2, 3, 4, 5]); +} +``` + +## Additional Context + +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md new file mode 100644 index 0000000..2a7b3a5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/custom.md @@ -0,0 +1,22 @@ +--- +name: Custom issue template +about: Issue template for miscellaneous issues. +title: "[OTHER]" +labels: '' +assignees: Alexhuszagh + +--- + +## Prerequisites + +If applicable to the issue, here are a few things you should provide to help me understand the issue: + +- Rust version: `rustc -V` + +## Description + +Please include a clear and concise description of the issue. + +## Additional Context + +Add any other context or screenshots about the issue here. diff --git a/.github/ISSUE_TEMPLATE/documentation.md b/.github/ISSUE_TEMPLATE/documentation.md new file mode 100644 index 0000000..7452e5c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation.md @@ -0,0 +1,20 @@ +--- +name: Documentation +about: Request changes to the project's documentation. +title: "[DOC]" +labels: documentation +assignees: Alexhuszagh + +--- + +## Description + +Please include a clear and concise description of the issue. + +Ex: Code sample for `StackVec::from_buf` in the documentation no longer works. +Ex: Documentation for `StackVec::insert_many` contains a typo. +Ex: Documentation for `StackVec::push` does not mention panic conditions. + +## Additional Context + +Add any other context or screenshots about the issue here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..3697fc2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,24 @@ +--- +name: Feature request +about: Suggest an idea for this project. +title: "[FEATURE]" +labels: enhancement +assignees: Alexhuszagh + +--- + +## Problem + +A clear and concise description of what the problem is. Ex. lexical does not parse standard-conforming JSON numbers. + +## Solution + +A clear and concise description of what you want to happen. + +## Alternatives + +A clear and concise description of any alternative solutions or features you've considered. + +## Additional Context + +Add any other context or screenshots about the feature request here. diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 0000000..75d9bb3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,12 @@ +--- +name: Question +about: Have a question how to use stackvector? +title: "[QUESTION]" +labels: question +assignees: Alexhuszagh + +--- + +## Question + +A clear and concise description of what the question is. diff --git a/.github/PULL_REQUEST_TEMPLATE/bug_fix.md b/.github/PULL_REQUEST_TEMPLATE/bug_fix.md new file mode 100644 index 0000000..96e43fd --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/bug_fix.md @@ -0,0 +1,27 @@ +--- +name: Bug fix +about: Fix a bug in stackvector. +title: "[BUG]" +labels: bug +assignees: Alexhuszagh + +--- + +**NOTE:** + +- If you have made non-trivial changes to the code, please make sure to run unittests prior to committing. +- Please run `cargo fmt` on nightly prior to committing. + +## Optional Debugging Information + +If applicable to the issue, here are a few things you should provide to help me understand the issue: + +- Rust version: `rustc -V` + +## Description + +Please include a clear and concise description of the changes made. + +## Additional Context + +Add any other context or screenshots about the bug fix here. diff --git a/.github/PULL_REQUEST_TEMPLATE/custom.md b/.github/PULL_REQUEST_TEMPLATE/custom.md new file mode 100644 index 0000000..581b766 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/custom.md @@ -0,0 +1,23 @@ +--- +name: Custom pull request template +about: Pull request template for miscellaneous changes. +title: "[OTHER]" +labels: '' +assignees: Alexhuszagh + +--- + +**NOTE:** + +- If you have made non-trivial changes to the code, please make sure to run unittests prior to committing. +- Please run `cargo fmt` on nightly prior to committing. + +## Optional Debugging Information + +If applicable to the issue, here are a few things you should provide to help me understand the issue: + +- Rust version: `rustc -V` + +## Description + +Please include a clear and concise description of the changes. diff --git a/.github/PULL_REQUEST_TEMPLATE/documentation.md b/.github/PULL_REQUEST_TEMPLATE/documentation.md new file mode 100644 index 0000000..17fe39f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/documentation.md @@ -0,0 +1,23 @@ +--- +name: Documentation +about: Update the project's documentation. +title: "[DOC]" +labels: documentation +assignees: Alexhuszagh + +--- + +**NOTE:** +- If you have made any changes to doc comments, please run `cargo fmt` and `cargo clippy` on nightly prior to committing. + +## Description + +Please include a clear and concise description of fixes made to the documentation. + +Ex: Fixed a backtick leading to improper formatting in README. +Ex: Fixed code sample for `StackVec::insert_many` in README. +Ex: Updated outdated doc comments in `StackVec::push`. + +## Additional Context + +Add any other context or screenshots about the issue here. diff --git a/.github/workflows/miri.yml b/.github/workflows/miri.yml new file mode 100644 index 0000000..476027a --- /dev/null +++ b/.github/workflows/miri.yml @@ -0,0 +1,23 @@ +name: Miri + +on: + [pull_request, workflow_dispatch] + +jobs: + build: + name: Miri Test + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + features: ['', std] + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: nightly + components: miri + - run: cargo +nightly check --no-default-features --features=${{matrix.features}} + - run: cargo +nightly build --no-default-features --features=${{matrix.features}} + - run: cargo +nightly test --no-default-features --features=${{matrix.features}} + - run: cargo +nightly miri test --no-default-features --features=${{matrix.features}} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..f203a52 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +name: Test + +on: + [pull_request, workflow_dispatch] + +jobs: + test: + name: Rust ${{matrix.rust}} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + rust: [1.60.0, stable, beta, nightly] + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{matrix.rust}} + - run: cargo check + - run: cargo build + - run: cargo test + + test-no-std: + name: Rust ${{matrix.rust}} ${{matrix.features}} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - run: cargo check --no-default-features + - run: cargo build --no-default-features + - run: cargo test --no-default-features diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 57ece6d..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: rust -rust: - - 1.36.0 - - nightly - - beta - - stable - -# Bugs in issue 5 on nightly and beta on Travis, not reproducing on a local -# machine. -matrix: - allow_failures: - - rust: nightly - - rust: beta - -script: | - cargo build && - cargo test && - ([ $TRAVIS_RUST_VERSION != nightly ] || cargo check --no-default-features) diff --git a/Cargo.toml b/Cargo.toml index d932d2a..85c3aea 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,9 +12,6 @@ readme = "README.md" repository = "https://github.com/Alexhuszagh/rust-stackvector" version = "1.2.0" -[badges] -travis-ci = { repository = "Alexhuszagh/rust-stackvector" } - [features] default = ["std"] # Use the `std` library. Required for `io` support. diff --git a/src/lib.rs b/src/lib.rs index 78520b8..71e94d4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -251,7 +251,9 @@ impl StackVec { pub fn new() -> StackVec { StackVec { length: 0, - data: [const { mem::MaybeUninit::uninit() }; N], + // FIXME: migrate to inline const when we drop support for rustc <= 1.79 + // [const { mem::MaybeUninit::uninit() }; N] + data: unsafe { mem::MaybeUninit::uninit().assume_init() }, } } @@ -349,7 +351,7 @@ impl StackVec { let mut local_len = SetLenOnDrop::new(&mut v.length); for (index, item) in buf.into_iter().take(len).enumerate() { v.data[index].write(item); - unsafe { local_len.increment_len(1) }; + local_len.increment_len(1); } }