remove support for the #[start] attribute
This commit is contained in:
@@ -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
|
||||
}
|
||||
```
|
||||
|
||||
@@ -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!
|
||||
```
|
||||
|
||||
@@ -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
|
||||
}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user