about summary refs log tree commit diff
path: root/tests/ui
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-03-17 07:51:49 +0000
committerbors <bors@rust-lang.org>2024-03-17 07:51:49 +0000
commitd202eb653baf55ee0287a677c4272cd4d7ddde9d (patch)
tree417fa33b8aa4ea8a26e32d204233aaa06c98cc61 /tests/ui
parent67fa36a9f26e500b66b9221cff92b628ef3bb054 (diff)
parent9408c5974ec27d7119330a3d7057df92b5f59edc (diff)
downloadrust-d202eb653baf55ee0287a677c4272cd4d7ddde9d.tar.gz
rust-d202eb653baf55ee0287a677c4272cd4d7ddde9d.zip
Auto merge of #12450 - cookie-s:fix-optopt-duplicate-diags, r=llogiq
[`option_option`]: Fix duplicate diagnostics

Relates to #12379

This `option_option` lint change skips checks against `ty`s inside `field_def`s defined by external macro to prevent duplicate diagnostics to the same span `ty` by multiple `Struct` definitions.

---

changelog: [`option_option`]: Fix duplicate diagnostics
Diffstat (limited to 'tests/ui')
-rw-r--r--tests/ui/option_option.rs2
-rw-r--r--tests/ui/option_option.stderr26
2 files changed, 13 insertions, 15 deletions
diff --git a/tests/ui/option_option.rs b/tests/ui/option_option.rs
index 8eb75428ca5..42f03aae7bb 100644
--- a/tests/ui/option_option.rs
+++ b/tests/ui/option_option.rs
@@ -1,5 +1,3 @@
-//@compile-flags: -Zdeduplicate-diagnostics=yes
-
 #![deny(clippy::option_option)]
 #![allow(clippy::unnecessary_wraps, clippy::manual_unwrap_or_default)]
 
diff --git a/tests/ui/option_option.stderr b/tests/ui/option_option.stderr
index 76cb9ae944c..0cd048e400e 100644
--- a/tests/ui/option_option.stderr
+++ b/tests/ui/option_option.stderr
@@ -1,77 +1,77 @@
 error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
-  --> tests/ui/option_option.rs:6:10
+  --> tests/ui/option_option.rs:4:10
    |
 LL | const C: Option<Option<i32>> = None;
    |          ^^^^^^^^^^^^^^^^^^^
    |
 note: the lint level is defined here
-  --> tests/ui/option_option.rs:3:9
+  --> tests/ui/option_option.rs:1:9
    |
 LL | #![deny(clippy::option_option)]
    |         ^^^^^^^^^^^^^^^^^^^^^
 
 error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
-  --> tests/ui/option_option.rs:8:11
+  --> tests/ui/option_option.rs:6:11
    |
 LL | static S: Option<Option<i32>> = None;
    |           ^^^^^^^^^^^^^^^^^^^
 
 error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
-  --> tests/ui/option_option.rs:11:13
+  --> tests/ui/option_option.rs:9:13
    |
 LL | fn input(_: Option<Option<u8>>) {}
    |             ^^^^^^^^^^^^^^^^^^
 
 error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
-  --> tests/ui/option_option.rs:14:16
+  --> tests/ui/option_option.rs:12:16
    |
 LL | fn output() -> Option<Option<u8>> {
    |                ^^^^^^^^^^^^^^^^^^
 
 error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
-  --> tests/ui/option_option.rs:19:27
+  --> tests/ui/option_option.rs:17:27
    |
 LL | fn output_nested() -> Vec<Option<Option<u8>>> {
    |                           ^^^^^^^^^^^^^^^^^^
 
 error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
-  --> tests/ui/option_option.rs:25:30
+  --> tests/ui/option_option.rs:23:30
    |
 LL | fn output_nested_nested() -> Option<Option<Option<u8>>> {
    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
-  --> tests/ui/option_option.rs:31:8
+  --> tests/ui/option_option.rs:29:8
    |
 LL |     x: Option<Option<u8>>,
    |        ^^^^^^^^^^^^^^^^^^
 
 error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
-  --> tests/ui/option_option.rs:36:23
+  --> tests/ui/option_option.rs:34:23
    |
 LL |     fn struct_fn() -> Option<Option<u8>> {
    |                       ^^^^^^^^^^^^^^^^^^
 
 error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
-  --> tests/ui/option_option.rs:43:22
+  --> tests/ui/option_option.rs:41:22
    |
 LL |     fn trait_fn() -> Option<Option<u8>>;
    |                      ^^^^^^^^^^^^^^^^^^
 
 error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
-  --> tests/ui/option_option.rs:48:11
+  --> tests/ui/option_option.rs:46:11
    |
 LL |     Tuple(Option<Option<u8>>),
    |           ^^^^^^^^^^^^^^^^^^
 
 error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
-  --> tests/ui/option_option.rs:50:17
+  --> tests/ui/option_option.rs:48:17
    |
 LL |     Struct { x: Option<Option<u8>> },
    |                 ^^^^^^^^^^^^^^^^^^
 
 error: consider using `Option<T>` instead of `Option<Option<T>>` or a custom enum if you need to distinguish all 3 cases
-  --> tests/ui/option_option.rs:92:14
+  --> tests/ui/option_option.rs:90:14
    |
 LL |         foo: Option<Option<Cow<'a, str>>>,
    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^