1
Fork 0

remove support for the #[start] attribute

This commit is contained in:
Ralf Jung 2024-12-14 09:13:12 +01:00
parent 341f60327f
commit 56c90dc31e
176 changed files with 454 additions and 1260 deletions

View file

@ -1,32 +1,3 @@
#### Note: this error code is no longer emitted by the compiler.
A function with the `start` attribute was declared with type parameters.
Erroneous code example:
```compile_fail,E0132
#![feature(start)]
#[start]
fn f<T>() {}
```
It is not possible to declare type parameters on a function that has the `start`
attribute. Such a function must have the following type signature (for more
information, view [the unstable book][1]):
[1]: https://doc.rust-lang.org/unstable-book/language-features/start.html
```
# let _:
fn(isize, *const *const u8) -> isize;
```
Example:
```
#![feature(start)]
#[start]
fn my_start(argc: isize, argv: *const *const u8) -> isize {
0
}
```

View file

@ -1,25 +1,3 @@
#### Note: this error code is no longer emitted by the compiler.
More than one function was declared with the `#[start]` attribute.
Erroneous code example:
```compile_fail,E0138
#![feature(start)]
#[start]
fn foo(argc: isize, argv: *const *const u8) -> isize {}
#[start]
fn f(argc: isize, argv: *const *const u8) -> isize {}
// error: multiple 'start' functions
```
This error indicates that the compiler found multiple functions with the
`#[start]` attribute. This is an error because there must be a unique entry
point into a Rust program. Example:
```
#![feature(start)]
#[start]
fn foo(argc: isize, argv: *const *const u8) -> isize { 0 } // ok!
```

View file

@ -1,13 +1,3 @@
#### Note: this error code is no longer emitted by the compiler.
The `start` function was defined with a where clause.
Erroneous code example:
```compile_fail,E0647
#![feature(start)]
#[start]
fn start(_: isize, _: *const *const u8) -> isize where (): Copy {
//^ error: `#[start]` function is not allowed to have a where clause
0
}
```

View file

@ -24,6 +24,10 @@
//
// Both columns are necessary because it's not possible in Rust to create a new identifier such as
// `E0123` from an integer literal such as `0123`, unfortunately.
//
// Do *not* remove entries from this list. Instead, just add a note th the corresponding markdown
// file saying that this error is not emitted by the compiler any more (see E0001.md for an
// example), and remove all code examples that do not build any more.
#[macro_export]
macro_rules! error_codes {
($macro:path) => (