From 8e639190a3a49c408f2c7be6de4d16c9f8fa3074 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 7 Jul 2026 07:40:31 +1000 Subject: [PATCH 1/4] Add setup to README, note it's experimental --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 42ce5f4..699dd26 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,14 @@ # Rust Function Overloading Macros -This repository contains macros and other code for function overloading in Rust. +This repository contains *experimental* macros and other code for function overloading in Rust. Some of this code requires a recent nightly Rust compiler. + +## Quick Setup + +```sh +rustup update nightly +cd overloading-macros +rustup override set nightly +cargo build +``` From a0d56ad7d36082b40542886568081ae7a9ef22af Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 7 Jul 2026 07:41:08 +1000 Subject: [PATCH 2/4] Add workspace and stub Rust crate --- Cargo.lock | 16 ++++++++++++++++ Cargo.toml | 30 ++++++++++++++++++++++++++++++ splat-overload/Cargo.toml | 16 ++++++++++++++++ splat-overload/src/lib.rs | 1 + 4 files changed, 63 insertions(+) create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 splat-overload/Cargo.toml create mode 100644 splat-overload/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..ba697e0 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,16 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "example" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6a23e249717cd6d24a8f3fcd9639403948df1227fe303a106396597a68277e" + +[[package]] +name = "splat-overload" +version = "0.0.0" +dependencies = [ + "example", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..b9804b5 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,30 @@ +[workspace] +resolver = "3" +members = [ + "splat-overload", +] +default-members = [ + "splat-overload", +] + +[workspace.package] +version = "0.0.0" +authors = [ + "teor Date: Tue, 7 Jul 2026 07:51:26 +1000 Subject: [PATCH 3/4] Add CI based on interop-initiative --- .github/workflows/check.yml | 90 +++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 .github/workflows/check.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..b0b1287 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,90 @@ +# This workflow checks each crate builds and runs, and for lints. +name: Check + +# Runs this workflow +on: + # On all pull requests, regardless of target branch + pull_request: + # On PRs in the merge queue + merge_group: + # After merges to main + push: + branches: + - main + # When a developer asks for a manual workflow run + workflow_dispatch: + +jobs: + build-rust: + name: 1. Build Rust crates + runs-on: ubuntu-latest + # Actions are pinned to a commit to prevent supply-chain attacks + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Build each Rust crate + run: cargo build --workspace --all-targets --all-features + + test-rust: + name: 2. Test Rust crates + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Test each Rust crate + run: cargo test --workspace --all-targets --all-features + + run: + name: 3. Run default Rust crate + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Run default Rust crate + run: # cargo run --all-features --bin-name TODO + + clippy-rust: + name: 4. Clippy lints on Rust crates + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Run clippy on Rust crates + run: cargo clippy --workspace --all-targets --all-features -- --deny warnings + + doc-rust: + name: 5. Doc lints on Rust crates + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Run doc checks on Rust crates + run: cargo doc --workspace --all-features + + fmt-rust: + name: 6. Code format on Rust crates + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Run rustfmt checks on crates + run: cargo fmt --all -- --check + + all: + name: All checks + # Always run this job, even if earlier steps were skipped (or failed): + # + if: ${{ always() }} + runs-on: ubuntu-latest + needs: + - build-rust + - test-rust + - run + - clippy-rust + - doc-rust + - fmt-rust + steps: + - name: Fail if any other job failed + # Every job status needs to be checked here, because `always()` stops failures from propagating automatically + run: | + echo "Checking other jobs..." + [[ "${{ needs.build-rust.result }}" == "success" ]] || exit 1 + [[ "${{ needs.test-rust.result }}" == "success" ]] || exit 1 + [[ "${{ needs.run.result }}" == "success" ]] || exit 1 + [[ "${{ needs.clippy-rust.result }}" == "success" ]] || exit 1 + [[ "${{ needs.doc-rust.result }}" == "success" ]] || exit 1 + [[ "${{ needs.fmt-rust.result }}" == "success" ]] || exit 1 From 5cd3aa794f4b2a2af04c885a9925d29d34c77d15 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 7 Jul 2026 07:58:52 +1000 Subject: [PATCH 4/4] Use nightly Rust in CI --- .github/workflows/check.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b0b1287..3163d9b 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -21,6 +21,11 @@ jobs: # Actions are pinned to a commit to prevent supply-chain attacks steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0 + with: + toolchain: nightly + # Use the same components in every step for caching + components: cargo,clippy,rustfmt - name: Build each Rust crate run: cargo build --workspace --all-targets --all-features @@ -29,6 +34,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0 + with: + toolchain: nightly + components: cargo,clippy,rustfmt - name: Test each Rust crate run: cargo test --workspace --all-targets --all-features @@ -37,6 +46,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0 + with: + toolchain: nightly + components: cargo,clippy,rustfmt - name: Run default Rust crate run: # cargo run --all-features --bin-name TODO @@ -45,6 +58,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0 + with: + toolchain: nightly + components: cargo,clippy,rustfmt - name: Run clippy on Rust crates run: cargo clippy --workspace --all-targets --all-features -- --deny warnings @@ -53,6 +70,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0 + with: + toolchain: nightly + components: cargo,clippy,rustfmt - name: Run doc checks on Rust crates run: cargo doc --workspace --all-features @@ -61,6 +82,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659 # v1.17.0 + with: + toolchain: nightly + components: cargo,clippy,rustfmt - name: Run rustfmt checks on crates run: cargo fmt --all -- --check