Skip to content

Commit

Permalink
Warn against and fix meta_variable_misuse
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Dec 12, 2023
1 parent c721b9f commit 9f6733e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ rustflags = [
"-Wunused_crate_dependencies",
"-Wunused_lifetimes",
"-Wunused_tuple_struct_fields", # Will be uplifed into `dead_code` (warn-by-default) with https://github.com/rust-lang/rust/pull/118297
"-Wmeta_variable_misuse",
# Rust 2018 idioms that are not yet warn-by-default:
"-Welided_lifetimes_in_paths",
"-Wunused_extern_crates",
Expand Down
4 changes: 2 additions & 2 deletions crates/codegen/parser/runtime/src/support/scanner_macros.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[allow(unused_macros)]
macro_rules! scan_chars {
($stream:ident, $($char:literal),+) => {
if $( $stream.next() == Some($char) )&&* {
if $( $stream.next() == Some($char) )&&+ {
true
} else {
$stream.undo();
Expand All @@ -14,7 +14,7 @@ macro_rules! scan_chars {
macro_rules! scan_none_of {
($stream:ident, $($char:literal),+) => {
if let Some(c) = $stream.next() {
if $(c != $char)&&* {
if $(c != $char)&&+ {
true
} else {
$stream.undo();
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9f6733e

Please sign in to comment.