Skip to content

Commit 94bdeb6

Browse files
committed
termination_trait: Add () example to error message
1 parent 1937661 commit 94bdeb6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/libstd/process.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ pub fn id() -> u32 {
14431443
#[cfg_attr(not(test), lang = "termination")]
14441444
#[unstable(feature = "termination_trait_lib", issue = "43301")]
14451445
#[rustc_on_unimplemented =
1446-
"`main` can only return types that implement {Termination}, not `{Self}`"]
1446+
"`main` can only return types like `()` that implement {Termination}, not `{Self}`"]
14471447
pub trait Termination {
14481448
/// Is called to get the representation of the value as status code.
14491449
/// This status code is returned to the operating system.

src/test/compile-fail/rfc-1937-termination-trait/termination-trait-main-i32.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern:`main` can only return types that implement std::process::Termination, not `i32`
11+
// error-pattern:`main` can only return types like `()` that implement std::process::Termination, no
1212
fn main() -> i32 {
1313
0
1414
}

src/test/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error[E0277]: the trait bound `char: std::process::Termination` is not satisfied
22
--> $DIR/termination-trait-main-wrong-type.rs:11:14
33
|
44
LL | fn main() -> char { //~ ERROR
5-
| ^^^^ `main` can only return types that implement std::process::Termination, not `char`
5+
| ^^^^ `main` can only return types like `()` that implement std::process::Termination, not `char`
66
|
77
= help: the trait `std::process::Termination` is not implemented for `char`
88

0 commit comments

Comments
 (0)