Skip to content

Commit

Permalink
Auto merge of rust-lang#13353 - wildbook:fix_type_inference_panic, r=…
Browse files Browse the repository at this point in the history
…Veykril

Fix assertion failure in type inference (rust-lang#13352)

Fixes rust-lang/rust-analyzer#13352
  • Loading branch information
bors committed Oct 6, 2022
2 parents f2f3528 + 8862fe6 commit a415fb4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/hir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2807,6 +2807,10 @@ impl Type {
let subst = TyBuilder::subst_for_def(db, id, None).fill_with_unknown().build();
Some(subst)
}
ItemContainerId::ImplId(id) => {
let subst = TyBuilder::subst_for_def(db, id, None).fill_with_unknown().build();
Some(subst)
}
_ => None,
},
_ => None,
Expand Down
16 changes: 16 additions & 0 deletions crates/ide/src/highlight_related.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,22 @@ fn main() {
().func$0();
//^^^^
}
"#,
);
}

#[test]
fn test_assoc_type_highlighting() {
check(
r#"
trait Trait {
type Output;
// ^^^^^^
}
impl Trait for () {
type Output$0 = ();
// ^^^^^^
}
"#,
);
}
Expand Down

0 comments on commit a415fb4

Please sign in to comment.