Rollup merge of #63582 - JohnTitor:fix-ice-63226, r=oli-obk
Fix ICE #63226 Fixes #63226 r? @oli-obk
This commit is contained in:
commit
19d6178b8f
3 changed files with 34 additions and 0 deletions
|
|
@ -33,6 +33,9 @@ fn item_might_be_inlined(tcx: TyCtxt<'tcx>, item: &hir::Item, attrs: CodegenFnAt
|
|||
}
|
||||
|
||||
match item.node {
|
||||
hir::ItemKind::Fn(_, header, ..) if header.is_const() => {
|
||||
return true;
|
||||
}
|
||||
hir::ItemKind::Impl(..) |
|
||||
hir::ItemKind::Fn(..) => {
|
||||
let generics = tcx.generics_of(tcx.hir().local_def_id(item.hir_id));
|
||||
|
|
@ -52,6 +55,11 @@ fn method_might_be_inlined(
|
|||
if codegen_fn_attrs.requests_inline() || generics.requires_monomorphization(tcx) {
|
||||
return true
|
||||
}
|
||||
if let hir::ImplItemKind::Method(method_sig, _) = &impl_item.node {
|
||||
if method_sig.header.is_const() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
if let Some(impl_hir_id) = tcx.hir().as_local_hir_id(impl_src) {
|
||||
match tcx.hir().find(impl_hir_id) {
|
||||
Some(Node::Item(item)) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue