diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-06-14 20:37:28 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-06-14 20:37:28 +0100 |
commit | ce8fdf3ab05b59b517dee985e4b3828c6e373a91 (patch) | |
tree | 8a498dc4c333f2f0e513a5b63a45c226d6e12279 /crates/ide_diagnostics/src/handlers/inactive_code.rs | |
parent | 27a70492f7eb8181c90ed5aa62e8e8b7ce035c91 (diff) | |
parent | 4cfc767d7fadeab025227d67f104065c9e8a55d3 (diff) |
Merge #9276
9276: internal: refactor diagnostics more r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ide_diagnostics/src/handlers/inactive_code.rs')
-rw-r--r-- | crates/ide_diagnostics/src/handlers/inactive_code.rs | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/crates/ide_diagnostics/src/handlers/inactive_code.rs b/crates/ide_diagnostics/src/handlers/inactive_code.rs index 4b722fd64..dfd0e3351 100644 --- a/crates/ide_diagnostics/src/handlers/inactive_code.rs +++ b/crates/ide_diagnostics/src/handlers/inactive_code.rs | |||
@@ -49,26 +49,26 @@ fn f() { | |||
49 | // The three g̶e̶n̶d̶e̶r̶s̶ statements: | 49 | // The three g̶e̶n̶d̶e̶r̶s̶ statements: |
50 | 50 | ||
51 | #[cfg(a)] fn f() {} // Item statement | 51 | #[cfg(a)] fn f() {} // Item statement |
52 | //^^^^^^^^^^^^^^^^^^^ code is inactive due to #[cfg] directives: a is disabled | 52 | //^^^^^^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: a is disabled |
53 | #[cfg(a)] {} // Expression statement | 53 | #[cfg(a)] {} // Expression statement |
54 | //^^^^^^^^^^^^ code is inactive due to #[cfg] directives: a is disabled | 54 | //^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: a is disabled |
55 | #[cfg(a)] let x = 0; // let statement | 55 | #[cfg(a)] let x = 0; // let statement |
56 | //^^^^^^^^^^^^^^^^^^^^ code is inactive due to #[cfg] directives: a is disabled | 56 | //^^^^^^^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: a is disabled |
57 | 57 | ||
58 | abc(#[cfg(a)] 0); | 58 | abc(#[cfg(a)] 0); |
59 | //^^^^^^^^^^^ code is inactive due to #[cfg] directives: a is disabled | 59 | //^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: a is disabled |
60 | let x = Struct { | 60 | let x = Struct { |
61 | #[cfg(a)] f: 0, | 61 | #[cfg(a)] f: 0, |
62 | //^^^^^^^^^^^^^^ code is inactive due to #[cfg] directives: a is disabled | 62 | //^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: a is disabled |
63 | }; | 63 | }; |
64 | match () { | 64 | match () { |
65 | () => (), | 65 | () => (), |
66 | #[cfg(a)] () => (), | 66 | #[cfg(a)] () => (), |
67 | //^^^^^^^^^^^^^^^^^^ code is inactive due to #[cfg] directives: a is disabled | 67 | //^^^^^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: a is disabled |
68 | } | 68 | } |
69 | 69 | ||
70 | #[cfg(a)] 0 // Trailing expression of block | 70 | #[cfg(a)] 0 // Trailing expression of block |
71 | //^^^^^^^^^^^ code is inactive due to #[cfg] directives: a is disabled | 71 | //^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: a is disabled |
72 | } | 72 | } |
73 | "#, | 73 | "#, |
74 | ); | 74 | ); |
@@ -81,16 +81,16 @@ fn f() { | |||
81 | check( | 81 | check( |
82 | r#" | 82 | r#" |
83 | #[cfg(no)] pub fn f() {} | 83 | #[cfg(no)] pub fn f() {} |
84 | //^^^^^^^^^^^^^^^^^^^^^^^^ code is inactive due to #[cfg] directives: no is disabled | 84 | //^^^^^^^^^^^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: no is disabled |
85 | 85 | ||
86 | #[cfg(no)] #[cfg(no2)] mod m; | 86 | #[cfg(no)] #[cfg(no2)] mod m; |
87 | //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ code is inactive due to #[cfg] directives: no and no2 are disabled | 87 | //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: no and no2 are disabled |
88 | 88 | ||
89 | #[cfg(all(not(a), b))] enum E {} | 89 | #[cfg(all(not(a), b))] enum E {} |
90 | //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ code is inactive due to #[cfg] directives: b is disabled | 90 | //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: b is disabled |
91 | 91 | ||
92 | #[cfg(feature = "std")] use std; | 92 | #[cfg(feature = "std")] use std; |
93 | //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ code is inactive due to #[cfg] directives: feature = "std" is disabled | 93 | //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: feature = "std" is disabled |
94 | "#, | 94 | "#, |
95 | ); | 95 | ); |
96 | } | 96 | } |
@@ -102,14 +102,14 @@ fn f() { | |||
102 | check( | 102 | check( |
103 | r#" | 103 | r#" |
104 | #[cfg_attr(not(never), cfg(no))] fn f() {} | 104 | #[cfg_attr(not(never), cfg(no))] fn f() {} |
105 | //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ code is inactive due to #[cfg] directives: no is disabled | 105 | //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: no is disabled |
106 | 106 | ||
107 | #[cfg_attr(not(never), cfg(not(no)))] fn f() {} | 107 | #[cfg_attr(not(never), cfg(not(no)))] fn f() {} |
108 | 108 | ||
109 | #[cfg_attr(never, cfg(no))] fn g() {} | 109 | #[cfg_attr(never, cfg(no))] fn g() {} |
110 | 110 | ||
111 | #[cfg_attr(not(never), inline, cfg(no))] fn h() {} | 111 | #[cfg_attr(not(never), inline, cfg(no))] fn h() {} |
112 | //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ code is inactive due to #[cfg] directives: no is disabled | 112 | //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ weak: code is inactive due to #[cfg] directives: no is disabled |
113 | "#, | 113 | "#, |
114 | ); | 114 | ); |
115 | } | 115 | } |