summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0735.md
blob: e8268a5836ce703df6840368a5ed6e760f91554e (plain)
1
2
3
4
5
6
7
8
9
10
11
Type parameter defaults cannot use `Self` on structs, enums, or unions.

Erroneous code example:

```compile_fail,E0735
struct Foo<X = Box<Self>> {
    field1: Option<X>,
    field2: Option<X>,
}
// error: type parameters cannot use `Self` in their defaults.
```