We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d41ee16 commit 89c91f6Copy full SHA for 89c91f6
text/0000-main-reexport.md
@@ -15,6 +15,23 @@ not for the program entry point `main`. This RFC aims to fix this inconsistency.
15
The above mentioned inconsistency means that e.g. you currently cannot use a
16
library's exported function as your main function.
17
18
+Example:
19
+
20
+ pub mod foo {
21
+ pub fn bar() {
22
+ print("Hello world!");
23
+ }
24
25
+ pub use foo::bar as main;
26
27
+Example 2:
28
29
+ extern crate main_functions;
30
+ pub use main_functions::rmdir as main;
31
32
+See also https://github.com/rust-lang/rust/issues/27640 for the corresponding
33
+issue discussion.
34
35
# Detailed design
36
37
Use the symbol `main` at the top-level of a crate that is compiled as a program
0 commit comments