fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.9 KiB71 linesraw
1error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
2  --> $DIR/ref_option_ref.rs:10:23
3   |
4LL | static REF_THRESHOLD: &Option<&i32> = &Some(&THRESHOLD);
5   |                       ^^^^^^^^^^^^^ help: try: `Option<&i32>`
6   |
7   = note: `-D clippy::ref-option-ref` implied by `-D warnings`
8   = help: to override `-D warnings` add `#[allow(clippy::ref_option_ref)]`
9
10error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
11  --> $DIR/ref_option_ref.rs:14:18
12   |
13LL | const REF_CONST: &Option<&i32> = &Some(CONST_THRESHOLD);
14   |                  ^^^^^^^^^^^^^ help: try: `Option<&i32>`
15
16error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
17  --> $DIR/ref_option_ref.rs:17:25
18   |
19LL | type RefOptRefU32<'a> = &'a Option<&'a u32>;
20   |                         ^^^^^^^^^^^^^^^^^^^ help: try: `Option<&'a u32>`
21
22error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
23  --> $DIR/ref_option_ref.rs:19:25
24   |
25LL | type RefOptRef<'a, T> = &'a Option<&'a T>;
26   |                         ^^^^^^^^^^^^^^^^^ help: try: `Option<&'a T>`
27
28error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
29  --> $DIR/ref_option_ref.rs:22:14
30   |
31LL | fn foo(data: &Option<&u32>) {}
32   |              ^^^^^^^^^^^^^ help: try: `Option<&u32>`
33
34error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
35  --> $DIR/ref_option_ref.rs:25:23
36   |
37LL | fn bar(data: &u32) -> &Option<&u32> {
38   |                       ^^^^^^^^^^^^^ help: try: `Option<&u32>`
39
40error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
41  --> $DIR/ref_option_ref.rs:31:11
42   |
43LL |     data: &'a Option<&'a u32>,
44   |           ^^^^^^^^^^^^^^^^^^^ help: try: `Option<&'a u32>`
45
46error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
47  --> $DIR/ref_option_ref.rs:35:32
48   |
49LL | struct StructTupleRef<'a>(u32, &'a Option<&'a u32>);
50   |                                ^^^^^^^^^^^^^^^^^^^ help: try: `Option<&'a u32>`
51
52error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
53  --> $DIR/ref_option_ref.rs:40:14
54   |
55LL |     Variant2(&'a Option<&'a u32>),
56   |              ^^^^^^^^^^^^^^^^^^^ help: try: `Option<&'a u32>`
57
58error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
59  --> $DIR/ref_option_ref.rs:50:14
60   |
61LL |     type A = &'static Option<&'static Self>;
62   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `Option<&'static Self>`
63
64error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
65  --> $DIR/ref_option_ref.rs:57:12
66   |
67LL |     let x: &Option<&u32> = &None;
68   |            ^^^^^^^^^^^^^ help: try: `Option<&u32>`
69
70error: aborting due to 11 previous errors
71