Rust RFC 3373: Avoid non-local definitions in functions was accepted and it's implementation at rust-lang/rust#120393 found that this crate would be affected by it.
To be more precise users of the peek-poke-derive crate would be affected by it, in the form of a warn-by-default lint: non_local_definitions. This is because the derive macros from this crate use impl in a local context, const _DERIVE_peek_poke_Peek_FOR_???:
|
let dummy_const: Ident = sanitize_ident(&format!("_DERIVE_peek_poke_Peek_FOR_{}", name)); |
|
|
|
let peek_impl = quote! { |
|
#[allow(non_upper_case_globals)] |
|
const #dummy_const: () = { |
Fortunately a simple fix exist for this crate, by using a const-anon instead of named one:
- let dummy_const: Ident = sanitize_ident(&format!("_DERIVE_peek_poke_Peek_FOR_{}", name));
let peek_impl = quote! {
#[allow(non_upper_case_globals)]
- const #dummy_const: () = {
+ const _: () = {
It's also quite possible that you will need to set s.underscore_const(true); for the synstructure::Structure.
Rust RFC 3373: Avoid non-local definitions in functions was accepted and it's implementation at rust-lang/rust#120393 found that this crate would be affected by it.
To be more precise users of the
peek-poke-derivecrate would be affected by it, in the form of a warn-by-default lint:non_local_definitions. This is because the derive macros from this crate useimplin a local context,const _DERIVE_peek_poke_Peek_FOR_???:webrender/peek-poke/peek-poke-derive/src/lib.rs
Lines 244 to 248 in 8ce388e
Fortunately a simple fix exist for this crate, by using a const-anon instead of named one:
It's also quite possible that you will need to set
s.underscore_const(true);for thesynstructure::Structure.