mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-15 20:45:45 +03:00
Auto merge of #45647 - nrc:rls-bugs, r=eddyb
save-analysis: support unions r? @eddyb
This commit is contained in:
@@ -558,8 +558,13 @@ fn process_struct(&mut self,
|
||||
|
||||
if !self.span.filter_generated(sub_span, item.span) {
|
||||
let span = self.span_from_span(sub_span.expect("No span found for struct"));
|
||||
let kind = match item.node {
|
||||
ast::ItemKind::Struct(_, _) => DefKind::Struct,
|
||||
ast::ItemKind::Union(_, _) => DefKind::Union,
|
||||
_ => unreachable!(),
|
||||
};
|
||||
self.dumper.dump_def(item.vis == ast::Visibility::Public, Def {
|
||||
kind: DefKind::Struct,
|
||||
kind,
|
||||
id: ::id_from_node_id(item.id, &self.save_ctxt),
|
||||
span,
|
||||
name,
|
||||
@@ -1216,7 +1221,9 @@ fn visit_item(&mut self, item: &'l ast::Item) {
|
||||
self.process_static_or_const_item(item, typ, expr),
|
||||
Const(ref typ, ref expr) =>
|
||||
self.process_static_or_const_item(item, &typ, &expr),
|
||||
Struct(ref def, ref ty_params) => self.process_struct(item, def, ty_params),
|
||||
Struct(ref def, ref ty_params) | Union(ref def, ref ty_params) => {
|
||||
self.process_struct(item, def, ty_params)
|
||||
}
|
||||
Enum(ref def, ref ty_params) => self.process_enum(item, def, ty_params),
|
||||
Impl(..,
|
||||
ref ty_params,
|
||||
|
||||
@@ -441,6 +441,11 @@ fn test_format_args() {
|
||||
print!("x is {}, y is {1}, name is {n}", x, y, n = name);
|
||||
}
|
||||
|
||||
|
||||
union TestUnion {
|
||||
f1: u32
|
||||
}
|
||||
|
||||
struct FrameBuffer;
|
||||
|
||||
struct SilenceGenerator;
|
||||
|
||||
Reference in New Issue
Block a user