diff options
| author | Brad Gibson <b2b@humanenginuity.com> | 2018-02-11 16:38:26 -0800 |
|---|---|---|
| committer | Brad Gibson <b2b@humanenginuity.com> | 2018-02-12 13:52:49 -0800 |
| commit | 7948afdc53cabf9330662ec894bf668839880a3c (patch) | |
| tree | bd1119d6004d29389079b405ac12e27d27ae4418 /src/test | |
| parent | 0bb8935136098dde90d6dcbf24237fd7e2fe569f (diff) | |
changed termination_trait's bound from Error to Debug; added compiletest header command and appropriate tests
Diffstat (limited to 'src/test')
8 files changed, 54 insertions, 0 deletions
diff --git a/src/test/compile-fail/main-wrong-type-2.rs b/src/test/compile-fail/rfc-1937-termination-trait/termination-trait-main-wrong-type.rs index a63162cf73d..a63162cf73d 100644 --- a/src/test/compile-fail/main-wrong-type-2.rs +++ b/src/test/compile-fail/rfc-1937-termination-trait/termination-trait-main-wrong-type.rs diff --git a/src/test/compile-fail/termination-trait-not-satisfied.rs b/src/test/compile-fail/rfc-1937-termination-trait/termination-trait-not-satisfied.rs index 788c38c55be..788c38c55be 100644 --- a/src/test/compile-fail/termination-trait-not-satisfied.rs +++ b/src/test/compile-fail/rfc-1937-termination-trait/termination-trait-not-satisfied.rs diff --git a/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs b/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs new file mode 100644 index 00000000000..8ce27c0a062 --- /dev/null +++ b/src/test/run-fail/rfc-1937-termination-trait/termination-trait-for-result-box-error_err.rs @@ -0,0 +1,20 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// must-compile-successfully +// failure-status: 1 + +#![feature(termination_trait)] + +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/run-pass/termination-trait-for-empty.rs b/src/test/run-pass/rfc-1937-termination-trait/termination-trait-for-empty.rs index 5e534da0128..5e534da0128 100644 --- a/src/test/run-pass/termination-trait-for-empty.rs +++ b/src/test/run-pass/rfc-1937-termination-trait/termination-trait-for-empty.rs diff --git a/src/test/run-pass/termination-trait-for-i32.rs b/src/test/run-pass/rfc-1937-termination-trait/termination-trait-for-i32.rs index fa7cb023b44..fa7cb023b44 100644 --- a/src/test/run-pass/termination-trait-for-i32.rs +++ b/src/test/run-pass/rfc-1937-termination-trait/termination-trait-for-i32.rs diff --git a/src/test/run-pass/rfc-1937-termination-trait/termination-trait-for-result-box-error_ok.rs b/src/test/run-pass/rfc-1937-termination-trait/termination-trait-for-result-box-error_ok.rs new file mode 100644 index 00000000000..269ac451cf4 --- /dev/null +++ b/src/test/run-pass/rfc-1937-termination-trait/termination-trait-for-result-box-error_ok.rs @@ -0,0 +1,17 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(termination_trait)] + +use std::io::Error; + +fn main() -> Result<(), Box<Error>> { + Ok(()) +} diff --git a/src/test/run-pass/termination-trait-for-result.rs b/src/test/run-pass/rfc-1937-termination-trait/termination-trait-for-result.rs index 751db0fb500..751db0fb500 100644 --- a/src/test/run-pass/termination-trait-for-result.rs +++ b/src/test/run-pass/rfc-1937-termination-trait/termination-trait-for-result.rs diff --git a/src/test/run-pass/termination-trait-for-result-box-error_ok.rs b/src/test/run-pass/termination-trait-for-result-box-error_ok.rs new file mode 100644 index 00000000000..269ac451cf4 --- /dev/null +++ b/src/test/run-pass/termination-trait-for-result-box-error_ok.rs @@ -0,0 +1,17 @@ +// Copyright 2018 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(termination_trait)] + +use std::io::Error; + +fn main() -> Result<(), Box<Error>> { + Ok(()) +} |
