]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/unsized-function-parameter.rs
Rollup merge of #105172 - alexs-sh:issue-98861-fix-next, r=scottmcm
[rust.git] / tests / ui / suggestions / unsized-function-parameter.rs
1 // run-rustfix
2
3 #![allow(dead_code, unused_variables)]
4
5 fn foo1(bar: str) {}
6 //~^ ERROR the size for values of type `str` cannot be known at compilation time
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 fn foo2(_bar: str) {}
12 //~^ ERROR the size for values of type `str` cannot be known at compilation time
13 //~| HELP the trait `Sized` is not implemented for `str`
14 //~| HELP unsized fn params are gated as an unstable feature
15 //~| HELP function arguments must have a statically known size, borrowed types always have a known size
16
17 fn foo3(_: str) {}
18 //~^ ERROR the size for values of type `str` cannot be known at compilation time
19 //~| HELP the trait `Sized` is not implemented for `str`
20 //~| HELP unsized fn params are gated as an unstable feature
21 //~| HELP function arguments must have a statically known size, borrowed types always have a known size
22
23 fn main() {}