Skip to content

Extend escape analysis to arguments #523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 15, 2016
Merged

Extend escape analysis to arguments #523

merged 1 commit into from
Jan 15, 2016

Conversation

sanxiyn
Copy link
Member

@sanxiyn sanxiyn commented Dec 28, 2015

cc #393.

@@ -31,6 +31,13 @@ pub struct EscapePass;
/// ```
declare_lint!(pub BOXED_LOCAL, Warn, "using Box<T> where unnecessary");

fn is_box(ty: ty::Ty) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is only used in the true case, an if let ty::TyBox(..) { won't actually be too bad.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I extracted it to a function because 1. it is used in two places (for locals and for arguments) 2. we'd want it to match String and Vec in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ok then.

llogiq added a commit that referenced this pull request Jan 15, 2016
Extend escape analysis to arguments
@llogiq llogiq merged commit 840d870 into rust-lang:master Jan 15, 2016
@llogiq
Copy link
Contributor

llogiq commented Jan 15, 2016

Thank you!

@sanxiyn sanxiyn deleted the escape-arg branch January 18, 2016 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants