summaryrefslogtreecommitdiffstats
path: root/src/test/ui/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 /src/test/ui/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 'src/test/ui/rfc-1937-termination-trait')
-rw-r--r--src/test/ui/rfc-1937-termination-trait/issue-103052-1.rs11
-rw-r--r--src/test/ui/rfc-1937-termination-trait/issue-103052-1.stderr17
-rw-r--r--src/test/ui/rfc-1937-termination-trait/issue-103052-2.rs18
-rw-r--r--src/test/ui/rfc-1937-termination-trait/issue-103052-2.stderr15
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs11
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-for-never.rs7
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs10
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-for-str.rs8
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-impl-trait.rs3
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-impl-trait.stderr11
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.rs15
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.stderr12
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-in-test.rs28
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-main-i32.rs6
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-main-i32.stderr11
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.rs3
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.stderr11
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.rs5
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr11
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs8
-rw-r--r--src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr19
21 files changed, 0 insertions, 240 deletions
diff --git a/src/test/ui/rfc-1937-termination-trait/issue-103052-1.rs b/src/test/ui/rfc-1937-termination-trait/issue-103052-1.rs
deleted file mode 100644
index a75c91cc9..000000000
--- a/src/test/ui/rfc-1937-termination-trait/issue-103052-1.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// Check that we don't blindly emit a diagnostic claiming that "`main` has an invalid return type"
-// if we encounter a type that doesn't implement `std::process::Termination` and is not actually
-// the return type of the program entry `main`.
-
-fn receive(_: impl std::process::Termination) {}
-
-struct Something;
-
-fn main() {
- receive(Something); //~ ERROR the trait bound `Something: Termination` is not satisfied
-}
diff --git a/src/test/ui/rfc-1937-termination-trait/issue-103052-1.stderr b/src/test/ui/rfc-1937-termination-trait/issue-103052-1.stderr
deleted file mode 100644
index 409dede1a..000000000
--- a/src/test/ui/rfc-1937-termination-trait/issue-103052-1.stderr
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0277]: the trait bound `Something: Termination` is not satisfied
- --> $DIR/issue-103052-1.rs:10:13
- |
-LL | receive(Something);
- | ------- ^^^^^^^^^ the trait `Termination` is not implemented for `Something`
- | |
- | required by a bound introduced by this call
- |
-note: required by a bound in `receive`
- --> $DIR/issue-103052-1.rs:5:20
- |
-LL | fn receive(_: impl std::process::Termination) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `receive`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-1937-termination-trait/issue-103052-2.rs b/src/test/ui/rfc-1937-termination-trait/issue-103052-2.rs
deleted file mode 100644
index fa9182b6d..000000000
--- a/src/test/ui/rfc-1937-termination-trait/issue-103052-2.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-#![feature(return_position_impl_trait_in_trait)]
-#![allow(incomplete_features)]
-
-mod child {
- trait Main {
- fn main() -> impl std::process::Termination;
- }
-
- struct Something;
-
- impl Main for () {
- fn main() -> Something { //~ ERROR the trait bound `Something: Termination` is not satisfied
- Something
- }
- }
-}
-
-fn main() {}
diff --git a/src/test/ui/rfc-1937-termination-trait/issue-103052-2.stderr b/src/test/ui/rfc-1937-termination-trait/issue-103052-2.stderr
deleted file mode 100644
index a700c72ea..000000000
--- a/src/test/ui/rfc-1937-termination-trait/issue-103052-2.stderr
+++ /dev/null
@@ -1,15 +0,0 @@
-error[E0277]: the trait bound `Something: Termination` is not satisfied
- --> $DIR/issue-103052-2.rs:12:22
- |
-LL | fn main() -> Something {
- | ^^^^^^^^^ the trait `Termination` is not implemented for `Something`
- |
-note: required by a bound in `Main::main::{opaque#0}`
- --> $DIR/issue-103052-2.rs:6:27
- |
-LL | fn main() -> impl std::process::Termination;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Main::main::{opaque#0}`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs
deleted file mode 100644
index 10dc6115d..000000000
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-for-box-dyn-error.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// run-fail
-// error-pattern:returned Box<dyn Error> from main()
-// failure-status: 1
-// ignore-emscripten no processes
-
-use std::error::Error;
-use std::io;
-
-fn main() -> Result<(), Box<dyn Error>> {
- Err(Box::new(io::Error::new(io::ErrorKind::Other, "returned Box<dyn Error> from main()")))
-}
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-for-never.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-never.rs
deleted file mode 100644
index faf2526c8..000000000
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-for-never.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-// run-fail
-// error-pattern:oh, dear
-// ignore-emscripten no processes
-
-fn main() -> ! {
- panic!("oh, dear");
-}
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs
deleted file mode 100644
index 6a625fb05..000000000
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs
+++ /dev/null
@@ -1,10 +0,0 @@
-// run-fail
-// error-pattern:returned Box<Error> from main()
-// failure-status: 1
-// ignore-emscripten no processes
-
-use std::io::{Error, ErrorKind};
-
-fn main() -> Result<(), Box<Error>> {
- Err(Box::new(Error::new(ErrorKind::Other, "returned Box<Error> from main()")))
-}
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-for-str.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-for-str.rs
deleted file mode 100644
index 94f16c6fd..000000000
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-for-str.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-// run-fail
-// error-pattern: An error message for you
-// failure-status: 1
-// ignore-emscripten no processes
-
-fn main() -> Result<(), &'static str> {
- Err("An error message for you")
-}
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-impl-trait.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-impl-trait.rs
deleted file mode 100644
index 3b60cbc57..000000000
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-impl-trait.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-// Tests that an `impl Trait` that is not `impl Termination` will not work.
-fn main() -> impl Copy { }
-//~^ ERROR `main` has invalid return type `impl Copy`
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-impl-trait.stderr b/src/test/ui/rfc-1937-termination-trait/termination-trait-impl-trait.stderr
deleted file mode 100644
index 5ee6d127e..000000000
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-impl-trait.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0277]: `main` has invalid return type `impl Copy`
- --> $DIR/termination-trait-impl-trait.rs:2:14
- |
-LL | fn main() -> impl Copy { }
- | ^^^^^^^^^ `main` can only return types that implement `Termination`
- |
- = help: consider using `()`, or a `Result`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.rs
deleted file mode 100644
index 96808a3ed..000000000
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.rs
+++ /dev/null
@@ -1,15 +0,0 @@
-// compile-flags: --test
-
-#![feature(test)]
-
-extern crate test;
-use std::num::ParseIntError;
-use test::Bencher;
-
-#[test]
-#[should_panic]
-fn not_a_num() -> Result<(), ParseIntError> {
- //~^ ERROR functions using `#[should_panic]` must return `()`
- let _: u32 = "abc".parse()?;
- Ok(())
-}
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.stderr b/src/test/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.stderr
deleted file mode 100644
index 7f6749fc9..000000000
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.stderr
+++ /dev/null
@@ -1,12 +0,0 @@
-error: functions using `#[should_panic]` must return `()`
- --> $DIR/termination-trait-in-test-should-panic.rs:11:1
- |
-LL | / fn not_a_num() -> Result<(), ParseIntError> {
-LL | |
-LL | | let _: u32 = "abc".parse()?;
-LL | | Ok(())
-LL | | }
- | |_^
-
-error: aborting due to previous error
-
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-in-test.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-in-test.rs
deleted file mode 100644
index 43888cece..000000000
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-in-test.rs
+++ /dev/null
@@ -1,28 +0,0 @@
-// compile-flags: --test
-// run-pass
-// needs-unwind
-
-
-#![feature(test)]
-
-extern crate test;
-use std::num::ParseIntError;
-use test::Bencher;
-
-#[test]
-fn is_a_num() -> Result<(), ParseIntError> {
- let _: u32 = "22".parse()?;
- Ok(())
-}
-
-#[bench]
-fn test_a_positive_bench(_: &mut Bencher) -> Result<(), ParseIntError> {
- Ok(())
-}
-
-#[bench]
-#[should_panic]
-fn test_a_neg_bench(_: &mut Bencher) -> Result<(), ParseIntError> {
- let _: u32 = "abc".parse()?;
- Ok(())
-}
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-main-i32.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-main-i32.rs
deleted file mode 100644
index 10f7d2215..000000000
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-main-i32.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-fn main() -> i32 {
-//~^ ERROR `main` has invalid return type `i32`
-//~| NOTE `main` can only return types that implement `Termination`
-//~| HELP consider using `()`, or a `Result`
- 0
-}
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-main-i32.stderr b/src/test/ui/rfc-1937-termination-trait/termination-trait-main-i32.stderr
deleted file mode 100644
index 53779d365..000000000
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-main-i32.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0277]: `main` has invalid return type `i32`
- --> $DIR/termination-trait-main-i32.rs:1:14
- |
-LL | fn main() -> i32 {
- | ^^^ `main` can only return types that implement `Termination`
- |
- = help: consider using `()`, or a `Result`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.rs
deleted file mode 100644
index 687d5f144..000000000
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.rs
+++ /dev/null
@@ -1,3 +0,0 @@
-fn main() -> char { //~ ERROR
- ' '
-}
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.stderr b/src/test/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.stderr
deleted file mode 100644
index bc8fd92ce..000000000
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-main-wrong-type.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0277]: `main` has invalid return type `char`
- --> $DIR/termination-trait-main-wrong-type.rs:1:14
- |
-LL | fn main() -> char {
- | ^^^^ `main` can only return types that implement `Termination`
- |
- = help: consider using `()`, or a `Result`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.rs
deleted file mode 100644
index 4c6168abb..000000000
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.rs
+++ /dev/null
@@ -1,5 +0,0 @@
-struct ReturnType {}
-
-fn main() -> ReturnType { //~ ERROR `main` has invalid return type `ReturnType`
- ReturnType {}
-}
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr b/src/test/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr
deleted file mode 100644
index cb329548d..000000000
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-not-satisfied.stderr
+++ /dev/null
@@ -1,11 +0,0 @@
-error[E0277]: `main` has invalid return type `ReturnType`
- --> $DIR/termination-trait-not-satisfied.rs:3:14
- |
-LL | fn main() -> ReturnType {
- | ^^^^^^^^^^ `main` can only return types that implement `Termination`
- |
- = help: consider using `()`, or a `Result`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs
deleted file mode 100644
index 193a523ae..000000000
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs
+++ /dev/null
@@ -1,8 +0,0 @@
-// compile-flags: --test
-
-use std::num::ParseFloatError;
-
-#[test]
-fn can_parse_zero_as_f32() -> Result<f32, ParseFloatError> { //~ ERROR
- "0".parse()
-}
diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
deleted file mode 100644
index 957795211..000000000
--- a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr
+++ /dev/null
@@ -1,19 +0,0 @@
-error[E0277]: the trait bound `f32: Termination` is not satisfied
- --> $DIR/termination-trait-test-wrong-type.rs:6:31
- |
-LL | #[test]
- | ------- in this procedural macro expansion
-LL | fn can_parse_zero_as_f32() -> Result<f32, ParseFloatError> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Termination` is not implemented for `f32`
- |
- = note: required for `Result<f32, ParseFloatError>` to implement `Termination`
-note: required by a bound in `assert_test_result`
- --> $SRC_DIR/test/src/lib.rs:LL:COL
- |
-LL | pub fn assert_test_result<T: Termination>(result: T) -> Result<(), String> {
- | ^^^^^^^^^^^ required by this bound in `assert_test_result`
- = note: this error originates in the attribute macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0277`.