termination_trait: Add () example to error message
This commit is contained in:
parent
1937661961
commit
94bdeb64f9
@ -1443,7 +1443,7 @@ pub fn id() -> u32 {
|
||||
#[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}`"]
|
||||
"`main` can only return types like `()` that implement {Termination}, not `{Self}`"]
|
||||
pub trait Termination {
|
||||
/// Is called to get the representation of the value as status code.
|
||||
/// This status code is returned to the operating system.
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// error-pattern:`main` can only return types that implement std::process::Termination, not `i32`
|
||||
// error-pattern:`main` can only return types like `()` that implement std::process::Termination, no
|
||||
fn main() -> i32 {
|
||||
0
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ error[E0277]: the trait bound `char: std::process::Termination` is not satisfied
|
||||
--> $DIR/termination-trait-main-wrong-type.rs:11:14
|
||||
|
|
||||
LL | fn main() -> char { //~ ERROR
|
||||
| ^^^^ `main` can only return types that implement std::process::Termination, not `char`
|
||||
| ^^^^ `main` can only return types like `()` that implement std::process::Termination, not `char`
|
||||
|
|
||||
= help: the trait `std::process::Termination` is not implemented for `char`
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user