Skip to content

Commit 44b2f27

Browse files
authored
Remove mentions of plugin lints (#1833)
1 parent 993c157 commit 44b2f27

File tree

2 files changed

+10
-25
lines changed

2 files changed

+10
-25
lines changed

src/diagnostics.md

-2
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,6 @@ generally based on how they are registered.
572572
- *Built-in* lints are defined inside the compiler source.
573573
- *Driver-registered* lints are registered when the compiler driver is created
574574
by an external driver. This is the mechanism used by Clippy, for example.
575-
- *Plugin* lints are registered by the [deprecated plugin system].
576575
- *Tool* lints are lints with a path prefix like `clippy::` or `rustdoc::`.
577576
- *Internal* lints are the `rustc::` scoped tool lints that only run on the
578577
rustc source tree itself and are defined in the compiler source like a
@@ -581,7 +580,6 @@ generally based on how they are registered.
581580
More information about lint registration can be found in the [LintStore]
582581
chapter.
583582

584-
[deprecated plugin system]: https://doc.rust-lang.org/nightly/unstable-book/language-features/plugin.html
585583
[LintStore]: diagnostics/lintstore.md
586584

587585
### Declaring a lint

src/diagnostics/lintstore.md

+10-23
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ This page documents some of the machinery around lint registration and how we
44
run lints in the compiler.
55

66
The [`LintStore`] is the central piece of infrastructure, around which
7-
everything rotates. It's not available during the early parts of compilation
8-
(i.e., before TyCtxt) in most code, as we need to fill it in with all of the
9-
lints, which can only happen after plugin registration.
7+
everything rotates. The `LintStore` is held as part of the [`Session`], and it
8+
gets populated with the list of lints shortly after the `Session` is created.
109

1110
## Lints vs. lint passes
1211

@@ -39,25 +38,23 @@ lints are emitted as part of other work (e.g., type checking, etc.).
3938

4039
### High-level overview
4140

42-
In [`rustc_interface::register_plugins`],
41+
In [`rustc_interface::run_compiler`],
4342
the [`LintStore`] is created,
4443
and all lints are registered.
4544

46-
There are four 'sources' of lints:
45+
There are three 'sources' of lints:
4746

4847
* internal lints: lints only used by the rustc codebase
4948
* builtin lints: lints built into the compiler and not provided by some outside
5049
source
51-
* plugin lints: lints created by plugins through the plugin system.
5250
* `rustc_interface::Config`[`register_lints`]: lints passed into the compiler
5351
during construction
5452

5553
Lints are registered via the [`LintStore::register_lint`] function. This should
5654
happen just once for any lint, or an ICE will occur.
5755

5856
Once the registration is complete, we "freeze" the lint store by placing it in
59-
an `Lrc`. Later in the driver, it's passed into the `GlobalCtxt` constructor
60-
where it lives in an immutable form from then on.
57+
an `Lrc`.
6158

6259
Lint passes are registered separately into one of the categories
6360
(pre-expansion, early, late, late module). Passes are registered as a closure
@@ -68,8 +65,8 @@ they can keep track of state internally.
6865

6966
#### Internal lints
7067

71-
These are lints used just by the compiler or plugins like `clippy`. They can be
72-
found in `rustc_lint::internal`.
68+
These are lints used just by the compiler or drivers like `clippy`. They can be
69+
found in [`rustc_lint::internal`].
7370

7471
An example of such a lint is the check that lint passes are implemented using
7572
the `declare_lint_pass!` macro and not by hand. This is accomplished with the
@@ -92,18 +89,6 @@ the [`rustc_lint::register_builtins`] function.
9289
Just like with internal lints,
9390
this happens inside of [`rustc_lint::new_lint_store`].
9491

95-
#### Plugin lints
96-
97-
This is one of the primary use cases remaining for plugins/drivers. Plugins are
98-
given access to the mutable `LintStore` during registration (which happens
99-
inside of [`rustc_interface::register_plugins`]) and they can call any
100-
functions they need on the `LintStore`, just like rustc code.
101-
102-
Plugins are intended to declare lints with the `plugin` field set to true
103-
(e.g., by way of the [`declare_tool_lint!`] macro), but this is purely for
104-
diagnostics and help text; otherwise plugin lints are mostly just as first
105-
class as rustc builtin lints.
106-
10792
#### Driver lints
10893

10994
These are the lints provided by drivers via the `rustc_interface::Config`
@@ -127,11 +112,13 @@ approach, it is beneficial to do so for performance reasons.
127112

128113
[`LintStore`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/struct.LintStore.html
129114
[`LintStore::register_lint`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/struct.LintStore.html#method.register_lints
130-
[`rustc_interface::register_plugins`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/passes/fn.register_plugins.html
131115
[`rustc_lint::register_builtins`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/fn.register_builtins.html
132116
[`rustc_lint::register_internals`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/fn.register_internals.html
133117
[`rustc_lint::new_lint_store`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/fn.new_lint_store.html
134118
[`declare_lint!`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_session/macro.declare_lint.html
135119
[`declare_tool_lint!`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_session/macro.declare_tool_lint.html
136120
[`register_lints`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/interface/struct.Config.html#structfield.register_lints
137121
[`&rustc_lint_defs::Lint`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint_defs/struct.Lint.html
122+
[`Session`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_session/struct.Session.html
123+
[`rustc_interface::run_compiler`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/index.html#reexport.run_compiler
124+
[`rustc_lint::internal`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/internal/index.html

0 commit comments

Comments
 (0)