rust-lang / rust-lang/rust-bindgen

support having `rust_target` track rust-toolchain.toml

Open
#3,049 9 comments 1 reaction 1 assignee View on GitHub

@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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.