We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
main
1 parent a0b1195 commit 50a2c87Copy full SHA for 50a2c87
src/crates-and-source-files.md
@@ -119,6 +119,17 @@ fn main() -> impl std::process::Termination {
119
}
120
```
121
122
+The `main` function may be an import, e.g. from an external crate or from the current one.
123
+
124
+```rust
125
+mod foo {
126
+ pub fn bar() {
127
+ println!("Hello, world!");
128
+ }
129
+}
130
+use foo::bar as main;
131
+```
132
133
> **Note**: Types with implementations of [`Termination`] in the standard library include:
134
>
135
> * `()`
0 commit comments