From aebec895731dc542c6c4b6e5baa3da85018a0e6b Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 29 Sep 2026 12:41:59 +0200 Subject: [PATCH 1/5] Add markdown lints to CI --- .github/workflows/check.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 579448d..b1b0777 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -230,6 +230,29 @@ jobs: diff --unified=5 "cpp-overload-test/examples/$test_name.stderr" /tmp/"$test_name.stderr" done + markdown-lint: + name: 11. Lint Markdown files + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Run markdownlint-cli + uses: nosborn/github-action-markdown-cli@508d6cefd8f0cc99eab5d2d4685b1d5f470042c1 # v3.5.0 + with: + files: "**.md" + + markdown-style: + name: 12. Check Markdown style + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Run prettier on Markdown files + uses: creyD/prettier_action@8c18391fdc98ed0d884c6345f03975edac71b8f0 # v4.6 + with: + dry: true + prettier_options: "--check **/*.md" + all: name: All checks # Always run this job, even if earlier steps were skipped (or failed): @@ -247,6 +270,8 @@ jobs: - diagnostics-rust - cpp-overload-test-ok - cpp-overload-test-fail + - markdown-lint + - markdown-style steps: - name: Fail if any other job failed # Every job status needs to be checked here, because `always()` stops failures from propagating automatically @@ -262,3 +287,5 @@ jobs: [[ "${{ needs.diagnostics-rust.result }}" == "success" ]] || exit 1 [[ "${{ needs.cpp-overload-test-ok.result }}" == "success" ]] || exit 1 [[ "${{ needs.cpp-overload-test-fail.result }}" == "success" ]] || exit 1 + [[ "${{ needs.markdown-lint.result }}" == "success" ]] || exit 1 + [[ "${{ needs.markdown-style.result }}" == "success" ]] || exit 1 From 202d2792fcdcde0a6bd4e0a89936839842cb7f65 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 29 Sep 2026 12:52:42 +0200 Subject: [PATCH 2/5] Increase md line lengths, allow br --- .markdownlint.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .markdownlint.yaml diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..354710d --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,17 @@ +# MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md013.md +MD013: + # Number of characters + line_length: 100 + # Number of characters for headings + heading_line_length: 100 + # Number of characters for code blocks + code_block_line_length: 100 + +# MD033/no-inline-html : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.41.1/doc/md033.md +MD033: + # Allowed elements + allowed_elements: [ + "br", + ] + # Allowed elements in tables + table_allowed_elements: [] From 63f9e5dc8e31d4a949573e512b2c834ff929e675 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 29 Sep 2026 12:53:05 +0200 Subject: [PATCH 3/5] Wrap md and remove trailing spaces --- CONTRIBUTING.md | 18 +++++++++--------- README.md | 23 +++++++++++++++++------ cpp-overload-test/README.md | 3 ++- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9fdd7ec..d96e31c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,33 +1,33 @@ # Contributing to a Rust Foundation Project -Thank you for your interest in contributing to this Rust Foundation project. +Thank you for your interest in contributing to this Rust Foundation project. We are happy and excited to review and accept your pull requests. ## Before You Begin Contributing ### Licenses -There is no Contributor License Agreement to sign to contribute this project. -Your contribution will be covered by the license(s) granted for this -repository, commonly MIT, Apache, and/or CC-BY, but could be a different -license. In other words, your contribution will be licensed to the Foundation -and all downstream users under those licenses. You can read more in the +There is no Contributor License Agreement to sign to contribute this project. +Your contribution will be covered by the license(s) granted for this +repository, commonly MIT, Apache, and/or CC-BY, but could be a different +license. In other words, your contribution will be licensed to the Foundation +and all downstream users under those licenses. You can read more in the Foundation's [intellectual property policy][ip-policy]. ### Code of Conduct -Please review and adhere to the [code of conduct](CODE_OF_CONDUCT.md) before +Please review and adhere to the [code of conduct](CODE_OF_CONDUCT.md) before contributing any pull requests. ## Contribution Process All submissions, including submissions by project members, require review. We -use GitHub pull requests for this purpose. Consult [GitHub Help][pull-requests] +use GitHub pull requests for this purpose. Consult [GitHub Help][pull-requests] for more information on using pull requests. ### Issues -Do you just want to file an issue for the project? Please do so in GitHub under +Do you just want to file an issue for the project? Please do so in GitHub under the `Issues` tab. [ip-policy]: https://foundation.rust-lang.org/policies/intellectual-property-policy/ diff --git a/README.md b/README.md index 1424692..10e2b6f 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,27 @@ # Rust Function Overloading Macros -This repository is a [Rust Foundation *experiment*](https://rustfoundation.org/media/experimenting-with-function-overloading-in-rust-why-it-matters/) in ergonomic function overloading in Rust. +This repository is a [Rust Foundation *experiment*][experiment-blog] in ergonomic function +overloading in Rust. -The experiment uses macros to improve the ergonomics of the [`splat` Rust language experiment](https://github.com/rust-lang/rust/issues/153629). -Technical details for the current stage of the experiment can be found [on the Inside Rust blog](https://blog.rust-lang.org/inside-rust/2026/08/19/overloading-experiment/). +The experiment uses macros to improve the ergonomics of the +[`splat` Rust language experiment][splat-tracking]. Technical details for the current stage of the +experiment can be found [on the Inside Rust blog][technical-blog]. Most of this code requires a recent nightly Rust compiler. +[experiment-blog]: https://rustfoundation.org/media/experimenting-with-function-overloading-in-rust-why-it-matters/ +[splat-tracking]: https://github.com/rust-lang/rust/issues/153629 +[technical-blog]: https://blog.rust-lang.org/inside-rust/2026/08/19/overloading-experiment/ + ## Experimental Outcomes -Some outcomes of this experiment are summarised in the [C++ overloads in Rust](https://github.com/rustfoundation/overloading-macros/blob/main/cpp-overloads-in-rust.md) document & compatibility table. +Some outcomes of this experiment are summarised in the [C++ overloads in Rust][cpp-overloads-rust] +document & compatibility table. + +These outcomes are based on the current state of the experimental compiler feature and overloading +macro: they are not Rust language design decisions. -These outcomes are based on the current state of the experimental compiler feature and overloading macro: they are not Rust language design decisions. +[cpp-overloads-rust]: https://github.com/rustfoundation/overloading-macros/blob/main/cpp-overloads-in-rust.md ## Macro Setup @@ -22,7 +32,8 @@ Add this `overloading-macros` crate as a dependency. rustup update nightly cd your-project-name rustup override set nightly -cargo add overloading-macros || cargo add --git https://github.com/rustfoundation/overloading-macros overloading-macros +cargo add overloading-macros || \ + cargo add --git https://github.com/rustfoundation/overloading-macros overloading-macros ``` Then use the macro to add overloading to your functions or methods. diff --git a/cpp-overload-test/README.md b/cpp-overload-test/README.md index 0cc6f33..f16adf8 100644 --- a/cpp-overload-test/README.md +++ b/cpp-overload-test/README.md @@ -1,7 +1,8 @@ This code is automatically run in CI: - Submodules of `lib.rs` are expected to succeed. They are named after each C++ class. -- Examples are expected to fail, with output in the corresponding `.stderr` file, also named after C++ classes. +- Examples are expected to fail, with output in the corresponding `.stderr` file, also named after + C++ classes. Sometimes the C++ code extracted by `cpp_build` will become outdated, and you will get errors like: From ea355b15481db68803d1ebc041735814e3d4217c Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 29 Sep 2026 13:03:17 +0200 Subject: [PATCH 4/5] Pin prettier to 3.9.6 --- .github/workflows/check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b1b0777..31bdccd 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -252,6 +252,7 @@ jobs: with: dry: true prettier_options: "--check **/*.md" + prettier_version: "3.9.6" # The version available on macOS homebrew all: name: All checks From b4841ea2d4819f60e79e025e4ec182ed9e528e51 Mon Sep 17 00:00:00 2001 From: teor Date: Tue, 29 Sep 2026 13:08:27 +0200 Subject: [PATCH 5/5] Inline prettier npx call --- .github/workflows/check.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 31bdccd..fcfd73c 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -248,11 +248,8 @@ jobs: steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Run prettier on Markdown files - uses: creyD/prettier_action@8c18391fdc98ed0d884c6345f03975edac71b8f0 # v4.6 - with: - dry: true - prettier_options: "--check **/*.md" - prettier_version: "3.9.6" # The version available on macOS homebrew + # The version available on macOS homebrew + run: npx --yes prettier@3.9.6 --check **/*.md all: name: All checks