File tree 1 file changed +8
-2
lines changed
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ Example:
22
22
println!("Hello world!");
23
23
}
24
24
}
25
- pub use foo::bar as main;
25
+ use foo::bar as main;
26
26
27
27
Example 2:
28
28
@@ -32,11 +32,17 @@ Example 2:
32
32
See also https://github.com/rust-lang/rust/issues/27640 for the corresponding
33
33
issue discussion.
34
34
35
+ The ` #[main] ` attribute can also be used to change the entry point of the
36
+ generated binary. This is largely irrelevant for this RFC as this RFC tries to
37
+ fix an inconsistency with re-exports and directly defined functions.
38
+ Nevertheless, it can be pointed out that the ` #[main] ` attribute does not cover
39
+ all the above-mentioned use cases.
40
+
35
41
# Detailed design
36
42
37
43
Use the symbol ` main ` at the top-level of a crate that is compiled as a program
38
44
(` --crate-type=bin ` ) – instead of explicitly only accepting directly-defined
39
- functions, also allow re-exports.
45
+ functions, also allow (possibly non- ` pub ` ) re-exports.
40
46
41
47
# Drawbacks
42
48
You can’t perform that action at this time.
0 commit comments