about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2018-06-19 16:03:31 -0700
committerEsteban Küber <esteban@kuber.com.ar>2018-06-26 21:13:40 -0700
commit51a0425f36f313a08a6925612e772c7302525991 (patch)
treecdd2ccb8ddcc950016ad8527495683314fc3489f
parent6a2003e4e30e368ce89a76efc4f6dbf824d01511 (diff)
downloadrust-51a0425f36f313a08a6925612e772c7302525991.tar.gz
rust-51a0425f36f313a08a6925612e772c7302525991.zip
rename lint to `unnameable-test-functions`
-rw-r--r--src/librustc_lint/builtin.rs14
-rw-r--r--src/librustc_lint/lib.rs2
-rw-r--r--src/test/ui/lint/test-inner-fn.rs6
-rw-r--r--src/test/ui/lint/test-inner-fn.stderr6
4 files changed, 14 insertions, 14 deletions
diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs
index 28e59237854..196290d495c 100644
--- a/src/librustc_lint/builtin.rs
+++ b/src/librustc_lint/builtin.rs
@@ -1740,20 +1740,20 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns {
 }
 
 declare_lint! {
-    UNTESTABLE_METHOD,
+    UNNAMEABLE_TEST_FUNCTIONS,
     Warn,
-    "detects untestable method marked as #[test]"
+    "detects an function that cannot be named being marked as #[test]"
 }
 
-pub struct UntestableMethod;
+pub struct UnnameableTestFunctions;
 
-impl LintPass for UntestableMethod {
+impl LintPass for UnnameableTestFunctions {
     fn get_lints(&self) -> LintArray {
-        lint_array!(UNTESTABLE_METHOD)
+        lint_array!(UNNAMEABLE_TEST_FUNCTIONS)
     }
 }
 
-impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UntestableMethod {
+impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnnameableTestFunctions {
     fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
         match it.node {
             hir::ItemFn(..) => {
@@ -1765,7 +1765,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UntestableMethod {
                             None => {}
                             _ => {
                                 cx.struct_span_lint(
-                                    UNTESTABLE_METHOD,
+                                    UNNAMEABLE_TEST_FUNCTIONS,
                                     attr.span,
                                     "cannot test inner function",
                                 ).emit();
diff --git a/src/librustc_lint/lib.rs b/src/librustc_lint/lib.rs
index 6c39af6dad2..adc700506ff 100644
--- a/src/librustc_lint/lib.rs
+++ b/src/librustc_lint/lib.rs
@@ -130,7 +130,7 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
         MutableTransmutes: MutableTransmutes,
         UnionsWithDropFields: UnionsWithDropFields,
         UnreachablePub: UnreachablePub,
-        UntestableMethod: UntestableMethod,
+        UnnameableTestFunctions: UnnameableTestFunctions,
         TypeAliasBounds: TypeAliasBounds,
         UnusedBrokenConst: UnusedBrokenConst,
         TrivialConstraints: TrivialConstraints,
diff --git a/src/test/ui/lint/test-inner-fn.rs b/src/test/ui/lint/test-inner-fn.rs
index 112cc2d7672..4304c96197f 100644
--- a/src/test/ui/lint/test-inner-fn.rs
+++ b/src/test/ui/lint/test-inner-fn.rs
@@ -8,11 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: --test -D untestable_method
+// compile-flags: --test -D unnameable_test_functions
 
 #[test]
 fn foo() {
-    #[test] //~ ERROR cannot test inner function [untestable_method]
+    #[test] //~ ERROR cannot test inner function [unnameable_test_functions]
     fn bar() {}
     bar();
 }
@@ -20,7 +20,7 @@ fn foo() {
 mod x {
     #[test]
     fn foo() {
-        #[test] //~ ERROR cannot test inner function [untestable_method]
+        #[test] //~ ERROR cannot test inner function [unnameable_test_functions]
         fn bar() {}
         bar();
     }
diff --git a/src/test/ui/lint/test-inner-fn.stderr b/src/test/ui/lint/test-inner-fn.stderr
index a153f11e4cf..37f0c161036 100644
--- a/src/test/ui/lint/test-inner-fn.stderr
+++ b/src/test/ui/lint/test-inner-fn.stderr
@@ -1,15 +1,15 @@
 error: cannot test inner function
   --> $DIR/test-inner-fn.rs:15:5
    |
-LL |     #[test] //~ ERROR cannot test inner function [untestable_method]
+LL |     #[test] //~ ERROR cannot test inner function [unnameable_test_functions]
    |     ^^^^^^^
    |
-   = note: requested on the command line with `-D untestable-method`
+   = note: requested on the command line with `-D unnameable-test-functions`
 
 error: cannot test inner function
   --> $DIR/test-inner-fn.rs:23:9
    |
-LL |         #[test] //~ ERROR cannot test inner function [untestable_method]
+LL |         #[test] //~ ERROR cannot test inner function [unnameable_test_functions]
    |         ^^^^^^^
 
 error: aborting due to 2 previous errors