-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rust: regarding "avoid using extern crate" #13753
Comments
What rust standard (edition) are you using? Rust has the opposite approach of most C compilers, if you don't set a standard/edition you get the oldest one, unlike C where you get the newest one. IIRC this got changed in a later edition, so adding |
If that does I'll send a PR to update the documentation |
Thanks for the prompt reply. Honestly, I have no idea what I'm doing (mainly just seeing feasibility of porting large C project to rust over time), however, my rust should be fairly modern giving I'm running arch linux. That said, it does seem like the fixes you mention ( |
Changing the default would have to be a Meson 2.0 thing, because that would be a user visible change (and would be different than what Cargo does). We should update the documentation though, since that clearly matters |
Thanks for the update! On my system |
Right, but that's like |
Describe the bug
The meson documentation at https://mesonbuild.com/Rust.html says to Avoid using
extern crate
with Rust, and that:I would like clarification on this last point as I have not been able to get a trivial example to work without the
extern crate
statement.To Reproduce
Full code to reproduce is at crate-fail.tar.gz (it will succeed by default as it has
extern crate
).Files are below:
meson.build
main.rs
subprojects/colour-rs.wrap
The dependency is clearly defined in meson where the executable depends on the
colour-rs
subproject wrap, that is compiled from Rust. However, despite the documentation clearly statingextern crate
is bad, without the statement, it does not seem to compile and fails with the following error:Expected behavior
I would expect it to either compile without the
extern crate
or for the documentation to mentionextern crate
being necessary.system parameters
The text was updated successfully, but these errors were encountered: