Skip to content

allowing the entry point name to be something other than main #4482

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

ILyoan
Copy link
Contributor

@ILyoan ILyoan commented Jan 14, 2013

fixed #4207

giving a function the attribute #[main] makes the function main.

  • if there is no function with #[main], the function named 'main' will be the main.
  • when --test is given, all function with #[main] will be stripped out and the main function for testing will be the only function having #[main] attribute.

@brson
Copy link
Contributor

brson commented Jan 14, 2013

This looks excellent. Thanks! Merged to incoming.

@brson
Copy link
Contributor

brson commented Jan 14, 2013

I filed a minor followup issue: #4488. It looks to me like this code preserves the behavior of deleting existing functions marked #[main] when building with --test. That isn't strictly necessary now since we can just remove the #[main] attribute.

@brson
Copy link
Contributor

brson commented Jan 14, 2013

Also, thanks for providing comprehensive test cases. That makes patches very easy to accept.

@brson brson closed this Jan 14, 2013
bors pushed a commit to rust-lang-ci/rust that referenced this pull request May 15, 2021
* Fixed comment dropped between & and type issue

* Reduced nesting levels and avoided duplications

* Removed extra allocations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants