Do not ICE on AnonConst
s in diagnostic_hir_wf_check
This commit is contained in:
parent
426a698606
commit
446f78d051
4 changed files with 208 additions and 14 deletions
|
@ -163,15 +163,17 @@ fn diagnostic_hir_wf_check<'tcx>(
|
|||
kind: hir::GenericParamKind::Type { default: Some(ty), .. },
|
||||
..
|
||||
}) => vec![*ty],
|
||||
hir::Node::AnonConst(_)
|
||||
if let Some(const_param_id) =
|
||||
tcx.hir().opt_const_param_default_param_def_id(hir_id)
|
||||
hir::Node::AnonConst(_) => {
|
||||
if let Some(const_param_id) = tcx.hir().opt_const_param_default_param_def_id(hir_id)
|
||||
&& let hir::Node::GenericParam(hir::GenericParam {
|
||||
kind: hir::GenericParamKind::Const { ty, .. },
|
||||
..
|
||||
}) = tcx.hir_node_by_def_id(const_param_id) =>
|
||||
{
|
||||
vec![*ty]
|
||||
}) = tcx.hir_node_by_def_id(const_param_id)
|
||||
{
|
||||
vec![*ty]
|
||||
} else {
|
||||
vec![]
|
||||
}
|
||||
}
|
||||
ref node => bug!("Unexpected node {:?}", node),
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue