if !ctx.is_trivial_path {
return;
}
- if ctx.record_lit_syntax.is_some()
- || ctx.record_pat_syntax.is_some()
- || ctx.attribute_under_caret.is_some()
- || ctx.mod_declaration_under_caret.is_some()
- {
+ if ctx.is_path_disallowed() {
return;
}
- if let Some(ty) = &ctx.expected_type {
- super::complete_enum_variants(acc, ctx, ty, |acc, ctx, variant, path| {
+ if let Some(hir::Adt::Enum(e)) =
+ ctx.expected_type.as_ref().and_then(|ty| ty.strip_references().as_adt())
+ {
+ super::complete_enum_variants(acc, ctx, e, |acc, ctx, variant, path| {
acc.add_qualified_enum_variant(ctx, variant, path)
});
}
}
}
"#,
- expect![[""]],
+ expect![[r#""#]],
);
}
}
}
"#,
- expect![[""]],
+ expect![[r#""#]],
);
}