summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/ref_option_ref.stderr
blob: b61334758e85431abd23ef6c139913770ef24d67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
  --> $DIR/ref_option_ref.rs:10:23
   |
LL | static REF_THRESHOLD: &Option<&i32> = &Some(&THRESHOLD);
   |                       ^^^^^^^^^^^^^ help: try: `Option<&i32>`
   |
   = note: `-D clippy::ref-option-ref` implied by `-D warnings`

error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
  --> $DIR/ref_option_ref.rs:12:18
   |
LL | const REF_CONST: &Option<&i32> = &Some(CONST_THRESHOLD);
   |                  ^^^^^^^^^^^^^ help: try: `Option<&i32>`

error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
  --> $DIR/ref_option_ref.rs:14:25
   |
LL | type RefOptRefU32<'a> = &'a Option<&'a u32>;
   |                         ^^^^^^^^^^^^^^^^^^^ help: try: `Option<&'a u32>`

error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
  --> $DIR/ref_option_ref.rs:15:25
   |
LL | type RefOptRef<'a, T> = &'a Option<&'a T>;
   |                         ^^^^^^^^^^^^^^^^^ help: try: `Option<&'a T>`

error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
  --> $DIR/ref_option_ref.rs:17:14
   |
LL | fn foo(data: &Option<&u32>) {}
   |              ^^^^^^^^^^^^^ help: try: `Option<&u32>`

error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
  --> $DIR/ref_option_ref.rs:19:23
   |
LL | fn bar(data: &u32) -> &Option<&u32> {
   |                       ^^^^^^^^^^^^^ help: try: `Option<&u32>`

error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
  --> $DIR/ref_option_ref.rs:24:11
   |
LL |     data: &'a Option<&'a u32>,
   |           ^^^^^^^^^^^^^^^^^^^ help: try: `Option<&'a u32>`

error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
  --> $DIR/ref_option_ref.rs:27:32
   |
LL | struct StructTupleRef<'a>(u32, &'a Option<&'a u32>);
   |                                ^^^^^^^^^^^^^^^^^^^ help: try: `Option<&'a u32>`

error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
  --> $DIR/ref_option_ref.rs:31:14
   |
LL |     Variant2(&'a Option<&'a u32>),
   |              ^^^^^^^^^^^^^^^^^^^ help: try: `Option<&'a u32>`

error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
  --> $DIR/ref_option_ref.rs:40:14
   |
LL |     type A = &'static Option<&'static Self>;
   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Option<&'static Self>`

error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
  --> $DIR/ref_option_ref.rs:46:12
   |
LL |     let x: &Option<&u32> = &None;
   |            ^^^^^^^^^^^^^ help: try: `Option<&u32>`

error: aborting due to 11 previous errors