about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-03-25 01:26:32 +0800
committerGitHub <noreply@github.com>2018-03-25 01:26:32 +0800
commit8d57071cbbdf3a5e7006cae303d6d14c905c8fc0 (patch)
tree229615e8e20c9c83ea7588b1edfbd374273d867b /src/libstd
parentc892e683872725b9d9b4ed0ed5bd53281313bc38 (diff)
parent2b13d95da02d318c12814261dd36edd91ae6879e (diff)
downloadrust-8d57071cbbdf3a5e7006cae303d6d14c905c8fc0.tar.gz
rust-8d57071cbbdf3a5e7006cae303d6d14c905c8fc0.zip
Rollup merge of #49162 - tmandry:stabilize-termination-trait, r=nikomatsakis
Stabilize termination_trait, split out termination_trait_test

For #48453.

First time contribution, so I'd really appreciate any feedback on how this PR can be better.

Not sure exactly what kind of documentation update is needed. If there is no PR to update the reference, I can try doing that this week as I have time.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/lib.rs2
-rw-r--r--src/libstd/process.rs5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 36eb7291822..0b06c5d4d65 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -308,7 +308,6 @@
 #![feature(str_char)]
 #![feature(str_internals)]
 #![feature(str_utf16)]
-#![feature(termination_trait)]
 #![feature(test, rustc_private)]
 #![feature(thread_local)]
 #![feature(toowned_clone_into)]
@@ -325,6 +324,7 @@
 #![cfg_attr(test, feature(update_panic_count))]
 #![cfg_attr(windows, feature(used))]
 #![cfg_attr(stage0, feature(never_type))]
+#![cfg_attr(stage0, feature(termination_trait))]
 
 #![default_lib_allocator]
 
diff --git a/src/libstd/process.rs b/src/libstd/process.rs
index d5ac2d19e83..c877bf6aa35 100644
--- a/src/libstd/process.rs
+++ b/src/libstd/process.rs
@@ -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.