summaryrefslogtreecommitdiffstats
path: root/tests/ui/generator/generator-yielding-or-returning-itself.stderr
blob: a26dbf3f27c466aa8c1c3a30a76e69fc38d15b25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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]`
  --> $DIR/generator-yielding-or-returning-itself.rs:15:34
   |
LL |       want_cyclic_generator_return(|| {
   |  _____----------------------------_^
   | |     |
   | |     required by a bound introduced by this call
LL | |
LL | |         if false { yield None.unwrap(); }
LL | |         None.unwrap()
LL | |     })
   | |_____^ cyclic type of infinite size
   |
   = note: closures cannot capture themselves or take themselves as argument;
           this error may be the result of a recent compiler bug-fix,
           see issue #46062 <https://github.com/rust-lang/rust/issues/46062>
           for more information
note: required by a bound in `want_cyclic_generator_return`
  --> $DIR/generator-yielding-or-returning-itself.rs:10:36
   |
LL | pub fn want_cyclic_generator_return<T>(_: T)
   |        ---------------------------- required by a bound in this function
LL |     where T: Generator<Yield = (), Return = T>
   |                                    ^^^^^^^^^^ required by this bound in `want_cyclic_generator_return`

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]`
  --> $DIR/generator-yielding-or-returning-itself.rs:28:33
   |
LL |       want_cyclic_generator_yield(|| {
   |  _____---------------------------_^
   | |     |
   | |     required by a bound introduced by this call
LL | |
LL | |         if false { yield None.unwrap(); }
LL | |         None.unwrap()
LL | |     })
   | |_____^ cyclic type of infinite size
   |
   = note: closures cannot capture themselves or take themselves as argument;
           this error may be the result of a recent compiler bug-fix,
           see issue #46062 <https://github.com/rust-lang/rust/issues/46062>
           for more information
note: required by a bound in `want_cyclic_generator_yield`
  --> $DIR/generator-yielding-or-returning-itself.rs:23:24
   |
LL | pub fn want_cyclic_generator_yield<T>(_: T)
   |        --------------------------- required by a bound in this function
LL |     where T: Generator<Yield = T, Return = ()>
   |                        ^^^^^^^^^ required by this bound in `want_cyclic_generator_yield`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0271`.