Skip to content
This repository was archived by the owner on Nov 24, 2023. It is now read-only.

Commit 446451a

Browse files
oli-obkkillercup
authored andcommitted
Update to latest clippy
1 parent bc2efef commit 446451a

10 files changed

+137
-242
lines changed

tests/fixtures/E0178.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,13 @@
5858
"rendered": null
5959
}
6060
],
61-
"rendered": "error[E0178]: expected a path on the left-hand side of `+`, not `&'a Foo`\n --> ./tests/fixtures/E0178.rs:6:8\n |\n6 | w: &'a Foo + Send,\n | ^^^^^^^^^^^^^^ help: try adding parentheses: `&'a (Foo + Send)`\n\n"
61+
"rendered": "error[E0178]: expected a path on the left-hand side of `+`, not `&'a Foo`\n --> ./tests/fixtures/E0178.rs:6:8\n |\n6 | w: &'a Foo + Send,\n | ^^^^^^^^^^^^^^ help: try adding parentheses: `&'a (Foo + Send)`\n\nIf you want more information on this error, try using \"rustc --explain E0178\"\n"
62+
}
63+
{
64+
"message": "aborting due to previous error",
65+
"code": null,
66+
"level": "error",
67+
"spans": [],
68+
"children": [],
69+
"rendered": "error: aborting due to previous error\n\n"
6270
}

