|
| 1 | +error[E0277]: the size for values of type `str` cannot be known at compilation time |
| 2 | + --> $DIR/unsized-function-parameter.rs:5:9 |
| 3 | + | |
| 4 | +LL | fn foo1(bar: str) {} |
| 5 | + | ^^^ doesn't have a size known at compile-time |
| 6 | + | |
| 7 | + = help: the trait `Sized` is not implemented for `str` |
| 8 | + = help: unsized fn params are gated as an unstable feature |
| 9 | +help: function arguments must have a statically known size, borrowed types always have a known size |
| 10 | + | |
| 11 | +LL | fn foo1(bar: &str) {} |
| 12 | + | ^ |
| 13 | + |
| 14 | +error[E0277]: the size for values of type `str` cannot be known at compilation time |
| 15 | + --> $DIR/unsized-function-parameter.rs:11:9 |
| 16 | + | |
| 17 | +LL | fn foo2(_bar: str) {} |
| 18 | + | ^^^^ doesn't have a size known at compile-time |
| 19 | + | |
| 20 | + = help: the trait `Sized` is not implemented for `str` |
| 21 | + = help: unsized fn params are gated as an unstable feature |
| 22 | +help: function arguments must have a statically known size, borrowed types always have a known size |
| 23 | + | |
| 24 | +LL | fn foo2(_bar: &str) {} |
| 25 | + | ^ |
| 26 | + |
| 27 | +error[E0277]: the size for values of type `str` cannot be known at compilation time |
| 28 | + --> $DIR/unsized-function-parameter.rs:17:9 |
| 29 | + | |
| 30 | +LL | fn foo3(_: str) {} |
| 31 | + | ^ doesn't have a size known at compile-time |
| 32 | + | |
| 33 | + = help: the trait `Sized` is not implemented for `str` |
| 34 | + = help: unsized fn params are gated as an unstable feature |
| 35 | +help: function arguments must have a statically known size, borrowed types always have a known size |
| 36 | + | |
| 37 | +LL | fn foo3(_: &str) {} |
| 38 | + | ^ |
| 39 | + |
| 40 | +error: aborting due to 3 previous errors |
| 41 | + |
| 42 | +For more information about this error, try `rustc --explain E0277`. |
0 commit comments