Skip to content

Commit 6a317be

Browse files
committed
Add tests for cmdline tool lints
1 parent 798a207 commit 6a317be

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// run-pass
12+
// aux-build:lint_tool_test.rs
13+
// ignore-stage1
14+
// compile-flags: -A test-lint
15+
16+
#![feature(plugin)]
17+
#![warn(unused)]
18+
#![plugin(lint_tool_test)]
19+
20+
fn lintme() { }
21+
22+
pub fn main() {
23+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
warning: lint name `test_lint` is deprcated and does not have an effect anymore. Use: clippy::test_lint
2+
|
3+
= note: requested on the command line with `-A test_lint`
4+
5+
warning: item is named 'lintme'
6+
--> $DIR/lint_tool_cmdline_allow.rs:20:1
7+
|
8+
LL | fn lintme() { }
9+
| ^^^^^^^^^^^^^^^
10+
|
11+
= note: #[warn(clippy::test_lint)] on by default
12+
13+
warning: function is never used: `lintme`
14+
--> $DIR/lint_tool_cmdline_allow.rs:20:1
15+
|
16+
LL | fn lintme() { }
17+
| ^^^^^^^^^^^
18+
|
19+
note: lint level defined here
20+
--> $DIR/lint_tool_cmdline_allow.rs:17:9
21+
|
22+
LL | #![warn(unused)]
23+
| ^^^^^^
24+
= note: #[warn(dead_code)] implied by #[warn(unused)]
25+

0 commit comments

Comments
 (0)