Skip to content
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

segfault on vector.filter #5444

Closed
rossmurray opened this issue Mar 20, 2013 · 2 comments
Closed

segfault on vector.filter #5444

rossmurray opened this issue Mar 20, 2013 · 2 comments

Comments

@rossmurray
Copy link

There's a segfault when running the following code (it compiles fine).

fn main() {
  let v = ~[1,2,3,4];
  let b = v.filter(|&i| i > 1);
}

Changing |&i| i > 1 to |i| *i > 1 does not fix the problem. However, using the vec::filter function instead of the method does not segfault.

Possibly related: #4878

@Thiez
Copy link
Contributor

Thiez commented Mar 20, 2013

I think this problem is caused by #4355.

@catamorphism
Copy link
Contributor

I'm pretty sure this is a dup of #4439 -- follow that bug for more news!

tesuji pushed a commit to tesuji/rustc that referenced this issue Jun 4, 2020
… r=yaahc,flip1995

new lint: vec_resize_to_zero

implements rust-lang#5444

changelog: new lint vec_resize_to_zero
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

No branches or pull requests

3 participants