Skip to content

Commit 56c90dc

Browse files
committedJan 21, 2025·
remove support for the #[start] attribute
1 parent 341f603 commit 56c90dc

File tree

176 files changed

+454
-1260
lines changed

Some content is hidden

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

176 files changed

+454
-1260
lines changed
 

Diff for: ‎compiler/rustc_ast/src/entry.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ pub enum EntryPointType {
1818
/// fn main() {}
1919
/// ```
2020
RustcMainAttr,
21-
/// This is a function with the `#[start]` attribute.
22-
/// ```ignore (clashes with test entrypoint)
23-
/// #[start]
24-
/// fn main() {}
25-
/// ```
26-
Start,
2721
/// This function is **not** an entrypoint but simply named `main` (not at the root).
2822
/// This is only used for diagnostics.
2923
/// ```
@@ -40,9 +34,7 @@ pub fn entry_point_type(
4034
at_root: bool,
4135
name: Option<Symbol>,
4236
) -> EntryPointType {
43-
if attr::contains_name(attrs, sym::start) {
44-
EntryPointType::Start
45-
} else if attr::contains_name(attrs, sym::rustc_main) {
37+
if attr::contains_name(attrs, sym::rustc_main) {
4638
EntryPointType::RustcMainAttr
4739
} else if let Some(name) = name
4840
&& name == sym::main

Diff for: ‎compiler/rustc_ast_passes/src/feature_gate.rs

-12
Original file line numberDiff line numberDiff line change
@@ -230,18 +230,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
230230
}
231231
}
232232

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

0 commit comments

Comments
 (0)
Please sign in to comment.