mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 02:00:00 +03:00
Do not show ::constructor on tuple struct diagnostics
This commit is contained in:
@@ -175,7 +175,6 @@ pub fn push_item_path<T>(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<T>(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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,6 @@ fn main() {
|
||||
match s {
|
||||
S{0: a, 0x1: b, ..} => {}
|
||||
//~^ ERROR does not have a field named `0x1`
|
||||
//~| NOTE struct `S::{{constructor}}` does not have field `0x1`
|
||||
//~| NOTE struct `S` does not have field `0x1`
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user