|
| 1 | +error[E0277]: the size for values of type `dyn A` cannot be known at compilation time |
| 2 | + --> $DIR/closure-return-type-must-be-sized.rs:54:5 |
| 3 | + | |
| 4 | +LL | a::foo::<fn() -> dyn A>(); |
| 5 | + | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time |
| 6 | + | |
| 7 | + = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A` |
| 8 | + = note: required because it appears within the type `fn() -> dyn A` |
| 9 | + |
| 10 | +error[E0277]: the size for values of type `dyn A` cannot be known at compilation time |
| 11 | + --> $DIR/closure-return-type-must-be-sized.rs:55:14 |
| 12 | + | |
| 13 | +LL | a::bar::<fn() -> dyn A, _>(); |
| 14 | + | ^^^^^^^^^^^^^ doesn't have a size known at compile-time |
| 15 | + | |
| 16 | + = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A` |
| 17 | + = note: required because it appears within the type `fn() -> dyn A` |
| 18 | +note: required by a bound in `a::bar` |
| 19 | + --> $DIR/closure-return-type-must-be-sized.rs:14:19 |
| 20 | + | |
| 21 | +LL | pub fn bar<F: FnOnce() -> R, R: ?Sized>() {} |
| 22 | + | ^^^^^^^^^^^^^ required by this bound in `a::bar` |
| 23 | + |
| 24 | +error[E0277]: the size for values of type `dyn A` cannot be known at compilation time |
| 25 | + --> $DIR/closure-return-type-must-be-sized.rs:56:5 |
| 26 | + | |
| 27 | +LL | a::baz::<fn() -> dyn A>(); |
| 28 | + | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time |
| 29 | + | |
| 30 | + = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A` |
| 31 | + = note: required because it appears within the type `fn() -> dyn A` |
| 32 | + |
| 33 | +error[E0277]: the size for values of type `dyn A` cannot be known at compilation time |
| 34 | + --> $DIR/closure-return-type-must-be-sized.rs:61:5 |
| 35 | + | |
| 36 | +LL | b::foo::<fn() -> dyn A>(); |
| 37 | + | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time |
| 38 | + | |
| 39 | + = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A` |
| 40 | + = note: required because it appears within the type `fn() -> dyn A` |
| 41 | + |
| 42 | +error[E0277]: the size for values of type `dyn A` cannot be known at compilation time |
| 43 | + --> $DIR/closure-return-type-must-be-sized.rs:62:14 |
| 44 | + | |
| 45 | +LL | b::bar::<fn() -> dyn A, _>(); |
| 46 | + | ^^^^^^^^^^^^^ doesn't have a size known at compile-time |
| 47 | + | |
| 48 | + = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A` |
| 49 | + = note: required because it appears within the type `fn() -> dyn A` |
| 50 | +note: required by a bound in `b::bar` |
| 51 | + --> $DIR/closure-return-type-must-be-sized.rs:28:19 |
| 52 | + | |
| 53 | +LL | pub fn bar<F: Fn() -> R, R: ?Sized>() {} |
| 54 | + | ^^^^^^^^^ required by this bound in `b::bar` |
| 55 | + |
| 56 | +error[E0277]: the size for values of type `dyn A` cannot be known at compilation time |
| 57 | + --> $DIR/closure-return-type-must-be-sized.rs:63:5 |
| 58 | + | |
| 59 | +LL | b::baz::<fn() -> dyn A>(); |
| 60 | + | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time |
| 61 | + | |
| 62 | + = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A` |
| 63 | + = note: required because it appears within the type `fn() -> dyn A` |
| 64 | + |
| 65 | +error[E0277]: the size for values of type `dyn A` cannot be known at compilation time |
| 66 | + --> $DIR/closure-return-type-must-be-sized.rs:68:5 |
| 67 | + | |
| 68 | +LL | c::foo::<fn() -> dyn A>(); |
| 69 | + | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time |
| 70 | + | |
| 71 | + = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A` |
| 72 | + = note: required because it appears within the type `fn() -> dyn A` |
| 73 | + |
| 74 | +error[E0277]: the size for values of type `dyn A` cannot be known at compilation time |
| 75 | + --> $DIR/closure-return-type-must-be-sized.rs:69:14 |
| 76 | + | |
| 77 | +LL | c::bar::<fn() -> dyn A, _>(); |
| 78 | + | ^^^^^^^^^^^^^ doesn't have a size known at compile-time |
| 79 | + | |
| 80 | + = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A` |
| 81 | + = note: required because it appears within the type `fn() -> dyn A` |
| 82 | +note: required by a bound in `c::bar` |
| 83 | + --> $DIR/closure-return-type-must-be-sized.rs:42:19 |
| 84 | + | |
| 85 | +LL | pub fn bar<F: FnMut() -> R, R: ?Sized>() {} |
| 86 | + | ^^^^^^^^^^^^ required by this bound in `c::bar` |
| 87 | + |
| 88 | +error[E0277]: the size for values of type `dyn A` cannot be known at compilation time |
| 89 | + --> $DIR/closure-return-type-must-be-sized.rs:70:5 |
| 90 | + | |
| 91 | +LL | c::baz::<fn() -> dyn A>(); |
| 92 | + | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time |
| 93 | + | |
| 94 | + = help: within `fn() -> dyn A`, the trait `Sized` is not implemented for `dyn A` |
| 95 | + = note: required because it appears within the type `fn() -> dyn A` |
| 96 | + |
| 97 | +error: aborting due to 9 previous errors |
| 98 | + |
| 99 | +For more information about this error, try `rustc --explain E0277`. |
0 commit comments