]> git.lizzy.rs Git - rust.git/commitdiff
rename lint to `unnameable-test-functions`
authorEsteban Küber <esteban@kuber.com.ar>
Tue, 19 Jun 2018 23:03:31 +0000 (16:03 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Wed, 27 Jun 2018 04:13:40 +0000 (21:13 -0700)
src/librustc_lint/builtin.rs
src/librustc_lint/lib.rs
src/test/ui/lint/test-inner-fn.rs
src/test/ui/lint/test-inner-fn.stderr

index 28e59237854c524a72bc94310f9a163e1eb4fa84..196290d495c771fd51de24cd9d966d73cd4b8a9a 100644 (file)
@@ -1740,20 +1740,20 @@ fn check_pat(&mut self, cx: &EarlyContext, pat: &ast::Pat) {
 }
 
 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 @@ fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
                             None => {}
                             _ => {
                                 cx.struct_span_lint(
-                                    UNTESTABLE_METHOD,
+                                    UNNAMEABLE_TEST_FUNCTIONS,
                                     attr.span,
                                     "cannot test inner function",
                                 ).emit();
index 6c39af6dad2e372b8b67737e2f746e795ada588c..adc700506ffc0bc15f271a2b3b365edca9711021 100644 (file)
@@ -130,7 +130,7 @@ macro_rules! add_lint_group {
         MutableTransmutes: MutableTransmutes,
         UnionsWithDropFields: UnionsWithDropFields,
         UnreachablePub: UnreachablePub,
-        UntestableMethod: UntestableMethod,
+        UnnameableTestFunctions: UnnameableTestFunctions,
         TypeAliasBounds: TypeAliasBounds,
         UnusedBrokenConst: UnusedBrokenConst,
         TrivialConstraints: TrivialConstraints,
index 112cc2d76723e1406f56cba7884821bb098afa1b..4304c96197f962c5b00289fe0ec7d70a37a7ce0d 100644 (file)
@@ -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 bar() {}
 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();
     }
index a153f11e4cfdd68f3d3b974ba82d6e2ef5e7f438..37f0c161036ee0f287fc25caf96c01ad7740ef33 100644 (file)
@@ -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