Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
47a443c
Duplicate lint specifications are always bug!
Mark-Simulacrum Sep 24, 2019
577d442
De-propagate optional session from lint registration
Mark-Simulacrum Sep 24, 2019
2121b04
Handle lints, not passes in push_lints
Mark-Simulacrum Sep 24, 2019
748eccd
Lints being from a plugin is dependent on the lint, not the registration
Mark-Simulacrum Oct 7, 2019
b060f3b
Split module and crate late pass registration
Mark-Simulacrum Oct 7, 2019
e1079c8
Split out just registration to separate function
Mark-Simulacrum Oct 7, 2019
68c07db
No longer implicitly register lints when registering passes
Mark-Simulacrum Oct 7, 2019
7fef397
Make get_lints be a static function
Mark-Simulacrum Oct 7, 2019
2454512
Take lint passes as constructor functions
Mark-Simulacrum Oct 7, 2019
aa4ee2c
Move to storing constructor functions inside LintStore
Mark-Simulacrum Oct 7, 2019
c1abc30
Make declare_lint take any amount of boolean fields
Mark-Simulacrum Oct 8, 2019
7abb1fa
Remove side table of future incompatibility info
Mark-Simulacrum Oct 9, 2019
c4475c7
Access future incompatibility information directly
Mark-Simulacrum Oct 9, 2019
da56d1d
Remove all borrows of lint store from Session from librustc
Mark-Simulacrum Oct 9, 2019
dab3bd6
Create lint store during plugin registration
Mark-Simulacrum Oct 9, 2019
b761367
Fix test fallout
Mark-Simulacrum Oct 9, 2019
6be0a70
Update API to be more compatible with plugin needs
Mark-Simulacrum Oct 10, 2019
4e8d1b2
Add some documentation
Mark-Simulacrum Oct 22, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
No longer implicitly register lints when registering passes
This is in preparation for on-demand constructing passes
  • Loading branch information
Mark-Simulacrum committed Oct 17, 2019
commit 68c07db80a90fd0fc3be03474555dc685864bcb6
4 changes: 0 additions & 4 deletions src/librustc/lint/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,22 +169,18 @@ impl LintStore {
}

pub fn register_early_pass(&mut self, pass: EarlyLintPassObject) {
self.register_lints(&pass.get_lints());
self.early_passes.as_mut().unwrap().push(pass);
}

pub fn register_pre_expansion_pass(&mut self, pass: EarlyLintPassObject) {
self.register_lints(&pass.get_lints());
self.pre_expansion_passes.as_mut().unwrap().push(pass);
}

pub fn register_late_pass(&mut self, pass: LateLintPassObject) {
self.register_lints(&pass.get_lints());
self.late_passes.lock().as_mut().unwrap().push(pass);
}

pub fn register_late_mod_pass(&mut self, pass: LateLintPassObject) {
self.register_lints(&pass.get_lints());
self.late_module_passes.push(pass);
}

Expand Down
2 changes: 2 additions & 0 deletions src/librustc_interface/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,11 @@ pub fn register_plugins<'a>(

let mut ls = sess.lint_store.borrow_mut();
for pass in early_lint_passes {
ls.register_lints(&pass.get_lints());
ls.register_early_pass(pass);
}
for pass in late_lint_passes {
ls.register_lints(&pass.get_lints());
ls.register_late_pass(pass);
}

Expand Down
7 changes: 6 additions & 1 deletion src/librustc_lint/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ pub fn register_builtins(store: &mut lint::LintStore, no_interleave_lints: bool)

macro_rules! register_pass {
($method:ident, $constructor:expr) => (
store.$method(box $constructor);
let obj = box $constructor;
store.register_lints(&obj.get_lints());
store.$method(obj);
)
}

Expand Down Expand Up @@ -484,8 +486,11 @@ pub fn register_builtins(store: &mut lint::LintStore, no_interleave_lints: bool)
}

pub fn register_internals(store: &mut lint::LintStore) {
store.register_lints(&DefaultHashTypes::new().get_lints());
store.register_early_pass(box DefaultHashTypes::new());
store.register_lints(&LintPassImpl.get_lints());
store.register_early_pass(box LintPassImpl);
store.register_lints(&TyTyKind.get_lints());
store.register_late_pass(box TyTyKind);
store.register_group(
false,
Expand Down