# error[E0784]: type alias bounds are not allowed on associated type `X`

- **ID:** `rust/e0784-type-alias-bounds-on-associated-type`
- **Domain:** rust
- **Category:** type_error
- **Error Code:** `E0784`
- **Verification:** ai_generated
- **Fix Rate:** 88%

## Root Cause

Using a type alias with bounds (e.g., `type Foo = Bar + Bound`) on an associated type in a trait definition, which is syntactically ambiguous and not supported; associated types should use `trait` bounds instead.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| rustc 1.77.0 | active | — | — |
| rustc 1.79.0 | active | — | — |
| rustc 1.81.0 | active | — | — |

## Workarounds

1. **Replace the type alias with an associated type that has a trait bound in the where clause, e.g., `type Foo: Bound;`.** (90% success)
   ```
   Replace the type alias with an associated type that has a trait bound in the where clause, e.g., `type Foo: Bound;`.
   ```
2. **Remove the bound from the type alias and apply it to the trait or method where the associated type is used.** (85% success)
   ```
   Remove the bound from the type alias and apply it to the trait or method where the associated type is used.
   ```
3. **Use a separate trait to express the bound, e.g., `trait MyTrait: BoundProvider { type Foo; }` where `BoundProvider` specifies the bound.** (80% success)
   ```
   Use a separate trait to express the bound, e.g., `trait MyTrait: BoundProvider { type Foo; }` where `BoundProvider` specifies the bound.
   ```

## Dead Ends

- **** — Parentheses create a tuple type, not a bounded type alias; the compiler will then complain about wrong types. (70% fail)
- **** — Changing to a generic parameter changes the trait's design and may require propagating the generic to all implementors, which is not always desirable. (60% fail)
