Rudimentary escape analysis for Box<T>

This commit is contained in:
Manish Goregaokar
2015-12-04 15:42:53 +05:30
parent e90acaf596
commit 18e81c1b59
4 changed files with 242 additions and 1 deletions

View File

@@ -64,6 +64,7 @@ pub mod no_effect;
pub mod temporary_assignment;
pub mod transmute;
pub mod cyclomatic_complexity;
pub mod escape;
mod reexport {
pub use syntax::ast::{Name, Ident, NodeId};
@@ -116,6 +117,7 @@ pub fn plugin_registrar(reg: &mut Registry) {
reg.register_late_lint_pass(box temporary_assignment::TemporaryAssignmentPass);
reg.register_late_lint_pass(box transmute::UselessTransmute);
reg.register_late_lint_pass(box cyclomatic_complexity::CyclomaticComplexity::new(25));
reg.register_late_lint_pass(box escape::EscapePass);
reg.register_lint_group("clippy_pedantic", vec![
methods::OPTION_UNWRAP_USED,
@@ -146,6 +148,7 @@ pub fn plugin_registrar(reg: &mut Registry) {
collapsible_if::COLLAPSIBLE_IF,
cyclomatic_complexity::CYCLOMATIC_COMPLEXITY,
eq_op::EQ_OP,
escape::BOXED_LOCAL,
eta_reduction::REDUNDANT_CLOSURE,
identity_op::IDENTITY_OP,
len_zero::LEN_WITHOUT_IS_EMPTY,