2020-11-05 07:29:48 -06:00
|
|
|
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`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::ref_option_ref)]`
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ref_option_ref.rs:14:18
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
2021-04-08 10:50:13 -05:00
|
|
|
LL | const REF_CONST: &Option<&i32> = &Some(CONST_THRESHOLD);
|
2020-11-05 07:29:48 -06:00
|
|
|
| ^^^^^^^^^^^^^ help: try: `Option<&i32>`
|
|
|
|
|
|
|
|
error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ref_option_ref.rs:17:25
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
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>`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ref_option_ref.rs:19:25
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
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>`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ref_option_ref.rs:22:14
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
LL | fn foo(data: &Option<&u32>) {}
|
|
|
|
| ^^^^^^^^^^^^^ help: try: `Option<&u32>`
|
|
|
|
|
|
|
|
error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ref_option_ref.rs:25:23
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
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>`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ref_option_ref.rs:31:11
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
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>`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ref_option_ref.rs:35:32
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
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>`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ref_option_ref.rs:40:14
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
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>`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ref_option_ref.rs:50:14
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
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>`
|
2023-08-24 14:32:12 -05:00
|
|
|
--> $DIR/ref_option_ref.rs:57:12
|
2020-11-05 07:29:48 -06:00
|
|
|
|
|
|
|
|
LL | let x: &Option<&u32> = &None;
|
|
|
|
| ^^^^^^^^^^^^^ help: try: `Option<&u32>`
|
|
|
|
|
|
|
|
error: aborting due to 11 previous errors
|
|
|
|
|