Cargo failing at gitignore-d files while publishing

Finally managed to find a workaround for the Rust problem I was having with cargo publish picking up files from my gitignore-d .direnv directory and complaining about them being uncommitted. This was the result of cascading surprises: setting package.includes causes gitignore to no longer be considered, and "README.md" in package.includes actually works like "**/README.md"’ and picks up the READMEs from the repositories in .direnv/flake-inputs/. Upstream issue: https://github.com/rust-lang/cargo/issues/12294#issuecomment-2171044946

September 14, 2025 · 1 min

Rudimentary type-safety in Rust macro_rules macros

Although Rust’s macro_rules macros operates on syntax trees and thus cannot propagate types, there are ways to make the compiler do it for you. One such trick is to insert a function call that expects only the specific type you want, which then fails for the other types that are not expected by the macro. Picked up from StackOverflow: https://stackoverflow.com/a/34214916

June 30, 2025 · 1 min