From bb665a8f074d8be785efa774439a718aef1d7e2c Mon Sep 17 00:00:00 2001 From: Tobias Bucher Date: Wed, 19 Aug 2015 17:17:20 +0200 Subject: [PATCH] RFC: Allow a re-export for `main` --- text/0000-main-reexport.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 text/0000-main-reexport.md diff --git a/text/0000-main-reexport.md b/text/0000-main-reexport.md new file mode 100644 index 00000000000..9732008dfd3 --- /dev/null +++ b/text/0000-main-reexport.md @@ -0,0 +1,34 @@ +- Feature Name: main_reexport +- Start Date: 2015-08-19 +- RFC PR: (leave this empty) +- Rust Issue: (leave this empty) + +# Summary + +Allow a re-export of a function as entry point `main`. + +# Motivation + +Functions and re-exports of functions usually behave the same way, but they do +not for the program entry point `main`. This RFC aims to fix this inconsistency. + +The above mentioned inconsistency means that e.g. you currently cannot use a +library's exported function as your main function. + +# Detailed design + +Use the symbol `main at the top-level of a crate that is compiled as a program +(`--crate-type=bin`) – instead of explicitly only accepting directly-defined +functions, also allow re-exports. + +# Drawbacks + +None. + +# Alternatives + +None. + +# Unresolved questions + +None.