Skip to content

Commit 51a0425

Browse files
committed
rename lint to unnameable-test-functions
1 parent 6a2003e commit 51a0425

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/librustc_lint/builtin.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1740,20 +1740,20 @@ impl EarlyLintPass for EllipsisInclusiveRangePatterns {
17401740
}
17411741

17421742
declare_lint! {
1743-
UNTESTABLE_METHOD,
1743+
UNNAMEABLE_TEST_FUNCTIONS,
17441744
Warn,
1745-
"detects untestable method marked as #[test]"
1745+
"detects an function that cannot be named being marked as #[test]"
17461746
}
17471747

1748-
pub struct UntestableMethod;
1748+
pub struct UnnameableTestFunctions;
17491749

1750-
impl LintPass for UntestableMethod {
1750+
impl LintPass for UnnameableTestFunctions {
17511751
fn get_lints(&self) -> LintArray {
1752-
lint_array!(UNTESTABLE_METHOD)
1752+
lint_array!(UNNAMEABLE_TEST_FUNCTIONS)
17531753
}
17541754
}
17551755

1756-
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UntestableMethod {
1756+
impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnnameableTestFunctions {
17571757
fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
17581758
match it.node {
17591759
hir::ItemFn(..) => {
@@ -1765,7 +1765,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UntestableMethod {
17651765
None => {}
17661766
_ => {
17671767
cx.struct_span_lint(
1768-
UNTESTABLE_METHOD,
1768+
UNNAMEABLE_TEST_FUNCTIONS,
17691769
attr.span,
17701770
"cannot test inner function",
17711771
).emit();

src/librustc_lint/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
130130
MutableTransmutes: MutableTransmutes,
131131
UnionsWithDropFields: UnionsWithDropFields,
132132
UnreachablePub: UnreachablePub,
133-
UntestableMethod: UntestableMethod,
133+
UnnameableTestFunctions: UnnameableTestFunctions,
134134
TypeAliasBounds: TypeAliasBounds,
135135
UnusedBrokenConst: UnusedBrokenConst,
136136
TrivialConstraints: TrivialConstraints,

src/test/ui/lint/test-inner-fn.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: --test -D untestable_method
11+
// compile-flags: --test -D unnameable_test_functions
1212

1313
#[test]
1414
fn foo() {
15-
#[test] //~ ERROR cannot test inner function [untestable_method]
15+
#[test] //~ ERROR cannot test inner function [unnameable_test_functions]
1616
fn bar() {}
1717
bar();
1818
}
1919

2020
mod x {
2121
#[test]
2222
fn foo() {
23-
#[test] //~ ERROR cannot test inner function [untestable_method]
23+
#[test] //~ ERROR cannot test inner function [unnameable_test_functions]
2424
fn bar() {}
2525
bar();
2626
}

src/test/ui/lint/test-inner-fn.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
error: cannot test inner function
22
--> $DIR/test-inner-fn.rs:15:5
33
|
4-
LL | #[test] //~ ERROR cannot test inner function [untestable_method]
4+
LL | #[test] //~ ERROR cannot test inner function [unnameable_test_functions]
55
| ^^^^^^^
66
|
7-
= note: requested on the command line with `-D untestable-method`
7+
= note: requested on the command line with `-D unnameable-test-functions`
88

99
error: cannot test inner function
1010
--> $DIR/test-inner-fn.rs:23:9
1111
|
12-
LL | #[test] //~ ERROR cannot test inner function [untestable_method]
12+
LL | #[test] //~ ERROR cannot test inner function [unnameable_test_functions]
1313
| ^^^^^^^
1414

1515
error: aborting due to 2 previous errors

0 commit comments

Comments
 (0)