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

rustc should output a loop in the IR for initializing arrays #5491

Closed
thestinger opened this issue Mar 22, 2013 · 1 comment
Closed

rustc should output a loop in the IR for initializing arrays #5491

thestinger opened this issue Mar 22, 2013 · 1 comment
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@thestinger
Copy link
Contributor

At the moment [1, ..256] creates 2 * 256 instructions. LLVM will optimize it back to a loop or a memset, but it would better to start with that in the first place and rely on the unrolling heuristics for small loops (which may or not be enabled right now).

@thestinger
Copy link
Contributor Author

Closing in favour of #4694.

oli-obk pushed a commit to oli-obk/rust that referenced this issue May 2, 2020
Fix issue rust-lang#2907.

Update the "borrow box" lint to avoid recommending the following
conversion:

```
  // Old
  pub fn f(&mut Box<T>) {...}

  // New
  pub fn f(&mut T) {...}
```

Given a mutable reference to a box, functions may want to change
"which" object the Box is pointing at.

This change avoids recommending removing the "Box" parameter
for mutable references.

changelog: Don't trigger [`borrow_box`] lint on `&mut Box` references
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

1 participant