We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
AnonConst
1 parent 77652b9 commit cf5748fCopy full SHA for cf5748f
compiler/rustc_typeck/src/collect.rs
@@ -1558,6 +1558,18 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
1558
Node::Expr(&Expr { kind: ExprKind::ConstBlock(_), .. }) => {
1559
Some(tcx.typeck_root_def_id(def_id))
1560
}
1561
+ // Exclude `GlobalAsm` here which cannot have generics.
1562
+ Node::Expr(&Expr { kind: ExprKind::InlineAsm(asm), .. })
1563
+ if asm.operands.iter().any(|(op, _op_sp)| match op {
1564
+ hir::InlineAsmOperand::Const { anon_const }
1565
+ | hir::InlineAsmOperand::SymFn { anon_const } => {
1566
+ anon_const.hir_id == hir_id
1567
+ }
1568
+ _ => false,
1569
+ }) =>
1570
+ {
1571
+ Some(parent_def_id.to_def_id())
1572
1573
_ => None,
1574
1575
0 commit comments