Skip to content

Commit 8862fe6

Browse files
committed
Fix assertion failure in type inference (rust-lang#13352)
1 parent 476d043 commit 8862fe6

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

crates/hir/src/lib.rs

+4
Original file line numberDiff line numberDiff line change
@@ -2807,6 +2807,10 @@ impl Type {
28072807
let subst = TyBuilder::subst_for_def(db, id, None).fill_with_unknown().build();
28082808
Some(subst)
28092809
}
2810+
ItemContainerId::ImplId(id) => {
2811+
let subst = TyBuilder::subst_for_def(db, id, None).fill_with_unknown().build();
2812+
Some(subst)
2813+
}
28102814
_ => None,
28112815
},
28122816
_ => None,

crates/ide/src/highlight_related.rs

+16
Original file line numberDiff line numberDiff line change
@@ -1373,6 +1373,22 @@ fn main() {
13731373
().func$0();
13741374
//^^^^
13751375
}
1376+
"#,
1377+
);
1378+
}
1379+
1380+
#[test]
1381+
fn test_assoc_type_highlighting() {
1382+
check(
1383+
r#"
1384+
trait Trait {
1385+
type Output;
1386+
// ^^^^^^
1387+
}
1388+
impl Trait for () {
1389+
type Output$0 = ();
1390+
// ^^^^^^
1391+
}
13761392
"#,
13771393
);
13781394
}

0 commit comments

Comments
 (0)