summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc-ui/error-in-impl-trait
diff options
context:
space:
mode:
Diffstat (limited to 'tests/rustdoc-ui/error-in-impl-trait')
-rw-r--r--tests/rustdoc-ui/error-in-impl-trait/closure.rs2
-rw-r--r--tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type-2.rs3
-rw-r--r--tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type-2.stderr17
-rw-r--r--tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type.rs3
-rw-r--r--tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type.stderr17
5 files changed, 37 insertions, 5 deletions
diff --git a/tests/rustdoc-ui/error-in-impl-trait/closure.rs b/tests/rustdoc-ui/error-in-impl-trait/closure.rs
index f1fd85bb2..628c61a6a 100644
--- a/tests/rustdoc-ui/error-in-impl-trait/closure.rs
+++ b/tests/rustdoc-ui/error-in-impl-trait/closure.rs
@@ -1,5 +1,5 @@
// check-pass
-// manually desugared version of an `async fn` (but with a closure instead of a generator)
+// manually desugared version of an `async fn` (but with a closure instead of a coroutine)
pub fn a() -> impl Fn() -> u32 {
|| content::doesnt::matter()
}
diff --git a/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type-2.rs b/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type-2.rs
index e49fe0798..7151ebd59 100644
--- a/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type-2.rs
+++ b/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type-2.rs
@@ -1,7 +1,6 @@
-// check-pass
-
pub fn f() -> impl Sized {
pub enum E {
+ //~^ ERROR: recursive type
V(E),
}
diff --git a/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type-2.stderr b/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type-2.stderr
new file mode 100644
index 000000000..edb5dfd4d
--- /dev/null
+++ b/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type-2.stderr
@@ -0,0 +1,17 @@
+error[E0072]: recursive type `f::E` has infinite size
+ --> $DIR/infinite-recursive-type-2.rs:2:5
+ |
+LL | pub enum E {
+ | ^^^^^^^^^^
+LL |
+LL | V(E),
+ | - recursive without indirection
+ |
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
+ |
+LL | V(Box<E>),
+ | ++++ +
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0072`.
diff --git a/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type.rs b/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type.rs
index 096130d77..1f8550517 100644
--- a/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type.rs
+++ b/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type.rs
@@ -1,7 +1,6 @@
-// check-pass
-
fn f() -> impl Sized {
enum E {
+ //~^ ERROR: recursive type
V(E),
}
diff --git a/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type.stderr b/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type.stderr
new file mode 100644
index 000000000..349a56941
--- /dev/null
+++ b/tests/rustdoc-ui/error-in-impl-trait/infinite-recursive-type.stderr
@@ -0,0 +1,17 @@
+error[E0072]: recursive type `f::E` has infinite size
+ --> $DIR/infinite-recursive-type.rs:2:5
+ |
+LL | enum E {
+ | ^^^^^^
+LL |
+LL | V(E),
+ | - recursive without indirection
+ |
+help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
+ |
+LL | V(Box<E>),
+ | ++++ +
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0072`.