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(
5959 } ) ;
6060 }
6161 for adjustment in adjustments. into_iter ( ) . rev ( ) {
62+ if adjustment. source == adjustment. target {
63+ continue ;
64+ }
65+
6266 // FIXME: Add some nicer tooltips to each of these
6367 let text = match adjustment. kind {
6468 Adjust :: NeverToAny if config. adjustment_hints == AdjustmentHints :: Always => {
@@ -213,4 +217,20 @@ impl Trait for Struct {}
213217"# ,
214218 )
215219 }
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+ }
216236}
You can’t perform that action at this time.
0 commit comments