Skip to content

Commit

Permalink
Merge pull request #1049 from mivort/rust-analyzer-style-warnings
Browse files Browse the repository at this point in the history
Add #[allow(...)] directives to macro-generated entries
  • Loading branch information
Bromeon authored Feb 18, 2025
2 parents f6a309a + 457bee5 commit ac8b1da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions godot-macros/src/class/derive_godot_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ pub fn derive_godot_class(item: venial::Item) -> ParseResult<TokenStream> {
let funcs_collection_struct_name = format_funcs_collection_struct(class_name);
let funcs_collection_struct = quote! {
#[doc(hidden)]
#[allow(non_camel_case_types)]
pub struct #funcs_collection_struct_name {}
};

Expand Down
1 change: 1 addition & 0 deletions godot-macros/src/derive/derive_from_godot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ fn make_fromgodot_for_int_enum(
#(
// Interesting: using let instead of const would introduce a runtime bug. Its values cannot be used in match lhs (binding).
// However, bindings silently shadow variables, so the first match arm always runs; no warning in generated proc-macro code.
#[allow(non_upper_case_globals)]
const #ord_variables: #int = #discriminants;
)*

Expand Down

0 comments on commit ac8b1da

Please sign in to comment.