oxidize-rb / rb-sys

Easily build Ruby native extensions in Rust
https://oxidize-rb.github.io/rb-sys/
Apache License 2.0
230 stars 35 forks source link

Silence new unexpected_cfgs lint #404

Closed matsadler closed 3 months ago

matsadler commented 3 months ago

Rust 1.80 got a new lint to warn on unexpected cfg, which generates a lot of noise building both Magnus and rb-sys.

To make cfg expected we either need to output cargo::rustc-check-cfg=cfg(name) from build.rs or add:

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(name)'] }

to Cargo.toml.

Both cargo::rustc-check-cfg and cargo:rustc-check-cfg (two or one colons) are accepted. :: is the 'correct' syntax as of Rust 1.77, but will error on some earlier versions. The : syntax is accepted (with warnings on some older versions) with both old and new versions, so these changes use :.

ianks commented 3 months ago

Thank you, Mat! The failures seem to be unrelated so I'll merge and cut a release next week