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

vec! macro should use with_capacity #17865

Closed
thestinger opened this issue Oct 8, 2014 · 1 comment
Closed

vec! macro should use with_capacity #17865

thestinger opened this issue Oct 8, 2014 · 1 comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) I-slow Issue: Problems and improvements with respect to performance of generated code.

Comments

@thestinger
Copy link
Contributor

There's no good reason for this doing vector reallocations.

@thestinger thestinger added I-slow Issue: Problems and improvements with respect to performance of generated code. A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) labels Oct 8, 2014
@japaric
Copy link
Member

japaric commented Oct 8, 2014

There was a PR implementing this, but I think it was postponed until RFC #88 gets accepted.

cc @kballard

lnicola pushed a commit to lnicola/rust that referenced this issue Aug 13, 2024
fix: Missing non-exhaustive let diagnostics inside async or unsafe block

The reason that this test doesn't have a pointer deref case is because the following code;
```rust
fn test(ptr: *const Result<i32, !>) {
    unsafe {
        let Ok(_x) = *ptr;
    }
}
```
is getting a block with no stmts but tail one in here(thus, no diagnostic error),
https://github.com/rust-lang/rust-analyzer/blob/0daeb5c0b05cfdf2101b0f078c27539099bf38e6/crates/hir-ty/src/diagnostics/expr.rs#L256-L257
while the following is getting a block with a single stmt without tail 🤔
```rust
fn test(x: Result<i32, &'static !>) {
    let Ok(_y) = x;
}
```
I'll make a more deep inspection and file this as a new issue

_Originally posted by `@ShoyuVanilla` in rust-lang/rust-analyzer#17853 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macros Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..) I-slow Issue: Problems and improvements with respect to performance of generated code.
Projects
None yet
Development

No branches or pull requests

2 participants