Fix binding mode problems
This commit is contained in:
parent
e1819a889a
commit
3d5438accd
67 changed files with 154 additions and 181 deletions
|
@ -106,7 +106,7 @@ fn anon_const_type_of<'tcx>(icx: &ItemCtxt<'tcx>, def_id: LocalDefId) -> Ty<'tcx
|
|||
}
|
||||
}
|
||||
}
|
||||
Node::Variant(Variant { disr_expr: Some(ref e), .. }) if e.hir_id == hir_id => {
|
||||
Node::Variant(Variant { disr_expr: Some(e), .. }) if e.hir_id == hir_id => {
|
||||
tcx.adt_def(tcx.hir_get_parent_item(hir_id)).repr().discr_type().to_ty(tcx)
|
||||
}
|
||||
// Sort of affects the type system, but only for the purpose of diagnostics
|
||||
|
|
|
@ -1226,11 +1226,10 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
|
|||
adt_def.variants().iter().find(|s| s.name == variant_name)
|
||||
{
|
||||
let mut suggestion = vec![(assoc_ident.span, variant_name.to_string())];
|
||||
if let hir::Node::Stmt(hir::Stmt {
|
||||
kind: hir::StmtKind::Semi(ref expr),
|
||||
..
|
||||
if let hir::Node::Stmt(&hir::Stmt {
|
||||
kind: hir::StmtKind::Semi(expr), ..
|
||||
})
|
||||
| hir::Node::Expr(ref expr) = tcx.parent_hir_node(hir_ref_id)
|
||||
| hir::Node::Expr(expr) = tcx.parent_hir_node(hir_ref_id)
|
||||
&& let hir::ExprKind::Struct(..) = expr.kind
|
||||
{
|
||||
match variant.ctor {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue