diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /src/tools/clippy/tests/ui/ref_option_ref.stderr | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/tools/clippy/tests/ui/ref_option_ref.stderr | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/ref_option_ref.stderr b/src/tools/clippy/tests/ui/ref_option_ref.stderr new file mode 100644 index 000000000..b61334758 --- /dev/null +++ b/src/tools/clippy/tests/ui/ref_option_ref.stderr @@ -0,0 +1,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 + |