Skip to content

Commit 595c8f9

Browse files
committed
Introduce DefPathData::AnonAssocTy.
PR rust-lang#137977 changed `DefPathData::TypeNs` to contain `Option<Symbol>` to account for RPITIT assoc types being anonymous. This commit changes it back to `Symbol` and gives anonymous assoc types their own variant. It makes things a bit nicer overall.
1 parent 328b4fa commit 595c8f9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_utils/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3502,7 +3502,7 @@ fn maybe_get_relative_path(from: &DefPath, to: &DefPath, max_super: usize) -> St
35023502
// a::b::c ::d::sym refers to
35033503
// e::f::sym:: ::
35043504
// result should be super::super::super::super::e::f
3505-
if let DefPathData::TypeNs(Some(s)) = l {
3505+
if let DefPathData::TypeNs(s) = l {
35063506
path.push(s.to_string());
35073507
}
35083508
if let DefPathData::TypeNs(_) = r {
@@ -3513,7 +3513,7 @@ fn maybe_get_relative_path(from: &DefPath, to: &DefPath, max_super: usize) -> St
35133513
// a::b::sym:: :: refers to
35143514
// c::d::e ::f::sym
35153515
// when looking at `f`
3516-
Left(DefPathData::TypeNs(Some(sym))) => path.push(sym.to_string()),
3516+
Left(DefPathData::TypeNs(sym)) => path.push(sym.to_string()),
35173517
// consider:
35183518
// a::b::c ::d::sym refers to
35193519
// e::f::sym:: ::
@@ -3527,7 +3527,7 @@ fn maybe_get_relative_path(from: &DefPath, to: &DefPath, max_super: usize) -> St
35273527
// `super` chain would be too long, just use the absolute path instead
35283528
once(String::from("crate"))
35293529
.chain(to.data.iter().filter_map(|el| {
3530-
if let DefPathData::TypeNs(Some(sym)) = el.data {
3530+
if let DefPathData::TypeNs(sym) = el.data {
35313531
Some(sym.to_string())
35323532
} else {
35333533
None

0 commit comments

Comments
 (0)