rust/compiler/rustc_codegen_cranelift/src
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
..
abi Add gpu-kernel calling convention 2025-01-16 00:26:55 +01:00
debuginfo remove remaining references to Reveal 2024-11-23 13:52:56 +01:00
driver Merge commit '728bc27f32c05ac8a9b5eb33fd101e479072984f' into sync_cg_clif-2025-01-20 2025-01-20 15:30:04 +00:00
intrinsics Updated several files to use rust intrinsic macros instead of the legacy extern "rust-intrinsic" blocks 2025-01-20 09:15:23 -05:00
optimize Reformat use declarations. 2024-07-29 08:26:52 +10:00
allocator.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
analyze.rs rename AddressOf -> RawBorrow inside the compiler 2024-08-18 19:46:53 +02:00
base.rs Revert "Auto merge of #134330 - scottmcm:no-more-rvalue-len, r=matthewjasper" 2025-01-18 22:09:34 +00:00
cast.rs Merge commit '93a5433f17ab5ed48cc88f1e69b0713b16183373' into sync_cg_clif-2023-10-24 2023-10-24 12:22:23 +00:00
codegen_i128.rs Use a C-safe return type for __rust_[ui]128_* overflowing intrinsics 2025-01-15 03:49:39 +00:00
common.rs remove remaining references to Reveal 2024-11-23 13:52:56 +01:00
compiler_builtins.rs Use a C-safe return type for __rust_[ui]128_* overflowing intrinsics 2025-01-15 03:49:39 +00:00
concurrency_limiter.rs Remove jobserver from Session 2024-12-13 10:21:22 +00:00
config.rs Merge commit '57845a397ec15e4e6a561ed2c4bfa3dcf49144fb' into sync_cg_clif-2024-12-06 2024-12-06 12:10:30 +00:00
constant.rs Remove polymorphization 2024-12-06 16:42:09 -05:00
discriminant.rs make no-variant types a dedicated Variants variant 2024-12-18 11:01:54 +01:00
global_asm.rs remove remaining references to Reveal 2024-11-23 13:52:56 +01:00
inline_asm.rs Merge commit '918acafef682d0d0ca30b47de4768210417ff362' into sync_cg_clif-2025-01-05 2025-01-05 15:44:46 +00:00
lib.rs Merge commit '918acafef682d0d0ca30b47de4768210417ff362' into sync_cg_clif-2025-01-05 2025-01-05 15:44:46 +00:00
linkage.rs Sync rustc_codegen_cranelift 'ddd4ce25535cf71203ba3700896131ce55fde795' 2021-04-30 14:49:58 +02:00
main_shim.rs remove support for the #[start] attribute 2025-01-21 06:59:15 -07:00
num.rs Merge commit 'e39eacd2d415803ef82de3b6a314e4f2d0fbc4dc' into sync_cg_clif-2025-01-10 2025-01-10 09:02:07 +00:00
pointer.rs Merge commit '1fa693ca4462fc1f790693464cf765ad693616af' into sync_cg_clif-2024-11-09 2024-11-09 13:48:06 +00:00
pretty_clif.rs Merge commit '1fa693ca4462fc1f790693464cf765ad693616af' into sync_cg_clif-2024-11-09 2024-11-09 13:48:06 +00:00
toolchain.rs Merge commit 'e9d1a0a7b0b28dd422f1a790ccde532acafbf193' into sync_cg_clif-2022-08-24 2022-08-24 18:40:58 +02:00
trap.rs Merge commit '5b1246bb4bed72fd0bb8fa497d8e5ed2c7f3515c' into sync_cg_clif-2024-11-02 2024-11-02 14:53:30 +00:00
unsize.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
unwind_module.rs Merge commit '49cd5dd454d0115cfbe9e39102a8b3ba4616aa40' into sync_cg_clif-2024-06-30 2024-06-30 11:28:14 +00:00
value_and_place.rs Remove polymorphization 2024-12-06 16:42:09 -05:00
vtable.rs cg_clif: rustc_abi::Abi => BackendRepr 2024-10-29 15:01:01 -07:00