]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/trait-bounds-not-on-bare-trait.stderr
Suggest borrowing in more unsized fn param cases
[rust.git] / src / test / ui / traits / trait-bounds-not-on-bare-trait.stderr
1 warning: trait objects without an explicit `dyn` are deprecated
2   --> $DIR/trait-bounds-not-on-bare-trait.rs:7:12
3    |
4 LL | fn foo(_x: Foo + Send) {
5    |            ^^^^^^^^^^ help: use `dyn`: `dyn Foo + Send`
6    |
7    = note: `#[warn(bare_trait_objects)]` on by default
8
9 error[E0277]: the size for values of type `(dyn Foo + std::marker::Send + 'static)` cannot be known at compilation time
10   --> $DIR/trait-bounds-not-on-bare-trait.rs:7:8
11    |
12 LL | fn foo(_x: Foo + Send) {
13    |        ^^ doesn't have a size known at compile-time
14    |
15    = help: the trait `std::marker::Sized` is not implemented for `(dyn Foo + std::marker::Send + 'static)`
16    = help: unsized locals are gated as an unstable feature
17 help: function arguments must have a statically known size, borrowed types always have a known size
18    |
19 LL | fn foo(_x: &Foo + Send) {
20    |            ^
21
22 error: aborting due to previous error; 1 warning emitted
23
24 For more information about this error, try `rustc --explain E0277`.