tests/fixtures/closure-immutable-outer-variable.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,13 @@
5858
"rendered": null
5959
}
6060
],
61-
"rendered": "error[E0594]: cannot assign to captured outer variable in an `FnMut` closure\n --> ./tests/fixtures/closure-immutable-outer-variable.rs:19:26\n |\n18 | let y = true;\n | - help: consider making `y` mutable: `mut y`\n19 | foo(Box::new(move || y = false) as Box<_>); //~ ERROR cannot assign to captured outer variable\n | ^^^^^^^^^\n\n"
61+
"rendered": "error[E0594]: cannot assign to captured outer variable in an `FnMut` closure\n --> ./tests/fixtures/closure-immutable-outer-variable.rs:19:26\n |\n18 | let y = true;\n | - help: consider making `y` mutable: `mut y`\n19 | foo(Box::new(move || y = false) as Box<_>); //~ ERROR cannot assign to captured outer variable\n | ^^^^^^^^^\n\nIf you want more information on this error, try using \"rustc --explain E0594\"\n"
62+
}
63+
{
64+
"message": "aborting due to previous error",
65+
"code": null,
66+
"level": "error",
67+
"spans": [],
68+
"children": [],
69+
"rendered": "error: aborting due to previous error\n\n"
6270
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
const LOREM: & str = "ipsum";
1+
const LOREM: &str = "ipsum";
22

33
fn main() {}

tests/fixtures/const_static_lifetime.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,30 +43,30 @@
4343
"spans": [
4444
{
4545
"file_name": "./tests/fixtures/const_static_lifetime.rs",
46-
"byte_start": 14,
47-
"byte_end": 21,
46+
"byte_start": 13,
47+
"byte_end": 25,
4848
"line_start": 1,
4949
"line_end": 1,
50-
"column_start": 15,
51-
"column_end": 22,
50+
"column_start": 14,
51+
"column_end": 26,
5252
"is_primary": true,
5353
"text": [
5454
{
5555
"text": "const LOREM: &'static str = \"ipsum\";",
56-
"highlight_start": 15,
57-
"highlight_end": 22
56+
"highlight_start": 14,
57+
"highlight_end": 26
5858
}
5959
],
6060
"label": null,
61-
"suggested_replacement": "",
61+
"suggested_replacement": "&str",
6262
"expansion": null
6363
}
6464
],
6565
"children": [],
6666
"rendered": null
6767
}
6868
],
69-
"rendered": "warning: Constants have by default a `'static` lifetime\n --> ./tests/fixtures/const_static_lifetime.rs:1:15\n |\n1 | const LOREM: &'static str = \"ipsum\";\n | ^^^^^^^ help: consider removing `'static`\n |\n = note: #[warn(const_static_lifetime)] on by default\n\n"
69+
"rendered": "warning: Constants have by default a `'static` lifetime\n --> ./tests/fixtures/const_static_lifetime.rs:1:15\n |\n1 | const LOREM: &'static str = \"ipsum\";\n | -^^^^^^^---- help: consider removing `'static`: `&str`\n |\n = note: #[warn(const_static_lifetime)] on by default\n\n"
7070
}
7171
{
7272
"message": "constant item is never used: `LOREM`",
Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,70 @@
11
{
2-
"message": "it is more idiomatic to loop over references to containers instead of using explicit iteration methods",
3-
"code": {
4-
"code": "explicit_iter_loop",
5-
"explanation": null
2+
"message": "it is more idiomatic to loop over references to containers instead of using explicit iteration methods",
3+
"code": {
4+
"code": "explicit_iter_loop",
5+
"explanation": null
6+
},
7+
"level": "warning",
8+
"spans": [
9+
{
10+
"file_name": "./tests/fixtures/explicit_iter_loop.rs",
11+
"byte_start": 54,
12+
"byte_end": 63,
13+
"line_start": 4,
14+
"line_end": 4,
15+
"column_start": 14,
16+
"column_end": 23,
17+
"is_primary": true,
18+
"text": [
19+
{
20+
"text": " for x in xs.iter() {",
21+
"highlight_start": 14,
22+
"highlight_end": 23
23+
}
24+
],
25+
"label": null,
26+
"suggested_replacement": null,
27+
"expansion": null
28+
}
29+
],
30+
"children": [
31+
{
32+
"message": "#[warn(explicit_iter_loop)] on by default",
33+
"code": null,
34+
"level": "note",
35+
"spans": [],
36+
"children": [],
37+
"rendered": null
638
},
7-
"level": "warning",
8-
"spans": [
9-
{
10-
"file_name": "./tests/fixtures/explicit_iter_loop.rs",
11-
"byte_start": 54,
12-
"byte_end": 63,
13-
"line_start": 4,
14-
"line_end": 4,
15-
"column_start": 14,
16-
"column_end": 23,
17-
"is_primary": true,
18-
"text": [
19-
{
20-
"text": " for x in xs.iter() {",
21-
"highlight_start": 14,
22-
"highlight_end": 23
23-
}
24-
],
25-
"label": null,
26-
"suggested_replacement": null,
27-
"expansion": null
28-
}
29-
],
30-
"children": [
31-
{
32-
"message": "#[warn(explicit_iter_loop)] on by default",
33-
"code": null,
34-
"level": "note",
35-
"spans": [],
36-
"children": [],
37-
"rendered": null
38-
},
39-
{
40-
"message": "to write this more concisely, try",
41-
"code": null,
42-
"level": "help",
43-
"spans": [
44-
{
45-
"file_name": "./tests/fixtures/explicit_iter_loop.rs",
46-
"byte_start": 54,
47-
"byte_end": 63,
48-
"line_start": 4,
49-
"line_end": 4,
50-
"column_start": 14,
51-
"column_end": 23,
52-
"is_primary": true,
53-
"text": [
54-
{
55-
"text": " for x in xs.iter() {",
56-
"highlight_start": 14,
57-
"highlight_end": 23
58-
}
59-
],
60-
"label": null,
61-
"suggested_replacement": "&xs",
62-
"expansion": null
63-
}
64-
],
65-
"children": [],
66-
"rendered": null
67-
}
68-
],
69-
"rendered": "warning: it is more idiomatic to loop over references to containers instead of using explicit iteration methods\n --> ./tests/fixtures/explicit_iter_loop.rs:4:14\n |\n4 | for x in xs.iter() {\n | ^^^^^^^^^ help: to write this more concisely, try: `&xs`\n |\n = note: #[warn(explicit_iter_loop)] on by default\n\n"
70-
}
39+
{
40+
"message": "to write this more concisely, try",
41+
"code": null,
42+
"level": "help",
43+
"spans": [
44+
{
45+
"file_name": "./tests/fixtures/explicit_iter_loop.rs",
46+
"byte_start": 54,
47+
"byte_end": 63,
48+
"line_start": 4,
49+
"line_end": 4,
50+
"column_start": 14,
51+
"column_end": 23,
52+
"is_primary": true,
53+
"text": [
54+
{
55+
"text": " for x in xs.iter() {",
56+
"highlight_start": 14,
57+
"highlight_end": 23
58+
}
59+
],
60+
"label": null,
61+
"suggested_replacement": "&xs",
62+
"expansion": null
63+
}
64+
],
65+
"children": [],
66+
"rendered": null
67+
}
68+
],
69+
"rendered": "warning: it is more idiomatic to loop over references to containers instead of using explicit iteration methods\n --> ./tests/fixtures/explicit_iter_loop.rs:4:14\n |\n4 | for x in xs.iter() {\n | ^^^^^^^^^ help: to write this more concisely, try: `&xs`\n |\n = note: #[warn(explicit_iter_loop)] on by default\n\n"
70+
}

tests/fixtures/lt-generic-comp.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
],
4747
"children": [
4848
{
49-
"message": "try comparing the casted value",
49+
"message": "try comparing the cast value",
5050
"code": null,
5151
"level": "help",
5252
"spans": [
@@ -75,7 +75,7 @@
7575
"rendered": null
7676
}
7777
],
78-
"rendered": "error: `<` is interpreted as a start of generic arguments for `u32`, not a comparison\n --> ./tests/fixtures/lt-generic-comp.rs:4:17\n |\n4 | if x as u32 < 4 {\n | -------- ^ - interpreted as generic arguments\n | | |\n | | not interpreted as comparison\n | help: try comparing the casted value: `(x as u32)`\n\n"
78+
"rendered": "error: `<` is interpreted as a start of generic arguments for `u32`, not a comparison\n --> ./tests/fixtures/lt-generic-comp.rs:4:17\n |\n4 | if x as u32 < 4 {\n | -------- ^ - interpreted as generic arguments\n | | |\n | | not interpreted as comparison\n | help: try comparing the cast value: `(x as u32)`\n\n"
7979
}
8080
{
8181
"message": "aborting due to previous error",

tests/fixtures/redundant_closure_call.fixed.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[allow(unused_variables)]
12
fn main() {
23
let a = 42;
34

0 commit comments

Comments
 (0)