mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-25 11:29:22 +00:00
Fix panic in displaying unsized structs
This commit is contained in:
parent
6fbf6ef514
commit
1dd76e8a9d
2 changed files with 34 additions and 1 deletions
|
@ -4525,6 +4525,26 @@ const FOO$0: Tree = {
|
|||
```
|
||||
"#]],
|
||||
);
|
||||
// FIXME: Show the data of unsized structs
|
||||
check(
|
||||
r#"
|
||||
//- minicore: slice, index, coerce_unsized, transmute
|
||||
#[repr(transparent)]
|
||||
struct S<T: ?Sized>(T);
|
||||
const FOO$0: &S<[u8]> = core::mem::transmute::<&[u8], _>(&[1, 2, 3]);
|
||||
"#,
|
||||
expect![[r#"
|
||||
*FOO*
|
||||
|
||||
```rust
|
||||
test
|
||||
```
|
||||
|
||||
```rust
|
||||
const FOO: &S<[u8]> = &S
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue