fix: Fix HirDisplay stackoverflow for parameter Self defaults

This commit is contained in:
Lukas Wirth 2024-06-11 17:03:09 +02:00
parent 72dfbe95de
commit 1ecf230792
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();
//^^(
//^^&
//^^*
//^^*
//^^)
}
"#,
);
}
}