rust-lang / rust-lang/rust-bindgen
support having `rust_target` track rust-toolchain.toml
@pvdrz is already working on this.
Since Dec 10, 2024.
- Dominant language
- Rust
- Stars
- 5.3k
- Forks
- 829
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 15
Description
I recently ran into an issue on a repo that has rustc pinned to 1.81 with a rust-toolchain.toml file because of a regression in 1.82.
bindgen on that repo was generating bindings for 1.83, which included output that 1.81 doesn’t understand.
Adding rust_target(RustTarget::stable(81, 0)) was easy enough once I discovered it, but once 1.85 (which fixes the regression) is stable, we’ll update rust-toolchain.toml to point at that release, at which point we’ll have to update build.rs with rust_target(RustTarget::stable(85, 0)).
It would be great if there were something like RustTarget::toolchain_toml() to indicate that it should extract the target version from that file. It feels like that should maybe even be the default (if such a file exists), but I’m happy either way.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.