# 错误[E0119]: trait `Trait` 对类型 `Type` 的实现冲突

- **ID:** `rust/e0119-conflicting-implementations-of-trait`
- **领域:** rust
- **类别:** type_error
- **错误码:** `E0119`
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

两个或多个 impl 块为同一类型提供了同一 trait 的实现，或者某个实现与 blanket impl 冲突。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| rustc 1.75.0 | active | — | — |
| rustc 1.78.0 | active | — | — |
| rustc 1.80.0 | active | — | — |

## 解决方案

1. ```
   Remove the duplicate impl block. Example: keep only one `impl Trait for MyType`.
   ```
2. ```
   Use a newtype pattern to create a distinct type. Example: `struct MyWrapper(MyType);` and implement the trait for MyWrapper.
   ```
3. ```
   If the conflict is with a blanket impl, add a type constraint or use specialization (if nightly) with `default impl`. Example: `impl<T: std::fmt::Debug> Trait for T { }`.
   ```

## 无效尝试

- **** — If both impls are needed for different purposes, removing one will cause missing trait implementation errors elsewhere. (50% 失败率)
- **** — Rust doesn't have a lint to suppress conflicting impls; it's a fundamental type system error. (100% 失败率)
- **** — If the blanket impl covers the wrapper (e.g., impl<T> Trait for T), the conflict persists. (60% 失败率)
