Skip to content

fix(console): remove trailing semicolons from macro expansions - #583

Open
guybedford wants to merge 1 commit into
ranile:masterfrom
guybedford:fix-macro-trailing-semicolons
Open

fix(console): remove trailing semicolons from macro expansions#583
guybedford wants to merge 1 commit into
ranile:masterfrom
guybedford:fix-macro-trailing-semicolons

Conversation

@guybedford

Copy link
Copy Markdown
Contributor

This fixes the nightly CI breakage in the Native, Browser, Node and gloo-net test jobs.

The gloo-console macros (log!, error!, dir!, etc.) all expanded to a statement with a trailing semicolon. When such a macro is invoked in expression position (e.g. as the final expression of a block, as in the gloo-console and gloo-net crate-level doc examples), this triggers the semicolon_in_expressions_from_macros future-incompatibility lint (rust-lang/rust#79813). rust-lang/rust#159222 recently extended the lint to non-local macros at deny level, which broke the nightly doctest jobs; rust-lang/rust#159700 has since split the non-local case into a warn-level lint, but the plan remains to make this a hard error (rust-lang/rust#159218), and the lint is already deny-by-default for local macro uses on stable.

  • Removes the trailing semicolon from every gloo-console macro expansion so they are valid in both statement and expression position (all expansions evaluate to ())
  • Adds compile-only tests exercising each macro in expression position, which fail at deny level before this change
  • Fixes a pre-existing clippy::manual_filter error in gloo-history that newer clippy flags, which was failing the Lint & Format job

Made with AI assistance under my review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant