summaryrefslogtreecommitdiffstats
path: root/tests/ui/rfcs/rfc-1937-termination-trait
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/rfcs/rfc-1937-termination-trait
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/rfcs/rfc-1937-termination-trait')
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs6
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-empty.rs2
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-exitcode.rs7
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-impl-termination.rs3
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_ok.rs6
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result.rs6
-rw-r--r--tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str.rs4
7 files changed, 34 insertions, 0 deletions
diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs
new file mode 100644
index 000000000..e98582cbc
--- /dev/null
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs
@@ -0,0 +1,6 @@
+// run-pass
+use std::error::Error;
+
+fn main() -> Result<(), Box<dyn Error>> {
+ Ok(())
+}
diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-empty.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-empty.rs
new file mode 100644
index 000000000..bac695d4e
--- /dev/null
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-empty.rs
@@ -0,0 +1,2 @@
+// run-pass
+fn main() {}
diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-exitcode.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-exitcode.rs
new file mode 100644
index 000000000..6d4c15620
--- /dev/null
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-exitcode.rs
@@ -0,0 +1,7 @@
+// run-pass
+
+use std::process::ExitCode;
+
+fn main() -> ExitCode {
+ ExitCode::SUCCESS
+}
diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-impl-termination.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-impl-termination.rs
new file mode 100644
index 000000000..c06a135dc
--- /dev/null
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-impl-termination.rs
@@ -0,0 +1,3 @@
+// run-pass
+
+fn main() -> impl std::process::Termination { }
diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_ok.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_ok.rs
new file mode 100644
index 000000000..b0e932e1f
--- /dev/null
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result-box-error_ok.rs
@@ -0,0 +1,6 @@
+// run-pass
+use std::io::Error;
+
+fn main() -> Result<(), Box<Error>> {
+ Ok(())
+}
diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result.rs
new file mode 100644
index 000000000..30f36c244
--- /dev/null
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-result.rs
@@ -0,0 +1,6 @@
+// run-pass
+use std::io::Error;
+
+fn main() -> Result<(), Error> {
+ Ok(())
+}
diff --git a/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str.rs b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str.rs
new file mode 100644
index 000000000..f0591c38c
--- /dev/null
+++ b/tests/ui/rfcs/rfc-1937-termination-trait/termination-trait-for-str.rs
@@ -0,0 +1,4 @@
+// run-pass
+fn main() -> Result<(), &'static str> {
+ Ok(())
+}