Skip to content

Commit e33efc7

Browse files
committed
make ui_test pass clippy
1 parent 02f8cb2 commit e33efc7

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

miri

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ fmt)
168168
;;
169169
clippy)
170170
cargo clippy $CARGO_BUILD_FLAGS --manifest-path "$MIRIDIR"/Cargo.toml --all-targets "$@"
171-
#cargo clippy $CARGO_BUILD_FLAGS --manifest-path "$MIRIDIR"/ui_test/Cargo.toml --all-targets "$@"
171+
cargo clippy $CARGO_BUILD_FLAGS --manifest-path "$MIRIDIR"/ui_test/Cargo.toml --all-targets "$@"
172172
cargo clippy $CARGO_BUILD_FLAGS --manifest-path "$MIRIDIR"/cargo-miri/Cargo.toml "$@"
173173
;;
174174
*)

ui_test/src/comments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl Comments {
9090
path.display()
9191
);
9292
this.revisions =
93-
Some(revisions.trim().split_whitespace().map(|s| s.to_string()).collect());
93+
Some(revisions.split_whitespace().map(|s| s.to_string()).collect());
9494
}
9595
if let Some(s) = line.strip_prefix("// ignore-") {
9696
let s = s

ui_test/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::enum_variant_names, clippy::useless_format, clippy::too_many_arguments)]
2+
13
use std::collections::VecDeque;
24
use std::fmt::Write;
35
use std::path::{Path, PathBuf};
@@ -338,17 +340,17 @@ fn check_test_result(
338340
revised("stderr"),
339341
target,
340342
&config.stderr_filters,
341-
&config,
343+
config,
342344
comments,
343345
);
344346
check_output(
345-
&stdout,
347+
stdout,
346348
path,
347349
errors,
348350
revised("stdout"),
349351
target,
350352
&config.stdout_filters,
351-
&config,
353+
config,
352354
comments,
353355
);
354356
// Check error annotations in the source against output

ui_test/src/rustc_stderr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,16 @@ impl Span {
117117

118118
pub(crate) fn filter_annotations_from_rendered(rendered: &str) -> std::borrow::Cow<'_, str> {
119119
let annotations = Regex::new(r"\s*//(\[[^\]]\])?~.*").unwrap();
120-
annotations.replace_all(&rendered, "")
120+
annotations.replace_all(rendered, "")
121121
}
122122

123123
pub(crate) fn process(file: &Path, stderr: &[u8]) -> Diagnostics {
124-
let stderr = std::str::from_utf8(&stderr).unwrap();
124+
let stderr = std::str::from_utf8(stderr).unwrap();
125125
let mut rendered = String::new();
126126
let mut messages = vec![];
127127
let mut messages_from_unknown_file_or_line = vec![];
128128
for line in stderr.lines() {
129-
if line.starts_with("{") {
129+
if line.starts_with('{') {
130130
match serde_json::from_str::<RustcMessage>(line) {
131131
Ok(msg) => {
132132
write!(

ui_test/src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn main() {
2929
}
3030
";
3131
let path = Path::new("$DIR/<dummy>");
32-
let comments = Comments::parse(&path, s);
32+
let comments = Comments::parse(path, s);
3333
let mut errors = vec![];
3434
let config = config();
3535
let messages = vec![

0 commit comments

Comments
 (0)