]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0735.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0735.md
1 Type parameter defaults cannot use `Self` on structs, enums, or unions.
2
3 Erroneous code example:
4
5 ```compile_fail,E0735
6 struct Foo<X = Box<Self>> {
7     field1: Option<X>,
8     field2: Option<X>,
9 }
10 // error: type parameters cannot use `Self` in their defaults.
11 ```