diff options
| author | flip1995 <9744647+flip1995@users.noreply.github.com> | 2018-08-27 23:24:42 +0200 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2018-08-31 00:46:55 -0700 |
| commit | ce173c12e6416b1afa4aa460076d7c807fdcdccf (patch) | |
| tree | b63444e120d61a7b80fd9725960e4d6db9d644d6 /src/librustc_plugin | |
| parent | 9521deecc4992d31f761a3bd7e3b60479837cd1d (diff) | |
| download | rust-ce173c12e6416b1afa4aa460076d7c807fdcdccf.tar.gz rust-ce173c12e6416b1afa4aa460076d7c807fdcdccf.zip | |
Add deprecated_name argument to the register lint group functions
Diffstat (limited to 'src/librustc_plugin')
| -rw-r--r-- | src/librustc_plugin/registry.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/librustc_plugin/registry.rs b/src/librustc_plugin/registry.rs index 5ef05cb1d6b..6c10ac7ea5c 100644 --- a/src/librustc_plugin/registry.rs +++ b/src/librustc_plugin/registry.rs @@ -53,7 +53,7 @@ pub struct Registry<'a> { pub late_lint_passes: Vec<LateLintPassObject>, #[doc(hidden)] - pub lint_groups: FxHashMap<&'static str, Vec<LintId>>, + pub lint_groups: FxHashMap<&'static str, (Vec<LintId>, Option<&'static str>)>, #[doc(hidden)] pub llvm_passes: Vec<String>, @@ -170,8 +170,15 @@ impl<'a> Registry<'a> { self.late_lint_passes.push(lint_pass); } /// Register a lint group. - pub fn register_lint_group(&mut self, name: &'static str, to: Vec<&'static Lint>) { - self.lint_groups.insert(name, to.into_iter().map(|x| LintId::of(x)).collect()); + pub fn register_lint_group( + &mut self, + name: &'static str, + deprecated_name: Option<&'static str>, + to: Vec<&'static Lint> + ) { + self.lint_groups.insert(name, + (to.into_iter().map(|x| LintId::of(x)).collect(), + deprecated_name)); } /// Register an LLVM pass. |
