Skip to content

Commit aa533f9

Browse files
committed
Add @pnkfelix's suggestions
1 parent 2ac3284 commit aa533f9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

text/0000-main-reexport.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Example:
2222
println!("Hello world!");
2323
}
2424
}
25-
pub use foo::bar as main;
25+
use foo::bar as main;
2626

2727
Example 2:
2828

@@ -32,11 +32,17 @@ Example 2:
3232
See also https://github.com/rust-lang/rust/issues/27640 for the corresponding
3333
issue discussion.
3434

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+
3541
# Detailed design
3642

3743
Use the symbol `main` at the top-level of a crate that is compiled as a program
3844
(`--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.
4046

4147
# Drawbacks
4248

0 commit comments

Comments
 (0)