mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
fix regression_11688_2
This commit is contained in:
parent
3bff42fd14
commit
0141f28475
2 changed files with 24 additions and 1 deletions
|
@ -712,7 +712,7 @@ impl<'a> TyLoweringContext<'a> {
|
||||||
.filter(|arg| !matches!(arg, GenericArg::Lifetime(_)))
|
.filter(|arg| !matches!(arg, GenericArg::Lifetime(_)))
|
||||||
.skip(skip)
|
.skip(skip)
|
||||||
.take(expected_num)
|
.take(expected_num)
|
||||||
.zip(def_generics.iter_id().skip(skip))
|
.zip(def_generics.iter_id().skip(parent_params + skip))
|
||||||
{
|
{
|
||||||
if let Some(x) = generic_arg_to_chalk(
|
if let Some(x) = generic_arg_to_chalk(
|
||||||
self.db,
|
self.db,
|
||||||
|
|
|
@ -1454,3 +1454,26 @@ fn regression_11688_1() {
|
||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn regression_11688_2() {
|
||||||
|
check_types(
|
||||||
|
r#"
|
||||||
|
union MaybeUninit<T> {
|
||||||
|
uninit: (),
|
||||||
|
value: T,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<T> MaybeUninit<T> {
|
||||||
|
fn uninit_array<const LEN: usize>() -> [Self; LEN] {
|
||||||
|
loop {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let x = MaybeUninit::<i32>::uninit_array::<1>();
|
||||||
|
//^ [MaybeUninit<i32>; 1]
|
||||||
|
}
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue