-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Literals don't live long enough #18852
Comments
let x: &'static [u8] = [0] doesn't work either. |
This now compiles without error. |
The first one compiles, but the second one is trying to assign a static lifetime to a slice on the stack, which is invalid. |
The correct workaround for the second one is to use |
lnicola
added a commit
to lnicola/rust
that referenced
this issue
Jan 7, 2025
fix: Fix a bug that was caused by fixup reversing
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Similarly you can't pass an array literal to BufReader.
The text was updated successfully, but these errors were encountered: