]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator-yielding-or-returning-itself.stderr
Merge branch 'master' into rusty-hermit
[rust.git] / src / test / ui / generator-yielding-or-returning-itself.stderr
1 error[E0644]: closure/generator type that references itself
2   --> $DIR/generator-yielding-or-returning-itself.rs:15:34
3    |
4 LL |       want_cyclic_generator_return(|| {
5    |  __________________________________^
6 LL | |
7 LL | |         if false { yield None.unwrap(); }
8 LL | |         None.unwrap()
9 LL | |     })
10    | |_____^ cyclic type of infinite size
11    |
12    = note: closures cannot capture themselves or take themselves as argument;
13            this error may be the result of a recent compiler bug-fix,
14            see https://github.com/rust-lang/rust/issues/46062 for more details
15
16 error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 32:6 _] as std::ops::Generator>::Yield == [generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 32:6 _]`
17   --> $DIR/generator-yielding-or-returning-itself.rs:28:5
18    |
19 LL | pub fn want_cyclic_generator_yield<T>(_: T)
20    |        ---------------------------
21 LL |     where T: Generator<Yield = T, Return = ()>
22    |                        --------- required by this bound in `want_cyclic_generator_yield`
23 ...
24 LL |     want_cyclic_generator_yield(|| {
25    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size
26    |
27    = note: closures cannot capture themselves or take themselves as argument;
28            this error may be the result of a recent compiler bug-fix,
29            see https://github.com/rust-lang/rust/issues/46062 for more details
30
31 error: aborting due to 2 previous errors
32
33 Some errors have detailed explanations: E0271, E0644.
34 For more information about an error, try `rustc --explain E0271`.