about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--compiler/rustc_lint/src/context/diagnostics.rs2
-rw-r--r--tests/ui/imports/unused-imports-in-test-module.stderr12
2 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_lint/src/context/diagnostics.rs b/compiler/rustc_lint/src/context/diagnostics.rs
index 86434002e2c..12b6a15eedd 100644
--- a/compiler/rustc_lint/src/context/diagnostics.rs
+++ b/compiler/rustc_lint/src/context/diagnostics.rs
@@ -108,7 +108,7 @@ pub(super) fn builtin(
             if let Some(span) = in_test_module {
                 db.span_help(
                     sess.source_map().guess_head_span(span),
-                    "consider adding a `#[cfg(test)]` to the containing module",
+                    "if this is a test module, consider adding a `#[cfg(test)]` to the containing module",
                 );
             }
         }
diff --git a/tests/ui/imports/unused-imports-in-test-module.stderr b/tests/ui/imports/unused-imports-in-test-module.stderr
index 1598368eb32..2d885efc099 100644
--- a/tests/ui/imports/unused-imports-in-test-module.stderr
+++ b/tests/ui/imports/unused-imports-in-test-module.stderr
@@ -16,7 +16,7 @@ error: unused import: `super::a`
 LL |     use super::a;
    |         ^^^^^^^^
    |
-help: consider adding a `#[cfg(test)]` to the containing module
+help: if this is a test module, consider adding a `#[cfg(test)]` to the containing module
   --> $DIR/unused-imports-in-test-module.rs:8:1
    |
 LL | mod test {
@@ -28,7 +28,7 @@ error: unused import: `super::a`
 LL |     use super::a;
    |         ^^^^^^^^
    |
-help: consider adding a `#[cfg(test)]` to the containing module
+help: if this is a test module, consider adding a `#[cfg(test)]` to the containing module
   --> $DIR/unused-imports-in-test-module.rs:18:1
    |
 LL | mod tests {
@@ -40,7 +40,7 @@ error: unused import: `super::a`
 LL |     use super::a;
    |         ^^^^^^^^
    |
-help: consider adding a `#[cfg(test)]` to the containing module
+help: if this is a test module, consider adding a `#[cfg(test)]` to the containing module
   --> $DIR/unused-imports-in-test-module.rs:28:1
    |
 LL | mod test_a {
@@ -52,7 +52,7 @@ error: unused import: `super::a`
 LL |     use super::a;
    |         ^^^^^^^^
    |
-help: consider adding a `#[cfg(test)]` to the containing module
+help: if this is a test module, consider adding a `#[cfg(test)]` to the containing module
   --> $DIR/unused-imports-in-test-module.rs:38:1
    |
 LL | mod a_test {
@@ -64,7 +64,7 @@ error: unused import: `super::a`
 LL |     use super::a;
    |         ^^^^^^^^
    |
-help: consider adding a `#[cfg(test)]` to the containing module
+help: if this is a test module, consider adding a `#[cfg(test)]` to the containing module
   --> $DIR/unused-imports-in-test-module.rs:48:1
    |
 LL | mod tests_a {
@@ -76,7 +76,7 @@ error: unused import: `super::a`
 LL |     use super::a;
    |         ^^^^^^^^
    |
-help: consider adding a `#[cfg(test)]` to the containing module
+help: if this is a test module, consider adding a `#[cfg(test)]` to the containing module
   --> $DIR/unused-imports-in-test-module.rs:58:1
    |
 LL | mod a_tests {