diff options
| author | Shoyu Vanilla (Flint) <modulo641@gmail.com> | 2025-07-11 19:32:53 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-11 19:32:53 +0000 |
| commit | c4e8c34682653f8fa4829a576df74493c856cd9b (patch) | |
| tree | 07d1a49bca5e2cc58905947837a58c1c0ea2a867 /src/tools/rust-analyzer/crates/ide | |
| parent | 928bfbf2f2d5e819eeca4d3bb2d456838ec7833b (diff) | |
| parent | f15dfa85cc77df29b40c6b68328780c9075e09c2 (diff) | |
Merge pull request #20232 from ShoyuVanilla/issue-20225
fix: Normalize projection types before calculating memory maps
Diffstat (limited to 'src/tools/rust-analyzer/crates/ide')
| -rw-r--r-- | src/tools/rust-analyzer/crates/ide/src/hover/tests.rs | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/tools/rust-analyzer/crates/ide/src/hover/tests.rs b/src/tools/rust-analyzer/crates/ide/src/hover/tests.rs index c3afd7da2df..c5480217a91 100644 --- a/src/tools/rust-analyzer/crates/ide/src/hover/tests.rs +++ b/src/tools/rust-analyzer/crates/ide/src/hover/tests.rs @@ -10985,3 +10985,41 @@ fn has_docs$0() {} "#]], ); } + +#[test] +fn regression_20225() { + check( + r#" +//- minicore: coerce_unsized +trait Trait { + type Type<'a, T: ?Sized + 'a>; +} + +enum Borrowed {} + +impl Trait for Borrowed { + type Type<'a, T: ?Sized + 'a> = &'a T; +} + +enum Enum<'a, T: Trait + 'a> { + Variant1(T::Type<'a, [Enum<'a, T>]>), + Variant2, +} + +impl Enum<'_, Borrowed> { + const CONSTANT$0: Self = Self::Variant1(&[Self::Variant2]); +} + "#, + expect![[r#" + *CONSTANT* + + ```rust + ra_test_fixture::Enum + ``` + + ```rust + const CONSTANT: Self = Variant1(&[Variant2]) + ``` + "#]], + ); +} |
