diff options
| author | Michael Goulet <michael@errs.io> | 2025-02-23 23:01:04 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-03-06 17:34:17 +0000 |
| commit | ef031c854da6432c86ac14c438ab96c7e349d85f (patch) | |
| tree | 1dfab8c17e41decabcbd431c05e57a83ec849936 /compiler/rustc_mir_transform/src/lib.rs | |
| parent | c867b8f11dbf0be397ba9b5c898fde95f8d5ea6c (diff) | |
| download | rust-ef031c854da6432c86ac14c438ab96c7e349d85f.tar.gz rust-ef031c854da6432c86ac14c438ab96c7e349d85f.zip | |
Exclude global_asm from mir_keys
Diffstat (limited to 'compiler/rustc_mir_transform/src/lib.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/lib.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs index 5df12ac4d8b..8aa14d15644 100644 --- a/compiler/rustc_mir_transform/src/lib.rs +++ b/compiler/rustc_mir_transform/src/lib.rs @@ -316,6 +316,10 @@ fn mir_keys(tcx: TyCtxt<'_>, (): ()) -> FxIndexSet<LocalDefId> { // All body-owners have MIR associated with them. let mut set: FxIndexSet<_> = tcx.hir_body_owners().collect(); + // Remove the fake bodies for `global_asm!`, since they're not useful + // to be emitted (`--emit=mir`) or encoded (in metadata). + set.retain(|&def_id| !matches!(tcx.def_kind(def_id), DefKind::GlobalAsm)); + // Coroutine-closures (e.g. async closures) have an additional by-move MIR // body that isn't in the HIR. for body_owner in tcx.hir_body_owners() { |
