termination_trait: Make error message more helpful
This commit is contained in:
parent
b6934c91b2
commit
2b13d95da0
5 changed files with 16 additions and 16 deletions
|
@ -1442,8 +1442,9 @@ pub fn id() -> u32 {
|
|||
/// a successful execution. In case of a failure, `libc::EXIT_FAILURE` is returned.
|
||||
#[cfg_attr(not(test), lang = "termination")]
|
||||
#[unstable(feature = "termination_trait_lib", issue = "43301")]
|
||||
#[rustc_on_unimplemented =
|
||||
"`main` can only return types that implement {Termination}, not `{Self}`"]
|
||||
#[rustc_on_unimplemented(
|
||||
message="`main` has invalid return type `{Self}`",
|
||||
label="`main` can only return types that implement {Termination}")]
|
||||
pub trait Termination {
|
||||
/// Is called to get the representation of the value as status code.
|
||||
/// This status code is returned to the operating system.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue