fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.2 KiB60 linesraw
1error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time
2  --> $DIR/feature-gate-unsized_fn_params.rs:17:8
3   |
4LL | fn foo(x: dyn Foo) {
5   |        ^ doesn't have a size known at compile-time
6   |
7   = help: the trait `Sized` is not implemented for `(dyn Foo + 'static)`
8   = help: unsized fn params are gated as an unstable feature
9help: you can use `impl Trait` as the argument type
10   |
11LL | fn foo(x: impl Foo) {
12   |           ~~~~
13help: function arguments must have a statically known size, borrowed types always have a known size
14   |
15LL | fn foo(x: &dyn Foo) {
16   |           +
17
18error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time
19  --> $DIR/feature-gate-unsized_fn_params.rs:21:8
20   |
21LL | fn bar(x: Foo) {
22   |        ^ doesn't have a size known at compile-time
23   |
24   = help: the trait `Sized` is not implemented for `(dyn Foo + 'static)`
25   = help: unsized fn params are gated as an unstable feature
26help: you can use `impl Trait` as the argument type
27   |
28LL | fn bar(x: impl Foo) {
29   |           ++++
30help: function arguments must have a statically known size, borrowed types always have a known size
31   |
32LL | fn bar(x: &Foo) {
33   |           +
34
35error[E0277]: the size for values of type `[()]` cannot be known at compilation time
36  --> $DIR/feature-gate-unsized_fn_params.rs:25:8
37   |
38LL | fn qux(_: [()]) {}
39   |        ^ doesn't have a size known at compile-time
40   |
41   = help: the trait `Sized` is not implemented for `[()]`
42   = help: unsized fn params are gated as an unstable feature
43help: function arguments must have a statically known size, borrowed types always have a known size
44   |
45LL | fn qux(_: &[()]) {}
46   |           +
47
48error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time
49  --> $DIR/feature-gate-unsized_fn_params.rs:29:9
50   |
51LL |     foo(*x);
52   |         ^^ doesn't have a size known at compile-time
53   |
54   = help: the trait `Sized` is not implemented for `(dyn Foo + 'static)`
55   = note: all function arguments must have a statically known size
56   = help: unsized fn params are gated as an unstable feature
57
58error: aborting due to 4 previous errors
59
60For more information about this error, try `rustc --explain E0277`.