diff --git a/src/crates-and-source-files.md b/src/crates-and-source-files.md index 8d54c3f..3f660e7 100644 --- a/src/crates-and-source-files.md +++ b/src/crates-and-source-files.md @@ -119,6 +119,17 @@ fn main() -> impl std::process::Termination { } ``` +The `main` function may be an import, e.g. from an external crate or from the current one. + +```rust +mod foo { + pub fn bar() { + println!("Hello, world!"); + } +} +use foo::bar as main; +``` + > **Note**: Types with implementations of [`Termination`] in the standard library include: > > * `()`