]> git.lizzy.rs Git - rust.git/commitdiff
fix suggestion for unsized function parameters
authorlcnr <rust@lcnr.de>
Sun, 18 Apr 2021 17:35:23 +0000 (19:35 +0200)
committerlcnr <rust@lcnr.de>
Mon, 19 Apr 2021 18:06:19 +0000 (20:06 +0200)
tests/ui/crashes/ice-6251.stderr

index 9a7cf4b0919f63bf7ca195bb240852dafd8a6880..8498c0407808d1b60950894cb8495fca0a30f787 100644 (file)
@@ -16,8 +16,8 @@ LL | fn bug<T>() -> impl Iterator<Item = [(); { |x: [u8]| x }]> {
    = help: unsized fn params are gated as an unstable feature
 help: function arguments must have a statically known size, borrowed types always have a known size
    |
-LL | fn bug<T>() -> impl Iterator<Item = [(); { |&x: [u8]| x }]> {
-   |                                             ^
+LL | fn bug<T>() -> impl Iterator<Item = [(); { |x: &[u8]| x }]> {
+   |                                                ^
 
 error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
   --> $DIR/ice-6251.rs:4:54