Skip to content

Commit a8f588e

Browse files
committed
---
yaml --- r: 185999 b: refs/heads/auto c: 3909253 h: refs/heads/master i: 185997: c79ba7c 185995: 2df28cf 185991: b9e1609 185983: 8c0ae4d v: v3
1 parent 2c00452 commit a8f588e

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
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 532cd5f85a93921f74f5991db2e419c6da58b188
13+
refs/heads/auto: 39092530a418fe9d361907546e16194d09f89f9a
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/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/auto/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/auto/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)