]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/fn-body-eq-expr-semi.stderr
Add 'compiler/rustc_codegen_cranelift/' from commit '793d26047f994e23415f8f6bb5686ff2...
[rust.git] / src / test / ui / parser / fn-body-eq-expr-semi.stderr
1 error: function body cannot be `= expression;`
2   --> $DIR/fn-body-eq-expr-semi.rs:4:14
3    |
4 LL |     fn foo() = 42;
5    |              ^^^^^
6    |
7 help: surround the expression with `{` and `}` instead of `=` and `;`
8    |
9 LL |     fn foo() { 42 }
10    |              ^    ^
11
12 error: function body cannot be `= expression;`
13   --> $DIR/fn-body-eq-expr-semi.rs:5:20
14    |
15 LL |     fn bar() -> u8 = 42;
16    |                    ^^^^^
17    |
18 help: surround the expression with `{` and `}` instead of `=` and `;`
19    |
20 LL |     fn bar() -> u8 { 42 }
21    |                    ^    ^
22
23 error: function body cannot be `= expression;`
24   --> $DIR/fn-body-eq-expr-semi.rs:9:14
25    |
26 LL |     fn foo() = 42;
27    |              ^^^^^
28    |
29 help: surround the expression with `{` and `}` instead of `=` and `;`
30    |
31 LL |     fn foo() { 42 }
32    |              ^    ^
33
34 error: function body cannot be `= expression;`
35   --> $DIR/fn-body-eq-expr-semi.rs:11:20
36    |
37 LL |     fn bar() -> u8 = 42;
38    |                    ^^^^^
39    |
40 help: surround the expression with `{` and `}` instead of `=` and `;`
41    |
42 LL |     fn bar() -> u8 { 42 }
43    |                    ^    ^
44
45 error: function body cannot be `= expression;`
46   --> $DIR/fn-body-eq-expr-semi.rs:16:14
47    |
48 LL |     fn foo() = 42;
49    |              ^^^^^
50    |
51 help: surround the expression with `{` and `}` instead of `=` and `;`
52    |
53 LL |     fn foo() { 42 }
54    |              ^    ^
55
56 error: function body cannot be `= expression;`
57   --> $DIR/fn-body-eq-expr-semi.rs:17:20
58    |
59 LL |     fn bar() -> u8 = 42;
60    |                    ^^^^^
61    |
62 help: surround the expression with `{` and `}` instead of `=` and `;`
63    |
64 LL |     fn bar() -> u8 { 42 }
65    |                    ^    ^
66
67 error: function body cannot be `= expression;`
68   --> $DIR/fn-body-eq-expr-semi.rs:21:14
69    |
70 LL |     fn foo() = 42;
71    |              ^^^^^
72    |
73 help: surround the expression with `{` and `}` instead of `=` and `;`
74    |
75 LL |     fn foo() { 42 }
76    |              ^    ^
77
78 error: function body cannot be `= expression;`
79   --> $DIR/fn-body-eq-expr-semi.rs:22:20
80    |
81 LL |     fn bar() -> u8 = 42;
82    |                    ^^^^^
83    |
84 help: surround the expression with `{` and `}` instead of `=` and `;`
85    |
86 LL |     fn bar() -> u8 { 42 }
87    |                    ^    ^
88
89 error: incorrect function inside `extern` block
90   --> $DIR/fn-body-eq-expr-semi.rs:9:8
91    |
92 LL | extern {
93    | ------ `extern` blocks define existing foreign functions and functions inside of them cannot have a body
94 LL |     fn foo() = 42;
95    |        ^^^   ----- help: remove the invalid body: `;`
96    |        |
97    |        cannot have a body
98    |
99    = help: you might have meant to write a function accessible through FFI, which can be done by writing `extern fn` outside of the `extern` block
100    = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
101
102 error: incorrect function inside `extern` block
103   --> $DIR/fn-body-eq-expr-semi.rs:11:8
104    |
105 LL | extern {
106    | ------ `extern` blocks define existing foreign functions and functions inside of them cannot have a body
107 ...
108 LL |     fn bar() -> u8 = 42;
109    |        ^^^         ----- help: remove the invalid body: `;`
110    |        |
111    |        cannot have a body
112    |
113    = help: you might have meant to write a function accessible through FFI, which can be done by writing `extern fn` outside of the `extern` block
114    = note: for more information, visit https://doc.rust-lang.org/std/keyword.extern.html
115
116 error: aborting due to 10 previous errors
117