We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d41ee16 commit 9148a3bCopy full SHA for 9148a3b
text/0000-main-reexport.md
@@ -15,6 +15,25 @@ 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
33
34
+See also https://github.com/rust-lang/rust/issues/27640 for the corresponding
35
+issue discussion.
36
37
# Detailed design
38
39
Use the symbol `main` at the top-level of a crate that is compiled as a program
0 commit comments