Skip to content

Commit b35bc1b

Browse files
committed
Revert "rust-lang#11973 associated type is unresolved"
This reverts commit 5d1aff3.
1 parent 0b49c93 commit b35bc1b

File tree

2 files changed

+1
-50
lines changed

2 files changed

+1
-50
lines changed

crates/hir/src/source_analyzer.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -652,13 +652,7 @@ fn resolve_hir_path_(
652652
let (ty, remaining) =
653653
resolver.resolve_path_in_type_ns(db.upcast(), path.mod_path())?;
654654
match remaining {
655-
Some(remaining) if remaining > 1 => {
656-
if remaining + 1 == path.segments().len() {
657-
Some((ty, path.segments().last()))
658-
} else {
659-
None
660-
}
661-
}
655+
Some(remaining) if remaining > 1 => None,
662656
_ => Some((ty, path.segments().get(1))),
663657
}
664658
}

crates/ide/src/hover/tests.rs

-43
Original file line numberDiff line numberDiff line change
@@ -3764,49 +3764,6 @@ pub fn gimme() -> theitem::TheItem {
37643764
);
37653765
}
37663766

3767-
#[test]
3768-
fn test_hover_trait_assoc_typealias() {
3769-
check(
3770-
r#"
3771-
fn main() {}
3772-
3773-
trait T1 {
3774-
type Bar;
3775-
type Baz;
3776-
}
3777-
3778-
struct Foo;
3779-
3780-
mod t2 {
3781-
pub trait T2 {
3782-
type Bar;
3783-
}
3784-
}
3785-
3786-
use t2::T2;
3787-
3788-
impl T2 for Foo {
3789-
type Bar = String;
3790-
}
3791-
3792-
impl T1 for Foo {
3793-
type Bar = <Foo as t2::T2>::Ba$0r;
3794-
// ^^^ unresolvedReference
3795-
}
3796-
"#,
3797-
expect![[r#"
3798-
*Bar*
3799-
3800-
```rust
3801-
test::t2
3802-
```
3803-
3804-
```rust
3805-
pub type Bar
3806-
```
3807-
"#]],
3808-
);
3809-
}
38103767
#[test]
38113768
fn hover_generic_assoc() {
38123769
check(

0 commit comments

Comments
 (0)