]> git.lizzy.rs Git - rust.git/blob - src/test/ui/generator/generator-yielding-or-returning-itself.stderr
Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiser
[rust.git] / src / test / ui / generator / generator-yielding-or-returning-itself.stderr
1 error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:15:34: 15:36] as Generator>::Return == [generator@$DIR/generator-yielding-or-returning-itself.rs:15:34: 15:36]`
2   --> $DIR/generator-yielding-or-returning-itself.rs:15:34
3    |
4 LL |       want_cyclic_generator_return(|| {
5    |  _____----------------------------_^
6    | |     |
7    | |     required by a bound introduced by this call
8 LL | |
9 LL | |         if false { yield None.unwrap(); }
10 LL | |         None.unwrap()
11 LL | |     })
12    | |_____^ cyclic type of infinite size
13    |
14    = note: closures cannot capture themselves or take themselves as argument;
15            this error may be the result of a recent compiler bug-fix,
16            see issue #46062 <https://github.com/rust-lang/rust/issues/46062>
17            for more information
18 note: required by a bound in `want_cyclic_generator_return`
19   --> $DIR/generator-yielding-or-returning-itself.rs:10:36
20    |
21 LL | pub fn want_cyclic_generator_return<T>(_: T)
22    |        ---------------------------- required by a bound in this
23 LL |     where T: Generator<Yield = (), Return = T>
24    |                                    ^^^^^^^^^^ required by this bound in `want_cyclic_generator_return`
25
26 error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 28:35] as Generator>::Yield == [generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 28:35]`
27   --> $DIR/generator-yielding-or-returning-itself.rs:28:33
28    |
29 LL |       want_cyclic_generator_yield(|| {
30    |  _____---------------------------_^
31    | |     |
32    | |     required by a bound introduced by this call
33 LL | |
34 LL | |         if false { yield None.unwrap(); }
35 LL | |         None.unwrap()
36 LL | |     })
37    | |_____^ cyclic type of infinite size
38    |
39    = note: closures cannot capture themselves or take themselves as argument;
40            this error may be the result of a recent compiler bug-fix,
41            see issue #46062 <https://github.com/rust-lang/rust/issues/46062>
42            for more information
43 note: required by a bound in `want_cyclic_generator_yield`
44   --> $DIR/generator-yielding-or-returning-itself.rs:23:24
45    |
46 LL | pub fn want_cyclic_generator_yield<T>(_: T)
47    |        --------------------------- required by a bound in this
48 LL |     where T: Generator<Yield = T, Return = ()>
49    |                        ^^^^^^^^^ required by this bound in `want_cyclic_generator_yield`
50
51 error: aborting due to 2 previous errors
52
53 For more information about this error, try `rustc --explain E0271`.