X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc%2Fty%2Fitem_path.rs;h=eb31dfba4a4d8e14e2ae10534dff4935cc4d2657;hb=79b05fee0fd1423a49e9655d554eec7bfebb0e87;hp=9aa2caadd1d37911acc8924f3992f65147c0d3c6;hpb=54ef80043a3864495555c96791118ab3a725fe6b;p=rust.git diff --git a/src/librustc/ty/item_path.rs b/src/librustc/ty/item_path.rs index 9aa2caadd1d..eb31dfba4a4 100644 --- a/src/librustc/ty/item_path.rs +++ b/src/librustc/ty/item_path.rs @@ -175,7 +175,6 @@ pub fn push_item_path(self, buffer: &mut T, def_id: DefId) data @ DefPathData::LifetimeDef(..) | data @ DefPathData::EnumVariant(..) | data @ DefPathData::Field(..) | - data @ DefPathData::StructCtor | data @ DefPathData::Initializer | data @ DefPathData::MacroDef(..) | data @ DefPathData::ClosureExpr | @@ -186,6 +185,10 @@ pub fn push_item_path(self, buffer: &mut T, def_id: DefId) self.push_item_path(buffer, parent_def_id); buffer.push(&data.as_interned_str()); } + DefPathData::StructCtor => { // present `X` instead of `X::{{constructor}}` + let parent_def_id = self.parent_def_id(def_id).unwrap(); + self.push_item_path(buffer, parent_def_id); + } } }