]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator-yielding-or-returning-itself.stderr
Auto merge of #62748 - luca-barbieri:optimize-refcell-borrow, r=RalfJung
[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 |     want_cyclic_generator_yield(|| {
20    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size
21    |
22    = note: closures cannot capture themselves or take themselves as argument;
23            this error may be the result of a recent compiler bug-fix,
24            see https://github.com/rust-lang/rust/issues/46062 for more details
25 note: required by `want_cyclic_generator_yield`
26   --> $DIR/generator-yielding-or-returning-itself.rs:22:1
27    |
28 LL | / pub fn want_cyclic_generator_yield<T>(_: T)
29 LL | |     where T: Generator<Yield = T, Return = ()>
30 LL | | {
31 LL | | }
32    | |_^
33
34 error: aborting due to 2 previous errors
35
36 Some errors have detailed explanations: E0271, E0644.
37 For more information about an error, try `rustc --explain E0271`.