Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0956662

Browse files
committedDec 14, 2024·
remove support for the #[start] attribute
1 parent a1740a9 commit 0956662

File tree

71 files changed

+326
-756
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+326
-756
lines changed
 

‎compiler/rustc_ast/src/entry.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,6 @@ pub enum EntryPointType {
1919
/// fn main() {}
2020
/// ```
2121
RustcMainAttr,
22-
/// This is a function with the `#[start]` attribute.
23-
/// ```ignore (clashes with test entrypoint)
24-
/// #[start]
25-
/// fn main() {}
26-
/// ```
27-
Start,
2822
/// This function is **not** an entrypoint but simply named `main` (not at the root).
2923
/// This is only used for diagnostics.
3024
/// ```
@@ -41,9 +35,7 @@ pub fn entry_point_type(
4135
at_root: bool,
4236
name: Option<Symbol>,
4337
) -> EntryPointType {
44-
if attr::contains_name(attrs, sym::start) {
45-
EntryPointType::Start
46-
} else if attr::contains_name(attrs, sym::rustc_main) {
38+
if attr::contains_name(attrs, sym::rustc_main) {
4739
EntryPointType::RustcMainAttr
4840
} else if let Some(name) = name
4941
&& name == sym::main

‎compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -231,18 +231,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
231231
}
232232
}
233233

234-
ast::ItemKind::Fn(..) => {
235-
if attr::contains_name(&i.attrs, sym::start) {
236-
gate!(
237-
&self,
238-
start,
239-
i.span,
240-
"`#[start]` functions are experimental and their signature may change \
241-
over time"
242-
);
243-
}
244-
}
245-
246234
ast::ItemKind::Struct(..) => {
247235
for attr in attr::filter_by_name(&i.attrs, sym::repr) {
248236
for item in attr.meta_item_list().unwrap_or_else(ThinVec::new) {

0 commit comments

Comments
 (0)
Please sign in to comment.