]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/issues/issue-5883.stderr
Suggest borrowing in more unsized fn param cases
[rust.git] / src / test / ui / issues / issue-5883.stderr
index 149d882af78ffd8632488454fc4cff4fc30e4653..897984d0ae410eb483502ad901f698e0d9e55336 100644 (file)
@@ -5,8 +5,11 @@ LL | fn new_struct(r: dyn A + 'static)
    |               ^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `(dyn A + 'static)`
-   = note: all local variables must have a statically known size
    = help: unsized locals are gated as an unstable feature
+help: function arguments must have a statically known size, borrowed types always have a known size
+   |
+LL | fn new_struct(r: &dyn A + 'static)
+   |                  ^
 
 error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time
   --> $DIR/issue-5883.rs:8:8