File tree 7 files changed +21
-15
lines changed
7 files changed +21
-15
lines changed Original file line number Diff line number Diff line change 98
98
./rustup-toolchain "" -c clippy
99
99
- name : rustfmt
100
100
run : ./miri fmt --check
101
- - name : clippy (miri)
102
- run : cargo clippy --all-targets -- -D warnings
103
- # - name: Clippy (ui_test)
104
- # run: cargo clippy --manifest-path ui_test/Cargo.toml --all-targets -- -D warnings
105
- - name : clippy (cargo-miri)
106
- run : cargo clippy --manifest-path cargo-miri/Cargo.toml --all-targets -- -D warnings
101
+ - name : clippy
102
+ run : ./miri clippy -- -D warnings
107
103
- name : rustdoc
108
104
run : RUSTDOCFLAGS="-Dwarnings" cargo doc --document-private-items
109
105
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ times and slower execution times.
28
28
./miri fmt <flags>:
29
29
Format all sources and tests. <flags> are passed to `rustfmt`.
30
30
31
+ ./miri clippy <flags>:
32
+ Format all sources and tests. <flags> are passed to `cargo clippy`.
33
+
31
34
ENVIRONMENT VARIABLES
32
35
33
36
MIRI_SYSROOT:
@@ -163,6 +166,11 @@ fmt)
163
166
find " $MIRIDIR " -not \( -name target -prune \) -name ' *.rs' \
164
167
| xargs rustfmt --edition=2021 --config-path " $MIRIDIR /rustfmt.toml" " $@ "
165
168
;;
169
+ clippy)
170
+ 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 " $@ "
172
+ cargo clippy $CARGO_BUILD_FLAGS --manifest-path " $MIRIDIR " /cargo-miri/Cargo.toml " $@ "
173
+ ;;
166
174
* )
167
175
if [ -n " $COMMAND " ]; then
168
176
echo " Unknown command: $COMMAND "
Original file line number Diff line number Diff line change 42
42
43
43
# Install and setup new toolchain.
44
44
rustup toolchain uninstall miri
45
- rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools -c rustfmt " $@ " -- " $NEW_COMMIT "
45
+ rustup-toolchain-install-master -n miri -c cargo -c rust-src -c rustc-dev -c llvm-tools -c rustfmt -c clippy " $@ " -- " $NEW_COMMIT "
46
46
rustup override set miri
47
47
48
48
# Cleanup.
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ impl Comments {
90
90
path. display( )
91
91
) ;
92
92
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 ( ) ) ;
94
94
}
95
95
if let Some ( s) = line. strip_prefix ( "// ignore-" ) {
96
96
let s = s
Original file line number Diff line number Diff line change
1
+ #![ allow( clippy:: enum_variant_names, clippy:: useless_format, clippy:: too_many_arguments) ]
2
+
1
3
use std:: collections:: VecDeque ;
2
4
use std:: fmt:: Write ;
3
5
use std:: path:: { Path , PathBuf } ;
@@ -338,17 +340,17 @@ fn check_test_result(
338
340
revised ( "stderr" ) ,
339
341
target,
340
342
& config. stderr_filters ,
341
- & config,
343
+ config,
342
344
comments,
343
345
) ;
344
346
check_output (
345
- & stdout,
347
+ stdout,
346
348
path,
347
349
errors,
348
350
revised ( "stdout" ) ,
349
351
target,
350
352
& config. stdout_filters ,
351
- & config,
353
+ config,
352
354
comments,
353
355
) ;
354
356
// Check error annotations in the source against output
Original file line number Diff line number Diff line change @@ -117,16 +117,16 @@ impl Span {
117
117
118
118
pub ( crate ) fn filter_annotations_from_rendered ( rendered : & str ) -> std:: borrow:: Cow < ' _ , str > {
119
119
let annotations = Regex :: new ( r"\s*//(\[[^\]]\])?~.*" ) . unwrap ( ) ;
120
- annotations. replace_all ( & rendered, "" )
120
+ annotations. replace_all ( rendered, "" )
121
121
}
122
122
123
123
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 ( ) ;
125
125
let mut rendered = String :: new ( ) ;
126
126
let mut messages = vec ! [ ] ;
127
127
let mut messages_from_unknown_file_or_line = vec ! [ ] ;
128
128
for line in stderr. lines ( ) {
129
- if line. starts_with ( "{" ) {
129
+ if line. starts_with ( '{' ) {
130
130
match serde_json:: from_str :: < RustcMessage > ( line) {
131
131
Ok ( msg) => {
132
132
write ! (
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ fn main() {
29
29
}
30
30
" ;
31
31
let path = Path :: new ( "$DIR/<dummy>" ) ;
32
- let comments = Comments :: parse ( & path, s) ;
32
+ let comments = Comments :: parse ( path, s) ;
33
33
let mut errors = vec ! [ ] ;
34
34
let config = config ( ) ;
35
35
let messages = vec ! [
You can’t perform that action at this time.
0 commit comments