summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0720.md
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_error_codes/src/error_codes/E0720.md')
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0720.md13
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0720.md b/compiler/rustc_error_codes/src/error_codes/E0720.md
new file mode 100644
index 000000000..40dfa484d
--- /dev/null
+++ b/compiler/rustc_error_codes/src/error_codes/E0720.md
@@ -0,0 +1,13 @@
+An `impl Trait` type expands to a recursive type.
+
+Erroneous code example:
+
+```compile_fail,E0720
+fn make_recursive_type() -> impl Sized {
+ [make_recursive_type(), make_recursive_type()]
+}
+```
+
+An `impl Trait` type must be expandable to a concrete type that contains no
+`impl Trait` types. For example the previous example tries to create an
+`impl Trait` type `T` that is equal to `[T, T]`.