rust-clippy/tests/ui/ref_option_ref.stderr

71 lines
2.8 KiB
Text
Raw Normal View History

error: since `&` implements the `Copy` trait, `&Option<&T>` can be simplified to `Option<&T>`
--> $DIR/ref_option_ref.rs:10:23
2020-10-12 21:58:59 +00:00
|
2020-10-15 19:56:56 +00:00
LL | static REF_THRESHOLD: &Option<&i32> = &Some(&THRESHOLD);
| ^^^^^^^^^^^^^ help: try: `Option<&i32>`
2020-10-12 21:58:59 +00:00
|
= 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
|
2020-10-15 19:56:56 +00:00
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
2020-10-15 19:56:56 +00: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>`
--> $DIR/ref_option_ref.rs:15:25
2020-10-15 19:56:56 +00: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>`
--> $DIR/ref_option_ref.rs:17:14
2020-10-15 19:56:56 +00: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>`
--> $DIR/ref_option_ref.rs:19:23
2020-10-15 19:56:56 +00: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>`
--> $DIR/ref_option_ref.rs:24:11
2020-10-15 19:56:56 +00: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>`
--> $DIR/ref_option_ref.rs:27:32
2020-10-15 19:56:56 +00: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>`
--> $DIR/ref_option_ref.rs:31:14
2020-10-15 19:56:56 +00: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>`
--> $DIR/ref_option_ref.rs:40:14
2020-10-15 19:56:56 +00: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>`
--> $DIR/ref_option_ref.rs:46:12
|
LL | let x: &Option<&u32> = &None;
| ^^^^^^^^^^^^^ help: try: `Option<&u32>`
2020-10-15 19:56:56 +00:00
error: aborting due to 11 previous errors
2020-10-12 21:58:59 +00:00