Auto merge of #17394 - Veykril:recurse-fix, r=Veykril

fix: Fix `HirDisplay` stackoverflow for parameter Self defaults

Fixes https://github.com/rust-lang/rust-analyzer/issues/10932
This commit is contained in:
bors 2024-06-11 15:05:26 +00:00
commit c07076b35c
2 changed files with 48 additions and 16 deletions

View file

@ -709,4 +709,25 @@ fn main() {
"#,
)
}
// regression test for a stackoverflow in hir display code
#[test]
fn adjustment_hints_method_call_on_impl_trait_self() {
check_with_config(
InlayHintsConfig { adjustment_hints: AdjustmentHints::Always, ..DISABLED_CONFIG },
r#"
//- minicore: slice, coerce_unsized
trait T<RHS = Self> {}
fn hello(it: &&[impl T]) {
it.len();
//^^(
//^^&
//^^*
//^^*
//^^)
}
"#,
);
}
}