about summary refs log tree commit diff
path: root/src/libsyntax/test.rs
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/libsyntax/test.rs
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/libsyntax/test.rs')
-rw-r--r--src/libsyntax/test.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs
index 5264b627e96..6c01171d100 100644
--- a/src/libsyntax/test.rs
+++ b/src/libsyntax/test.rs
@@ -332,7 +332,7 @@ fn is_test_fn(cx: &TestCtxt, i: &ast::Item) -> bool {
             ast::ItemKind::Fn(ref decl, _, _, _, ref generics, _) => {
                 // If the termination trait is active, the compiler will check that the output
                 // type implements the `Termination` trait as `libtest` enforces that.
-                let output_matches = if cx.features.termination_trait {
+                let output_matches = if cx.features.termination_trait_test {
                     true
                 } else {
                     let no_output = match decl.output {
@@ -359,7 +359,7 @@ fn is_test_fn(cx: &TestCtxt, i: &ast::Item) -> bool {
         match has_test_signature(cx, i) {
             Yes => true,
             No => {
-                if cx.features.termination_trait {
+                if cx.features.termination_trait_test {
                     diag.span_err(i.span, "functions used as tests can not have any arguments");
                 } else {
                     diag.span_err(i.span, "functions used as tests must have signature fn() -> ()");
@@ -388,7 +388,7 @@ fn is_bench_fn(cx: &TestCtxt, i: &ast::Item) -> bool {
 
                 // If the termination trait is active, the compiler will check that the output
                 // type implements the `Termination` trait as `libtest` enforces that.
-                let output_matches = if cx.features.termination_trait {
+                let output_matches = if cx.features.termination_trait_test {
                     true
                 } else {
                     let no_output = match decl.output {
@@ -416,7 +416,7 @@ fn is_bench_fn(cx: &TestCtxt, i: &ast::Item) -> bool {
     if has_bench_attr && !has_bench_signature {
         let diag = cx.span_diagnostic;
 
-        if cx.features.termination_trait {
+        if cx.features.termination_trait_test {
             diag.span_err(i.span, "functions used as benches must have signature \
                                    `fn(&mut Bencher) -> impl Termination`");
         } else {