Closed skwerlman closed 5 days ago
Does this also happen on beta? Warnings/lints are always a bit in flux.
it doesn't happen on beta, just nightly
Hmm, looking at https://github.com/rust-lang/rfcs/blob/master/text/3373-avoid-nonlocal-definitions-in-fns.md, this might require us to adjust how resource types are registered. I'd much rather have this automatic anyhow (i.e. a derive
macro and/or including the types in rustler::init!
).
FWIW, this is now happening on beta as well, as of 1.80.0-beta.2
. Normally this means this will start happening on stable in 6 weeks from now, when that reaches 1.80.
Good to know, thanks. It's still just a warning and we'll have to handle it properly once we switch to edition 2024 which will only be available in a stable version in October (https://doc.rust-lang.org/edition-guide/rust-2024/index.html). I have a working alternative implementation in #617, but I'd like to explore a few more possible changes or adjustments if we have to break the interface anyhow.
rust:
1.79.0-nightly (7f2fc33da 2024-04-22)
rustler:0.32.1
elixir:1.16.2
erlang:26.2.4
this code:
produces this warning:
and with the suggested -Z flag: