Workaround ICE with if-let and RFC 2229
This commit is contained in:
parent
db1fb85cff
commit
440d9372a2
2 changed files with 8 additions and 9 deletions
|
@ -1028,15 +1028,13 @@ impl HandlerInner {
|
||||||
let mut error_codes = self
|
let mut error_codes = self
|
||||||
.emitted_diagnostic_codes
|
.emitted_diagnostic_codes
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|x| {
|
.filter_map(|x| match &x {
|
||||||
match &x {
|
|
||||||
DiagnosticId::Error(s)
|
DiagnosticId::Error(s)
|
||||||
if let Ok(Some(_explanation)) = registry.try_find_description(s) =>
|
if registry.try_find_description(s).map_or(false, |o| o.is_some()) =>
|
||||||
{
|
{
|
||||||
Some(s.clone())
|
Some(s.clone())
|
||||||
}
|
}
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
if !error_codes.is_empty() {
|
if !error_codes.is_empty() {
|
||||||
|
|
|
@ -2417,13 +2417,14 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||||
let substs = InternalSubsts::for_item(tcx, def_id, |param, _| {
|
let substs = InternalSubsts::for_item(tcx, def_id, |param, _| {
|
||||||
if let Some(i) = (param.index as usize).checked_sub(generics.parent_count) {
|
if let Some(i) = (param.index as usize).checked_sub(generics.parent_count) {
|
||||||
// Our own parameters are the resolved lifetimes.
|
// Our own parameters are the resolved lifetimes.
|
||||||
match param.kind {
|
if let GenericParamDefKind::Lifetime = param.kind {
|
||||||
GenericParamDefKind::Lifetime
|
if let hir::GenericArg::Lifetime(lifetime) = &lifetimes[i] {
|
||||||
if let hir::GenericArg::Lifetime(lifetime) = &lifetimes[i] =>
|
|
||||||
{
|
|
||||||
self.ast_region_to_region(lifetime, None).into()
|
self.ast_region_to_region(lifetime, None).into()
|
||||||
|
} else {
|
||||||
|
bug!()
|
||||||
}
|
}
|
||||||
_ => bug!(),
|
} else {
|
||||||
|
bug!()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
match param.kind {
|
match param.kind {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue