`SuppressDisposal = true` on the generic lifetime attributes tells the
container to construct a service but not tear it down: it never calls the
instance's `Dispose`/`DisposeAsync`. On its own this is the built counterpart
of a pre-built `Instance` (ExternallyOwned — teardown belongs to you or to
something outside the container). Paired with an `OnRelease` hook it enables
pooling, where the hook returns the object to a pool instead of disposing it,
and with `Owned<T>` the rent/return cycle is bounded to a `using` block.
## Behavior
- `DisposalOf` short-circuits to `None` and `NeedsDisposal` reads `false` for a
suppressed instance, so it is never tracked for teardown and lifetime-safety
analysis (AWT118) treats it like any other non-owned service.
- AWT156 (synchronous dispose of an async-only disposable) excludes suppressed
instances — the container never disposes them, so no drain can throw on one.
- Coalescing reports AWT166 when a later registration opts into
`SuppressDisposal` the winning registration did not, consistent with how
`Eager` and the lifecycle hooks already coalesce.
- New diagnostic **AWT192**: `SuppressDisposal` on a pre-built `Instance` is a
silent no-op (the container never owns or disposes an `Instance`), so it is
rejected — mirroring AWT165 for lifecycle hooks. It is allowed on
constructor- and factory-produced registrations.
## Docs
Adds a "Suppressing disposal" section to the disposal page (ExternallyOwned
plus return-to-pool via `OnRelease` and `Owned<T>`), a note on the
lifecycle-hooks page that `OnRelease` can replace disposal, a cross-reference
from the factories page, and the AWT192 diagnostics entry.
## Tests
Runtime coverage for suppression (instance not disposed, `OnRelease` still
runs) and a full rent/return/reuse pooling round-trip through `Owned<T>`;
generator coverage for the AWT166 coalescing conflict and the AWT192 guard;
public API approvals updated for the new attribute property.
SuppressDisposal = trueon the generic lifetime attributes tells the container to construct a service but not tear it down: it never calls the instance'sDispose/DisposeAsync. On its own this is the built counterpart of a pre-builtInstance(ExternallyOwned — teardown belongs to you or to something outside the container). Paired with anOnReleasehook it enables pooling, where the hook returns the object to a pool instead of disposing it, and withOwned<T>the rent/return cycle is bounded to ausingblock.Behavior
DisposalOfshort-circuits toNoneandNeedsDisposalreadsfalsefor a suppressed instance, so it is never tracked for teardown and lifetime-safety analysis (AWT118) treats it like any other non-owned service.SuppressDisposalthe winning registration did not, consistent with howEagerand the lifecycle hooks already coalesce.SuppressDisposalon a pre-builtInstanceis a silent no-op (the container never owns or disposes anInstance), so it is rejected — mirroring AWT165 for lifecycle hooks. It is allowed on constructor- and factory-produced registrations.Docs
Adds a "Suppressing disposal" section to the disposal page (ExternallyOwned plus return-to-pool via
OnReleaseandOwned<T>), a note on the lifecycle-hooks page thatOnReleasecan replace disposal, a cross-reference from the factories page, and the AWT192 diagnostics entry.Tests
Runtime coverage for suppression (instance not disposed,
OnReleasestill runs) and a full rent/return/reuse pooling round-trip throughOwned<T>; generator coverage for the AWT166 coalescing conflict and the AWT192 guard; public API approvals updated for the new attribute property.