Skip to content

Commit

Permalink
Ignore octal_escapes clippy lint in test
Browse files Browse the repository at this point in the history
    error: octal-looking escape in string literal
       --> tests/test.rs:118:25
        |
    118 |         Literal::string("a\00b\07c\08d\0e\0").to_string(),
        |                         ^^^^^^^^^^^^^^^^^^^^
        |
        = help: octal escapes are not supported, `\0` is always a null character
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#octal_escapes
        = note: `-D clippy::octal-escapes` implied by `-D clippy::all`
    help: if an octal escape was intended, use the hexadecimal representation instead
        |
    118 |         Literal::string("a\x00b\x07c\08d\0e\0").to_string(),
        |                         ~~~~~~~~~~~~~~~~~~~~~~
    help: if the null character is intended, disambiguate using
        |
    118 |         Literal::string("a\x000b\x007c\08d\0e\0").to_string(),
        |                         ~~~~~~~~~~~~~~~~~~~~~~~~

    error: octal-looking escape in byte string literal
       --> tests/test.rs:155:30
        |
    155 |         Literal::byte_string(b"a\00b\07c\08d\0e\0").to_string(),
        |                              ^^^^^^^^^^^^^^^^^^^^^
        |
        = help: octal escapes are not supported, `\0` is always a null byte
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#octal_escapes
    help: if an octal escape was intended, use the hexadecimal representation instead
        |
    155 |         Literal::byte_string(b"a\x00b\x07c\08d\0e\0").to_string(),
        |                              ~~~~~~~~~~~~~~~~~~~~~~~
    help: if the null byte is intended, disambiguate using
        |
    155 |         Literal::byte_string(b"a\x000b\x007c\08d\0e\0").to_string(),
        |                              ~~~~~~~~~~~~~~~~~~~~~~~~~
  • Loading branch information
dtolnay committed Apr 3, 2023
1 parent 57b4db1 commit 5d3e58b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#![allow(
clippy::assertions_on_result_states,
clippy::items_after_statements,
clippy::non_ascii_literal
clippy::non_ascii_literal,
clippy::octal_escapes
)]

use proc_macro2::{Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree};
Expand Down

0 comments on commit 5d3e58b

Please sign in to comment.