about summary refs log tree commit diff
path: root/compiler/rustc_hir/src/lang_items.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-12-14 09:13:12 +0100
committerRalf Jung <post@ralfj.de>2025-01-21 06:59:15 -0700
commit56c90dc31e86bbaf486826a21a33d7c56e8f742f (patch)
tree6b953e5db742226ed1297f87196a69c1d51bd1d7 /compiler/rustc_hir/src/lang_items.rs
parent341f60327fa5302732a4be366949c16f91870b6a (diff)
downloadrust-56c90dc31e86bbaf486826a21a33d7c56e8f742f.tar.gz
rust-56c90dc31e86bbaf486826a21a33d7c56e8f742f.zip
remove support for the #[start] attribute
Diffstat (limited to 'compiler/rustc_hir/src/lang_items.rs')
-rw-r--r--compiler/rustc_hir/src/lang_items.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_hir/src/lang_items.rs b/compiler/rustc_hir/src/lang_items.rs
index fae3b778d7b..02bc069fc5f 100644
--- a/compiler/rustc_hir/src/lang_items.rs
+++ b/compiler/rustc_hir/src/lang_items.rs
@@ -332,6 +332,10 @@ language_item_table! {
     FallbackSurfaceDrop,     sym::fallback_surface_drop, fallback_surface_drop_fn, Target::Fn,             GenericRequirement::None;
     AllocLayout,             sym::alloc_layout,        alloc_layout,               Target::Struct,         GenericRequirement::None;
 
+    /// For all binary crates without `#![no_main]`, Rust will generate a "main" function.
+    /// The exact name and signature are target-dependent. The "main" function will invoke
+    /// this lang item, passing it the `argc` and `argv` (or null, if those don't exist
+    /// on the current target) as well as the user-defined `fn main` from the binary crate.
     Start,                   sym::start,               start_fn,                   Target::Fn,             GenericRequirement::Exact(1);
 
     EhPersonality,           sym::eh_personality,      eh_personality,             Target::Fn,             GenericRequirement::None;