about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2018-08-01 10:12:51 +0200
committerGitHub <noreply@github.com>2018-08-01 10:12:51 +0200
commit5fb7c65f545c0e9f3e091bdb8ad27e4a3f5fbd0d (patch)
tree4ed3ac9cae417b8a0016572e4b1d2970bceedabf /src/rustllvm/RustWrapper.cpp
parentc9aca0343fff5fc7377f200b395d13b8335dadd1 (diff)
parent7b9388b7b5fcdbb2f7e7178dc0a533e3284184c5 (diff)
downloadrust-5fb7c65f545c0e9f3e091bdb8ad27e4a3f5fbd0d.tar.gz
rust-5fb7c65f545c0e9f3e091bdb8ad27e4a3f5fbd0d.zip
Rollup merge of #52851 - flip1995:tool_lints, r=oli-obk
Make the tool_lints actually usable

cc #44690

Necessary for rust-lang-nursery/rust-clippy#2955 and rust-lang-nursery/rust-clippy#2977

This PR makes it possible for lint tools (at the moment only for Clippy) to implement the `tool_lints`, like it was documented in #52018.

Because the `declare_lint` macro is pretty cluttered right now, there was not really a good way to add the `tool_name` as an additional argument of the macro. That's why I chose to introduce the new `declare_tool_lint` macro.

The switch from `&str` to `String` in the `lint_groups` `FxHashMap` is because I got weird error messages in the `check_lint_name` method. And the `by_name` field of the `LintStore` also uses `String`.

### What comes with this PR:

If this PR lands and Clippy switches to the `tool_lints`, the currently used methods
```rust
#[cfg_attr(feature = "cargo-clippy", allow(clippy_lint))]
#[allow(unknown_lints, clippy_lint)]
```
to `allow`/`warn`/`deny`/`forbid` Clippy lints, won't have any effects anymore, but also won't produce a warning. That is because the name of `clippy_lint` will then be `clippy::clippy_lint`. (Maybe we can add a clippy lint to search for `cfg_attr` appearances with the `cargo-clippy` feature?)

r? @oli-obk
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions