about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <liehr.exchange@gmx.net>2022-10-17 12:04:16 +0200
committerLeón Orell Valerian Liehr <liehr.exchange@gmx.net>2022-10-17 12:08:46 +0200
commit684df4d24ec605a07f1a5789c1d0027d4887103c (patch)
treeff734bbb86f614c3d0ed3b6ec565a4014d5177b5 /library/std/src
parentbf286a82e236e065c67909657e3a35d1511d1864 (diff)
Make diagnostic for unsatisfied Termination bounds more precise
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/process.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/library/std/src/process.rs b/library/std/src/process.rs
index b8249a027ad..400d25beb26 100644
--- a/library/std/src/process.rs
+++ b/library/std/src/process.rs
@@ -2154,8 +2154,16 @@ pub fn id() -> u32 {
 #[cfg_attr(not(test), lang = "termination")]
 #[stable(feature = "termination_trait_lib", since = "1.61.0")]
 #[rustc_on_unimplemented(
-    message = "`main` has invalid return type `{Self}`",
-    label = "`main` can only return types that implement `{Termination}`"
+    on(
+        all(not(bootstrap), cause = "MainFunctionType"),
+        message = "`main` has invalid return type `{Self}`",
+        label = "`main` can only return types that implement `{Termination}`"
+    ),
+    on(
+        bootstrap,
+        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.