|
| 1 | +error[E0277]: the size for values of type `str` cannot be known at compilation time |
| 2 | + --> $DIR/unsized-return-suggest-ref-issue-152064.rs:7:16 |
| 3 | + | |
| 4 | +LL | for s in o.map(|s| s[3..8]) {} |
| 5 | + | ^^^ doesn't have a size known at compile-time |
| 6 | + | |
| 7 | + = help: the trait `Sized` is not implemented for `str` |
| 8 | +note: required by an implicit `Sized` bound in `Option::<T>::map` |
| 9 | + --> $SRC_DIR/core/src/option.rs:LL:COL |
| 10 | + |
| 11 | +error[E0277]: the size for values of type `str` cannot be known at compilation time |
| 12 | + --> $DIR/unsized-return-suggest-ref-issue-152064.rs:7:24 |
| 13 | + | |
| 14 | +LL | for s in o.map(|s| s[3..8]) {} |
| 15 | + | ^^^^^^^ doesn't have a size known at compile-time |
| 16 | + | |
| 17 | + = help: the trait `Sized` is not implemented for `str` |
| 18 | + = note: the return type of a function must have a statically known size |
| 19 | +help: consider borrowing the value |
| 20 | + | |
| 21 | +LL | for s in o.map(|s| &s[3..8]) {} |
| 22 | + | + |
| 23 | + |
| 24 | +error[E0277]: the size for values of type `str` cannot be known at compilation time |
| 25 | + --> $DIR/unsized-return-suggest-ref-issue-152064.rs:7:14 |
| 26 | + | |
| 27 | +LL | for s in o.map(|s| s[3..8]) {} |
| 28 | + | ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time |
| 29 | + | |
| 30 | + = help: the trait `Sized` is not implemented for `str` |
| 31 | +note: required by an implicit `Sized` bound in `Option` |
| 32 | + --> $SRC_DIR/core/src/option.rs:LL:COL |
| 33 | + |
| 34 | +error[E0277]: `Option<str>` is not an iterator |
| 35 | + --> $DIR/unsized-return-suggest-ref-issue-152064.rs:7:14 |
| 36 | + | |
| 37 | +LL | for s in o.map(|s| s[3..8]) {} |
| 38 | + | ^^^^^^^^^^^^^^^^^^ `Option<str>` is not an iterator |
| 39 | + | |
| 40 | + = help: the trait `IntoIterator` is not implemented for `Option<str>` |
| 41 | +help: the following other types implement trait `IntoIterator` |
| 42 | + --> $SRC_DIR/core/src/option.rs:LL:COL |
| 43 | + | |
| 44 | + = note: `Option<T>` |
| 45 | + ::: $SRC_DIR/core/src/option.rs:LL:COL |
| 46 | + | |
| 47 | + = note: `&Option<T>` |
| 48 | + ::: $SRC_DIR/core/src/option.rs:LL:COL |
| 49 | + | |
| 50 | + = note: `&mut Option<T>` |
| 51 | + |
| 52 | +error[E0277]: the size for values of type `[u8]` cannot be known at compilation time |
| 53 | + --> $DIR/unsized-return-suggest-ref-issue-152064.rs:15:18 |
| 54 | + | |
| 55 | +LL | for s in arr.map(|s| s[3..8]) {} |
| 56 | + | ^^^ doesn't have a size known at compile-time |
| 57 | + | |
| 58 | + = help: the trait `Sized` is not implemented for `[u8]` |
| 59 | +note: required by an implicit `Sized` bound in `Option::<T>::map` |
| 60 | + --> $SRC_DIR/core/src/option.rs:LL:COL |
| 61 | + |
| 62 | +error[E0277]: the size for values of type `[u8]` cannot be known at compilation time |
| 63 | + --> $DIR/unsized-return-suggest-ref-issue-152064.rs:15:26 |
| 64 | + | |
| 65 | +LL | for s in arr.map(|s| s[3..8]) {} |
| 66 | + | ^^^^^^^ doesn't have a size known at compile-time |
| 67 | + | |
| 68 | + = help: the trait `Sized` is not implemented for `[u8]` |
| 69 | + = note: the return type of a function must have a statically known size |
| 70 | +help: consider borrowing the value |
| 71 | + | |
| 72 | +LL | for s in arr.map(|s| &s[3..8]) {} |
| 73 | + | + |
| 74 | + |
| 75 | +error[E0277]: the size for values of type `[u8]` cannot be known at compilation time |
| 76 | + --> $DIR/unsized-return-suggest-ref-issue-152064.rs:15:14 |
| 77 | + | |
| 78 | +LL | for s in arr.map(|s| s[3..8]) {} |
| 79 | + | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time |
| 80 | + | |
| 81 | + = help: the trait `Sized` is not implemented for `[u8]` |
| 82 | +note: required by an implicit `Sized` bound in `Option` |
| 83 | + --> $SRC_DIR/core/src/option.rs:LL:COL |
| 84 | + |
| 85 | +error[E0277]: `Option<[u8]>` is not an iterator |
| 86 | + --> $DIR/unsized-return-suggest-ref-issue-152064.rs:15:14 |
| 87 | + | |
| 88 | +LL | for s in arr.map(|s| s[3..8]) {} |
| 89 | + | ^^^^^^^^^^^^^^^^^^^^ `Option<[u8]>` is not an iterator |
| 90 | + | |
| 91 | + = help: the trait `IntoIterator` is not implemented for `Option<[u8]>` |
| 92 | +help: the following other types implement trait `IntoIterator` |
| 93 | + --> $SRC_DIR/core/src/option.rs:LL:COL |
| 94 | + | |
| 95 | + = note: `Option<T>` |
| 96 | + ::: $SRC_DIR/core/src/option.rs:LL:COL |
| 97 | + | |
| 98 | + = note: `&Option<T>` |
| 99 | + ::: $SRC_DIR/core/src/option.rs:LL:COL |
| 100 | + | |
| 101 | + = note: `&mut Option<T>` |
| 102 | + |
| 103 | +error: aborting due to 8 previous errors |
| 104 | + |
| 105 | +For more information about this error, try `rustc --explain E0277`. |
0 commit comments