---
id: IR-16
title: "plexus-macros: emit #[allow(deprecated)] in generated plugin_schema() body when it calls deprecated plugin_children"
status: Complete
type: implementation
blocked_by: [IR-4]
unlocks: []
severity: Low
target_repo: plexus-macros
---

## Problem

IR-4 marked `PluginSchema::is_hub()` and hand-written `plugin_children()` overrides as `#[deprecated]`. The macro-generated `plugin_schema()` body calls `self.plugin_children()` to assemble the `Vec<ChildSummary>` — which means every post-IR activation's generated code triggers a `use of deprecated method` warning at build time.

IR-8's Solar migration hit this exact issue: the ticket predicted `plexus-macros` would carry `#[allow(deprecated)]` on its emission, but inspection of the plexus-macros source showed no such allow. As a workaround, IR-8 added `#![allow(deprecated)]` at the Solar module scope — a module-wide hammer that also suppresses legitimate deprecation warnings in unrelated code inside the same module.

The correct fix is in plexus-macros: when the macro emits the `plugin_schema()` body that calls `self.plugin_children()`, wrap that specific call in `#[allow(deprecated)]`. Also for any `self.is_hub()` calls or `ChildCapabilities` references the generated code makes.

## Context

The macro-generated code reads Solar's (and every other post-IR activation's) deprecated accessors. The downstream consumer can't annotate macro-emitted code per-call-site — they only see the `#[plexus_macros::activation]` attribute, not the generated tokens.

Relevant files:
- `plexus-macros/src/codegen/activation.rs` — `plugin_schema()` body generation. Around line 120–190 in the current tree (per IR-3's context notes); grep for `plugin_children` and `is_hub`.

## Required behavior

Every generated call-site in plexus-macros codegen that references a deprecated plexus-core surface must wrap itself in `#[allow(deprecated)]` (or the nearest-available suppression mechanism in Rust macros):

```rust
// Instead of:
children: self.plugin_children(),

// Emit:
children: {
    #[allow(deprecated)]
    self.plugin_children()
},
```

Or equivalent. The goal: post-IR activations do NOT need module-level `#![allow(deprecated)]` to compile without deprecation warnings stemming from the macro's own output.

## What must NOT change

- Behavior of the generated `plugin_schema()` body is unchanged (same fields populated, same output).
- User-written deprecated-field accesses STILL emit warnings. Only macro-emitted calls are silenced.
- All existing plexus-macros fixtures continue to pass.

## Acceptance criteria

1. `cargo build -p plexus-macros` and `cargo test -p plexus-macros` pass.
2. In a fixture activation with no user-written `#[allow(deprecated)]` anywhere, `cargo build -p fixture` emits ZERO `use of deprecated X` warnings where X is any symbol the plexus-macros generated code touches.
3. Solar in substrate can drop its module-level `#![allow(deprecated)]` (added by IR-8) and still build without deprecation warnings. This cleanup lands in a substrate-side follow-up PR; the acceptance check here is that the plexus-macros-generated code compiles cleanly.
4. User-written deprecated-field access in a non-macro-generated site still emits a warning (`#[allow(deprecated)]` suppression is narrowly scoped to the macro's own emissions).

## Completion

PR against plexus-macros. CI green. Status flipped to Complete in the same commit. Substrate follow-up (removing Solar's module-level `#![allow(deprecated)]`) tracked as a separate tiny cleanup.
