Skip to content

Commit 6212950

Browse files
committed
Explain why 'run-rustfix' is not defined
1 parent 8337c46 commit 6212950

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

tests/ui/ref_option_ref.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#![allow(unused)]
22
#![warn(clippy::ref_option_ref)]
33

4+
// This lint is not tagged as run-rustfix because automatically
5+
// changing the type of a variable would also means changing
6+
// all usages of this variable to match and This is not handled
7+
// by this lint.
8+
49
static THRESHOLD: i32 = 10;
510
static REF_THRESHOLD: &Option<&i32> = &Some(&THRESHOLD);
611
const CONST_THRESHOLD: &i32 = &10;

tests/ui/ref_option_ref.stderr

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,67 @@
11
error: since & implements Copy trait, &Option<&T> can be simplifyied into Option<&T>
2-
--> $DIR/ref_option_ref.rs:5:23
2+
--> $DIR/ref_option_ref.rs:10:23
33
|
44
LL | static REF_THRESHOLD: &Option<&i32> = &Some(&THRESHOLD);
55
| ^^^^^^^^^^^^^ help: try: `Option<&i32>`
66
|
77
= note: `-D clippy::ref-option-ref` implied by `-D warnings`
88

99
error: since & implements Copy trait, &Option<&T> can be simplifyied into Option<&T>
10-
--> $DIR/ref_option_ref.rs:7:18
10+
--> $DIR/ref_option_ref.rs:12:18
1111
|
1212
LL | const REF_CONST: &Option<&i32> = &Some(&CONST_THRESHOLD);
1313
| ^^^^^^^^^^^^^ help: try: `Option<&i32>`
1414

1515
error: since & implements Copy trait, &Option<&T> can be simplifyied into Option<&T>
16-
--> $DIR/ref_option_ref.rs:9:25
16+
--> $DIR/ref_option_ref.rs:14:25
1717
|
1818
LL | type RefOptRefU32<'a> = &'a Option<&'a u32>;
1919
| ^^^^^^^^^^^^^^^^^^^ help: try: `Option<&'a u32>`
2020

2121
error: since & implements Copy trait, &Option<&T> can be simplifyied into Option<&T>
22-
--> $DIR/ref_option_ref.rs:10:25
22+
--> $DIR/ref_option_ref.rs:15:25
2323
|
2424
LL | type RefOptRef<'a, T> = &'a Option<&'a T>;
2525
| ^^^^^^^^^^^^^^^^^ help: try: `Option<&'a T>`
2626

2727
error: since & implements Copy trait, &Option<&T> can be simplifyied into Option<&T>
28-
--> $DIR/ref_option_ref.rs:12:14
28+
--> $DIR/ref_option_ref.rs:17:14
2929
|
3030
LL | fn foo(data: &Option<&u32>) {}
3131
| ^^^^^^^^^^^^^ help: try: `Option<&u32>`
3232

3333
error: since & implements Copy trait, &Option<&T> can be simplifyied into Option<&T>
34-
--> $DIR/ref_option_ref.rs:14:23
34+
--> $DIR/ref_option_ref.rs:19:23
3535
|
3636
LL | fn bar(data: &u32) -> &Option<&u32> {
3737
| ^^^^^^^^^^^^^ help: try: `Option<&u32>`
3838

3939
error: since & implements Copy trait, &Option<&T> can be simplifyied into Option<&T>
40-
--> $DIR/ref_option_ref.rs:19:11
40+
--> $DIR/ref_option_ref.rs:24:11
4141
|
4242
LL | data: &'a Option<&'a u32>,
4343
| ^^^^^^^^^^^^^^^^^^^ help: try: `Option<&'a u32>`
4444

4545
error: since & implements Copy trait, &Option<&T> can be simplifyied into Option<&T>
46-
--> $DIR/ref_option_ref.rs:22:32
46+
--> $DIR/ref_option_ref.rs:27:32
4747
|
4848
LL | struct StructTupleRef<'a>(u32, &'a Option<&'a u32>);
4949
| ^^^^^^^^^^^^^^^^^^^ help: try: `Option<&'a u32>`
5050

5151
error: since & implements Copy trait, &Option<&T> can be simplifyied into Option<&T>
52-
--> $DIR/ref_option_ref.rs:26:14
52+
--> $DIR/ref_option_ref.rs:31:14
5353
|
5454
LL | Variant2(&'a Option<&'a u32>),
5555
| ^^^^^^^^^^^^^^^^^^^ help: try: `Option<&'a u32>`
5656

5757
error: since & implements Copy trait, &Option<&T> can be simplifyied into Option<&T>
58-
--> $DIR/ref_option_ref.rs:35:14
58+
--> $DIR/ref_option_ref.rs:40:14
5959
|
6060
LL | type A = &'static Option<&'static Self>;
6161
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Option<&'static Self>`
6262

6363
error: since & implements Copy trait, &Option<&T> can be simplifyied into Option<&T>
64-
--> $DIR/ref_option_ref.rs:41:12
64+
--> $DIR/ref_option_ref.rs:46:12
6565
|
6666
LL | let x: &Option<&u32> = &None;
6767
| ^^^^^^^^^^^^^ help: try: `Option<&u32>`

0 commit comments

Comments
 (0)