diff options
| author | togami2864 <tuabobo123@gmail.com> | 2021-11-26 18:49:14 +0900 |
|---|---|---|
| committer | togami2864 <tuabobo123@gmail.com> | 2021-11-26 18:49:14 +0900 |
| commit | e8ef6ca5e31f6cd648aca9c0cfe7a9743ec880d7 (patch) | |
| tree | 3434e09ecc3a182e36371fe56d9fa44e59ac535b | |
| parent | a745cc55f3e5658e90c971d6532529c2526bf87b (diff) | |
| download | rust-e8ef6ca5e31f6cd648aca9c0cfe7a9743ec880d7.tar.gz rust-e8ef6ca5e31f6cd648aca9c0cfe7a9743ec880d7.zip | |
fix stderr
| -rw-r--r-- | clippy_lints/src/unicode.rs | 2 | ||||
| -rw-r--r-- | tests/ui/unicode.stderr | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/clippy_lints/src/unicode.rs b/clippy_lints/src/unicode.rs index b5e4bc75bd1..82d7a1cbb8e 100644 --- a/clippy_lints/src/unicode.rs +++ b/clippy_lints/src/unicode.rs @@ -75,7 +75,7 @@ declare_lint_pass!(Unicode => [INVISIBLE_CHARACTERS, NON_ASCII_LITERAL, UNICODE_ impl LateLintPass<'_> for Unicode { fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) { if let ExprKind::Lit(ref lit) = expr.kind { - if let LitKind::Str(_, _) | LitKind::Char(_)= lit.node { + if let LitKind::Str(_, _) | LitKind::Char(_) = lit.node { check_str(cx, lit.span, expr.hir_id); } } diff --git a/tests/ui/unicode.stderr b/tests/ui/unicode.stderr index 3fca463c620..3f54e3880e7 100644 --- a/tests/ui/unicode.stderr +++ b/tests/ui/unicode.stderr @@ -34,5 +34,17 @@ LL | print!("Üben!"); | = note: `-D clippy::non-ascii-literal` implied by `-D warnings` -error: aborting due to 5 previous errors +error: literal non-ASCII character detected + --> $DIR/unicode.rs:26:32 + | +LL | const _EMPTY_BLOCK: char = '▱'; + | ^^^ help: consider replacing the string with: `'/u{25b1}'` + +error: literal non-ASCII character detected + --> $DIR/unicode.rs:27:31 + | +LL | const _FULL_BLOCK: char = '▰'; + | ^^^ help: consider replacing the string with: `'/u{25b0}'` + +error: aborting due to 7 previous errors |
