Remove support for compiler plugins.

They've been deprecated for four years.

This commit includes the following changes.
- It eliminates the `rustc_plugin_impl` crate.
- It changes the language used for lints in
  `compiler/rustc_driver_impl/src/lib.rs` and
  `compiler/rustc_lint/src/context.rs`. External lints are now called
  "loaded" lints, rather than "plugins" to avoid confusion with the old
  plugins. This only has a tiny effect on the output of `-W help`.
- E0457 and E0498 are no longer used.
- E0463 is narrowed, now only relating to unfound crates, not plugins.
- The `plugin` feature was moved from "active" to "removed".
- It removes the entire plugins chapter from the unstable book.
- It removes quite a few tests, mostly all of those in
  `tests/ui-fulldeps/plugin/`.

Closes #29597.
This commit is contained in:
Nicholas Nethercote 2023-10-03 13:54:17 +11:00
parent ab161d1f5d
commit 5c462a32bd
101 changed files with 57 additions and 1712 deletions

View file

@ -109,7 +109,7 @@ struct LintAlias {
struct LintGroup {
lint_ids: Vec<LintId>,
from_plugin: bool,
is_loaded: bool,
depr: Option<LintAlias>,
}
@ -160,9 +160,7 @@ impl LintStore {
// Don't display deprecated lint groups.
depr.is_none()
})
.map(|(k, LintGroup { lint_ids, from_plugin, .. })| {
(*k, lint_ids.clone(), *from_plugin)
})
.map(|(k, LintGroup { lint_ids, is_loaded, .. })| (*k, lint_ids.clone(), *is_loaded))
}
pub fn register_early_pass(
@ -221,7 +219,7 @@ impl LintStore {
.entry(edition.lint_name())
.or_insert(LintGroup {
lint_ids: vec![],
from_plugin: lint.is_plugin,
is_loaded: lint.is_loaded,
depr: None,
})
.lint_ids
@ -234,7 +232,7 @@ impl LintStore {
.entry("future_incompatible")
.or_insert(LintGroup {
lint_ids: vec![],
from_plugin: lint.is_plugin,
is_loaded: lint.is_loaded,
depr: None,
})
.lint_ids
@ -249,7 +247,7 @@ impl LintStore {
alias,
LintGroup {
lint_ids: vec![],
from_plugin: false,
is_loaded: false,
depr: Some(LintAlias { name: lint_name, silent: true }),
},
);
@ -257,21 +255,21 @@ impl LintStore {
pub fn register_group(
&mut self,
from_plugin: bool,
is_loaded: bool,
name: &'static str,
deprecated_name: Option<&'static str>,
to: Vec<LintId>,
) {
let new = self
.lint_groups
.insert(name, LintGroup { lint_ids: to, from_plugin, depr: None })
.insert(name, LintGroup { lint_ids: to, is_loaded, depr: None })
.is_none();
if let Some(deprecated) = deprecated_name {
self.lint_groups.insert(
deprecated,
LintGroup {
lint_ids: vec![],
from_plugin,
is_loaded,
depr: Some(LintAlias { name, silent: false }),
},
);