56 lines
1.9 KiB
Text
56 lines
1.9 KiB
Text
warning: function cannot return without recursing
|
|
--> $DIR/recursive-in-exhaustiveness.rs:17:1
|
|
|
|
|
LL | fn build<T>(x: T) -> impl Sized {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
|
|
LL |
|
|
LL | let (x,) = (build(x),);
|
|
| -------- recursive call site
|
|
|
|
|
= help: a `loop` may express intention better if this is on purpose
|
|
= note: `#[warn(unconditional_recursion)]` on by default
|
|
|
|
warning: function cannot return without recursing
|
|
--> $DIR/recursive-in-exhaustiveness.rs:27:1
|
|
|
|
|
LL | fn build2<T>(x: T) -> impl Sized {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
|
|
...
|
|
LL | let (x,) = (build2(x),);
|
|
| --------- recursive call site
|
|
|
|
|
= help: a `loop` may express intention better if this is on purpose
|
|
|
|
error[E0720]: cannot resolve opaque type
|
|
--> $DIR/recursive-in-exhaustiveness.rs:27:23
|
|
|
|
|
LL | fn build2<T>(x: T) -> impl Sized {
|
|
| ^^^^^^^^^^ recursive opaque type
|
|
...
|
|
LL | (build2(x),)
|
|
| ------------ returning here with type `(impl Sized,)`
|
|
|
|
warning: function cannot return without recursing
|
|
--> $DIR/recursive-in-exhaustiveness.rs:40:1
|
|
|
|
|
LL | fn build3<T>(x: T) -> impl Sized {
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
|
|
LL |
|
|
LL | let (x,) = (build3((x,)),);
|
|
| ------------ recursive call site
|
|
|
|
|
= help: a `loop` may express intention better if this is on purpose
|
|
|
|
error[E0792]: expected generic type parameter, found `(T,)`
|
|
--> $DIR/recursive-in-exhaustiveness.rs:49:5
|
|
|
|
|
LL | fn build3<T>(x: T) -> impl Sized {
|
|
| - this generic parameter must be used with a generic type parameter
|
|
...
|
|
LL | build3(x)
|
|
| ^^^^^^^^^
|
|
|
|
error: aborting due to 2 previous errors; 3 warnings emitted
|
|
|
|
Some errors have detailed explanations: E0720, E0792.
|
|
For more information about an error, try `rustc --explain E0720`.
|