Skip to content

Commit b13a029

Browse files
committed
---
yaml --- r: 187887 b: refs/heads/tmp c: 3909253 h: refs/heads/master i: 187885: cfa61c5 187883: 3b24fb5 187879: 304021f 187871: 51e7e13 v: v3
1 parent cc11510 commit b13a029

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 522d09dfecbeca1595f25ac58c6d0178bbd21d7d
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: 532cd5f85a93921f74f5991db2e419c6da58b188
37+
refs/heads/tmp: 39092530a418fe9d361907546e16194d09f89f9a
3838
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/tmp/src/librustc/lint/builtin.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Lints built in to rustc.
11+
//! Some lints that are built in to the compiler.
1212
//!
13-
//! This is a sibling of `lint::context` in order to ensure that
14-
//! lints implemented here use the same public API as lint plugins.
15-
//!
16-
//! To add a new lint to rustc, declare it here using `declare_lint!()`.
17-
//! Then add code to emit the new lint in the appropriate circumstances.
18-
//! You can do that in an existing `LintPass` if it makes sense, or in
19-
//! a new `LintPass`, or using `Session::add_lint` elsewhere in the
20-
//! compiler. Only do the latter if the check can't be written cleanly
21-
//! as a `LintPass`.
22-
//!
23-
//! If you define a new `LintPass`, you will also need to add it to the
24-
//! `add_builtin!` or `add_builtin_with_new!` invocation in `context.rs`.
25-
//! Use the former for unit-like structs and the latter for structs with
26-
//! a `pub fn new()`.
13+
//! These are the built-in lints that are emitted direct in the main
14+
//! compiler code, rather than using their own custom pass. Those
15+
//! lints are all available in `rustc_lint::builtin`.
2716
2817
use lint::{LintPass, LintArray};
2918

branches/tmp/src/librustc_lint/builtin.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,23 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Lints built in to rustc.
11+
//! Lints in the Rust compiler.
1212
//!
13-
//! This is a sibling of `lint::context` in order to ensure that
14-
//! lints implemented here use the same public API as lint plugins.
13+
//! This contains lints which can feasibly be implemented as their own
14+
//! AST visitor. Also see `rustc::lint::builtin`, which contains the
15+
//! definitions of lints that are emitted directly inside the main
16+
//! compiler.
1517
//!
1618
//! To add a new lint to rustc, declare it here using `declare_lint!()`.
1719
//! Then add code to emit the new lint in the appropriate circumstances.
18-
//! You can do that in an existing `LintPass` if it makes sense, or in
19-
//! a new `LintPass`, or using `Session::add_lint` elsewhere in the
20-
//! compiler. Only do the latter if the check can't be written cleanly
21-
//! as a `LintPass`.
20+
//! You can do that in an existing `LintPass` if it makes sense, or in a
21+
//! new `LintPass`, or using `Session::add_lint` elsewhere in the
22+
//! compiler. Only do the latter if the check can't be written cleanly as a
23+
//! `LintPass` (also, note that such lints will need to be defined in
24+
//! `rustc::lint::builtin`, not here).
2225
//!
2326
//! If you define a new `LintPass`, you will also need to add it to the
24-
//! `add_builtin!` or `add_builtin_with_new!` invocation in `context.rs`.
27+
//! `add_builtin!` or `add_builtin_with_new!` invocation in `lib.rs`.
2528
//! Use the former for unit-like structs and the latter for structs with
2629
//! a `pub fn new()`.
2730

branches/tmp/src/librustc_lint/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Many of the lints built into the Rust compiler.
11+
//! Lints in the Rust compiler.
12+
//!
13+
//! This currently only contains the definitions and implementations
14+
//! of most of the lints that `rustc` supports directly, it does not
15+
//! contain the infrastructure for defining/registering lints. That is
16+
//! available in `rustc::lint` and `rustc::plugin` respectively.
1217
//!
1318
//! # Note
1419
//!
@@ -54,6 +59,9 @@ use lint::{LintPassObject, LintId};
5459

5560
mod builtin;
5661

62+
/// Tell the `LintStore` about all the built-in lints (the ones
63+
/// defined in this crate and the ones defined in
64+
/// `rustc::lint::builtin`).
5765
pub fn register_builtins(store: &mut lint::LintStore, sess: Option<&Session>) {
5866
macro_rules! add_builtin {
5967
($sess:ident, $($name:ident),*,) => (

0 commit comments

Comments
 (0)