File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
crates/ide/src/inlay_hints Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,10 @@ pub(super) fn hints(
59
59
} ) ;
60
60
}
61
61
for adjustment in adjustments. into_iter ( ) . rev ( ) {
62
+ if adjustment. source == adjustment. target {
63
+ continue ;
64
+ }
65
+
62
66
// FIXME: Add some nicer tooltips to each of these
63
67
let text = match adjustment. kind {
64
68
Adjust :: NeverToAny if config. adjustment_hints == AdjustmentHints :: Always => {
@@ -213,4 +217,20 @@ impl Trait for Struct {}
213
217
"# ,
214
218
)
215
219
}
220
+
221
+ #[ test]
222
+ fn never_to_never_is_never_shown ( ) {
223
+ check_with_config (
224
+ InlayHintsConfig { adjustment_hints : AdjustmentHints :: Always , ..DISABLED_CONFIG } ,
225
+ r#"
226
+ fn never() -> ! {
227
+ return loop {};
228
+ }
229
+
230
+ fn or_else() {
231
+ let () = () else { return };
232
+ }
233
+ "# ,
234
+ )
235
+ }
216
236
}
You can’t perform that action at this time.
0 commit comments