bors
ed43cbcb88
Auto merge of #134299 - RalfJung:remove-start, r=compiler-errors
...
remove support for the (unstable) #[start] attribute
As explained by `@Noratrieb:`
`#[start]` should be deleted. It's nothing but an accidentally leaked implementation detail that's a not very useful mix between "portable" entrypoint logic and bad abstraction.
I think the way the stable user-facing entrypoint should work (and works today on stable) is pretty simple:
- `std`-using cross-platform programs should use `fn main()`. the compiler, together with `std`, will then ensure that code ends up at `main` (by having a platform-specific entrypoint that gets directed through `lang_start` in `std` to `main` - but that's just an implementation detail)
- `no_std` platform-specific programs should use `#![no_main]` and define their own platform-specific entrypoint symbol with `#[no_mangle]`, like `main`, `_start`, `WinMain` or `my_embedded_platform_wants_to_start_here`. most of them only support a single platform anyways, and need cfg for the different platform's ways of passing arguments or other things *anyways*
`#[start]` is in a super weird position of being neither of those two. It tries to pretend that it's cross-platform, but its signature is a total lie. Those arguments are just stubbed out to zero on ~~Windows~~ wasm, for example. It also only handles the platform-specific entrypoints for a few platforms that are supported by `std`, like Windows or Unix-likes. `my_embedded_platform_wants_to_start_here` can't use it, and neither could a libc-less Linux program.
So we have an attribute that only works in some cases anyways, that has a signature that's a total lie (and a signature that, as I might want to add, has changed recently, and that I definitely would not be comfortable giving *any* stability guarantees on), and where there's a pretty easy way to get things working without it in the first place.
Note that this feature has **not** been RFCed in the first place.
*This comment was posted [in May](https://github.com/rust-lang/rust/issues/29633#issuecomment-2088596042 ) and so far nobody spoke up in that issue with a usecase that would require keeping the attribute.*
Closes https://github.com/rust-lang/rust/issues/29633
try-job: x86_64-gnu-nopt
try-job: x86_64-msvc-1
try-job: x86_64-msvc-2
try-job: test-various
2025-01-21 19:46:20 +00:00
..
2024-12-20 23:19:12 +09:00
2024-05-31 15:56:43 +10:00
2024-11-28 13:43:05 -05:00
2024-12-15 19:01:45 +08:00
2024-10-06 18:12:25 +02:00
2024-10-31 18:20:11 +08:00
2024-02-22 16:04:04 +00:00
2024-12-19 20:36:51 +08:00
2024-11-27 07:18:25 -08:00
2024-05-31 15:56:43 +10:00
2024-09-18 13:53:31 -07:00
2024-11-14 16:18:41 -06:00
2025-01-15 21:42:47 +01:00
2024-12-11 21:34:48 +11:00
2024-02-22 16:04:04 +00:00
2025-01-05 08:51:15 +00:00
2024-12-19 20:36:51 +08:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-12-19 20:36:51 +08:00
2025-01-10 22:53:54 +01:00
2024-05-31 15:56:43 +10:00
2024-06-25 19:00:02 +02:00
2024-02-22 16:04:04 +00:00
2024-11-03 07:09:34 -08:00
2024-07-25 15:14:42 -04:00
2024-11-23 20:19:51 +08:00
2024-09-09 19:39:43 -07:00
2024-11-07 20:02:20 +01:00
2024-02-22 16:04:04 +00:00
2024-06-19 13:54:55 +01:00
2024-11-25 15:30:35 +01:00
2024-08-07 14:08:34 +02:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2025-01-12 13:32:36 +01:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-05-31 15:56:43 +10:00
2024-06-19 13:54:55 +01:00
2024-09-09 19:39:43 -07:00
2024-09-18 12:28:55 -07:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-05-31 15:56:43 +10:00
2024-04-11 21:42:35 -04:00
2024-04-22 18:48:47 +02:00
2024-08-10 10:44:24 +08:00
2024-04-11 21:42:35 -04:00
2024-04-09 08:51:32 -07:00
2024-06-19 17:48:05 +02:00
2024-04-11 17:20:08 +00:00
2024-12-13 00:04:56 +00:00
2024-12-19 20:36:51 +08:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-07-29 08:26:52 +10:00
2024-10-21 15:22:17 +01:00
2024-05-31 15:56:43 +10:00
2024-10-31 17:33:42 +08:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-11-14 17:44:54 +08:00
2024-10-31 11:59:17 +00:00
2024-02-22 16:04:04 +00:00
2024-11-14 17:44:54 +08:00
2024-08-11 19:40:44 +02:00
2024-08-29 18:12:31 +08:00
2024-06-19 13:54:55 +01:00
2024-02-22 16:04:04 +00:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2024-10-23 04:42:03 +02:00
2024-11-17 21:49:10 +01:00
2024-10-31 13:48:06 +08:00
2024-07-25 15:14:42 -04:00
2024-02-22 16:04:04 +00:00
2024-05-31 15:56:43 +10:00
2024-08-07 14:08:34 +02:00
2024-08-11 19:40:44 +02:00
2024-02-22 16:04:04 +00:00
2024-10-23 04:42:03 +02:00
2024-04-24 13:12:33 +01:00
2024-12-28 13:28:35 -06:00
2024-09-09 19:39:43 -07:00
2024-09-21 01:07:00 -04:00
2024-06-04 01:30:51 -07:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-06 23:15:48 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-12-19 20:36:51 +08:00
2024-05-06 23:15:48 +00:00
2024-12-19 20:36:51 +08:00
2024-08-12 19:20:00 -07:00
2024-02-22 16:04:04 +00:00
2024-08-07 14:08:34 +02:00
2024-10-11 08:43:27 +11:00
2024-02-22 16:04:04 +00:00
2024-06-05 15:40:11 +00:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2025-01-06 10:29:54 +01:00
2025-01-06 10:29:54 +01:00
2024-05-31 15:56:43 +10:00
2024-06-16 17:19:25 +08:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2025-01-16 13:25:40 +01:00
2024-02-22 16:04:04 +00:00
2024-05-31 15:56:43 +10:00
2024-10-23 04:42:03 +02:00
2024-05-03 14:32:08 +02:00
2024-05-31 15:56:43 +10:00
2024-03-11 09:36:35 -07:00
2024-06-23 00:40:43 -07:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-11-08 07:35:29 +01:00
2024-09-25 15:53:53 +02:00
2025-01-21 06:59:15 -07:00
2024-07-14 13:48:29 +03:00
2024-12-15 19:01:45 +08:00
2025-01-16 00:26:55 +01:00
2025-01-16 13:25:40 +01:00
2024-10-10 14:24:43 +00:00
2024-02-23 18:04:01 -05:00
2024-03-22 09:55:50 -04:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-08-12 19:20:00 -07:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-11-14 17:44:54 +08:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-08-17 02:14:23 +01:00
2024-09-18 13:53:31 -07:00
2024-10-16 18:38:26 +00:00
2024-02-23 18:04:01 -05:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-04-22 18:48:47 +02:00
2024-02-22 16:04:04 +00:00
2024-05-31 15:56:43 +10:00
2024-07-14 13:48:29 +03:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2024-09-18 13:53:31 -07:00
2024-12-10 01:29:43 -08:00
2024-10-31 17:33:42 +08:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2025-01-10 22:53:54 +01:00
2024-05-31 15:56:43 +10:00
2024-10-23 04:42:03 +02:00
2024-02-22 16:04:04 +00:00
2024-03-17 10:11:04 -07:00
2024-02-22 16:04:04 +00:00
2024-12-10 21:41:05 +01:00
2024-02-22 16:04:04 +00:00
2024-09-21 01:07:00 -04:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-04-04 21:59:08 +01:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2024-05-31 15:56:43 +10:00
2024-07-14 13:48:29 +03:00
2024-02-22 16:04:04 +00:00
2024-05-31 15:56:43 +10:00
2024-10-07 11:12:58 -04:00
2024-09-18 13:53:31 -07:00
2025-01-21 08:22:15 +00:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-12-04 16:16:24 +00:00
2024-05-31 15:56:43 +10:00
2024-06-14 13:31:46 +10:00
2024-06-14 13:31:46 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-10-22 02:25:38 -07:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-02-23 18:04:01 -05:00
2024-04-29 13:03:45 +00:00
2024-12-29 03:31:37 +00:00
2024-10-23 04:42:03 +02:00
2023-01-11 09:32:08 +00:00
2024-05-31 15:56:43 +10:00
2024-12-02 01:14:40 +07:00
2024-10-18 11:59:20 -07:00
2024-02-22 16:04:04 +00:00
2024-10-17 02:07:02 +01:00
2024-10-23 04:42:21 +02:00
2024-02-22 16:04:04 +00:00
2024-05-31 15:56:43 +10:00
2024-03-12 19:01:04 -04:00
2024-02-23 18:04:01 -05:00
2024-02-23 18:04:01 -05:00
2024-12-29 08:02:40 -06:00
2025-01-21 08:27:30 +00:00
2024-11-06 02:22:00 -05:00
2024-02-23 18:04:01 -05:00
2024-02-23 18:04:01 -05:00
2024-12-05 16:08:41 +01:00
2024-09-18 13:53:31 -07:00
2024-05-31 15:56:43 +10:00
2024-04-22 18:48:47 +02:00
2024-10-31 17:33:42 +08:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-08-07 00:41:48 -04:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2024-04-06 11:37:57 -07:00
2024-05-31 15:56:43 +10:00
2024-05-31 15:56:43 +10:00
2024-04-11 21:42:35 -04:00
2024-02-22 16:04:04 +00:00
2024-05-01 16:54:20 -07:00
2024-12-31 12:41:20 +01:00
2024-02-22 16:04:04 +00:00
2024-12-31 12:41:20 +01:00
2024-05-31 15:56:43 +10:00
2024-03-17 10:11:04 -07:00
2024-05-31 15:56:43 +10:00
2024-10-23 04:42:03 +02:00
2024-11-13 15:05:31 +02:00
2024-05-31 15:56:43 +10:00
2024-10-19 13:09:21 +00:00
2024-04-06 11:21:47 -04:00
2024-04-11 17:20:08 +00:00
2024-02-22 16:04:04 +00:00
2024-02-22 16:04:04 +00:00
2024-10-23 04:42:03 +02:00
2024-06-19 13:54:55 +01:00
2024-06-19 13:54:55 +01:00
2024-06-19 13:54:55 +01:00
2024-09-18 13:53:31 -07:00
2024-09-18 13:53:31 -07:00
2023-01-11 09:32:08 +00:00
2024-10-23 04:42:03 +02:00
2025-01-09 23:47:11 -08:00
2024-02-22 16:04:04 +00:00
2024-02-23 18:04:01 -05:00
2025-01-09 23:47:11 -08:00
2024-05-31 15:56:43 +10:00
2024-02-23 18:04:01 -05:00
2024-04-20 21:07:00 -04:00
2024-02-23 18:04:01 -05:00
2024-02-23 18:04:01 -05:00
2024-10-31 17:33:42 +08:00
2024-10-31 17:33:42 +08:00
2024-10-31 17:33:42 +08:00
2024-04-08 12:12:13 +02:00
2024-10-31 17:33:42 +08:00
2024-02-23 18:04:01 -05:00
2024-02-22 16:04:04 +00:00
2024-06-04 01:30:51 -07:00
2024-05-27 16:26:56 -04:00
2024-05-31 15:56:43 +10:00
2024-02-22 16:04:04 +00:00
2024-06-19 21:26:48 +01:00
2024-05-31 15:56:43 +10:00
2024-09-09 19:39:43 -07:00