|
24 | 24 | use std::fmt::Write;
|
25 | 25 |
|
26 | 26 | use rustc::hir::def::{Res, DefKind};
|
27 |
| -use rustc::hir::def_id::{DefId, LOCAL_CRATE}; |
| 27 | +use rustc::hir::def_id::DefId; |
28 | 28 | use rustc::ty::{self, Ty, TyCtxt, layout::VariantIdx};
|
29 | 29 | use rustc::{lint, util};
|
30 | 30 | use rustc::lint::FutureIncompatibleInfo;
|
@@ -800,45 +800,6 @@ impl EarlyLintPass for UnusedDocComment {
|
800 | 800 | }
|
801 | 801 | }
|
802 | 802 |
|
803 |
| -declare_lint! { |
804 |
| - PLUGIN_AS_LIBRARY, |
805 |
| - Warn, |
806 |
| - "compiler plugin used as ordinary library in non-plugin crate" |
807 |
| -} |
808 |
| - |
809 |
| -declare_lint_pass!(PluginAsLibrary => [PLUGIN_AS_LIBRARY]); |
810 |
| - |
811 |
| -impl<'a, 'tcx> LateLintPass<'a, 'tcx> for PluginAsLibrary { |
812 |
| - fn check_item(&mut self, cx: &LateContext<'_, '_>, it: &hir::Item) { |
813 |
| - if cx.tcx.plugin_registrar_fn(LOCAL_CRATE).is_some() { |
814 |
| - // We're compiling a plugin; it's fine to link other plugins. |
815 |
| - return; |
816 |
| - } |
817 |
| - |
818 |
| - match it.kind { |
819 |
| - hir::ItemKind::ExternCrate(..) => (), |
820 |
| - _ => return, |
821 |
| - }; |
822 |
| - |
823 |
| - let def_id = cx.tcx.hir().local_def_id(it.hir_id); |
824 |
| - let prfn = match cx.tcx.extern_mod_stmt_cnum(def_id) { |
825 |
| - Some(cnum) => cx.tcx.plugin_registrar_fn(cnum), |
826 |
| - None => { |
827 |
| - // Probably means we aren't linking the crate for some reason. |
828 |
| - // |
829 |
| - // Not sure if / when this could happen. |
830 |
| - return; |
831 |
| - } |
832 |
| - }; |
833 |
| - |
834 |
| - if prfn.is_some() { |
835 |
| - cx.span_lint(PLUGIN_AS_LIBRARY, |
836 |
| - it.span, |
837 |
| - "compiler plugin used as an ordinary library"); |
838 |
| - } |
839 |
| - } |
840 |
| -} |
841 |
| - |
842 | 803 | declare_lint! {
|
843 | 804 | NO_MANGLE_CONST_ITEMS,
|
844 | 805 | Deny,
|
@@ -1268,7 +1229,6 @@ declare_lint_pass!(
|
1268 | 1229 | MISSING_DEBUG_IMPLEMENTATIONS,
|
1269 | 1230 | ANONYMOUS_PARAMETERS,
|
1270 | 1231 | UNUSED_DOC_COMMENTS,
|
1271 |
| - PLUGIN_AS_LIBRARY, |
1272 | 1232 | NO_MANGLE_CONST_ITEMS,
|
1273 | 1233 | NO_MANGLE_GENERIC_ITEMS,
|
1274 | 1234 | MUTABLE_TRANSMUTES,
|
|
0 commit comments