Skip to content

librustc: Stop trying to make invalid slice with vec in statics. #8078

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

Closed
wants to merge 2 commits into from

Conversation

luqmana
Copy link
Member

@luqmana luqmana commented Jul 27, 2013

Fixes #5917 by not trying to treat &[T] as a slice since it already is one.

@alexcrichton
Copy link
Member

If you've still got a build of this lying around, does this fix #7617? I'll also test it once it gets merged though.

bors added a commit that referenced this pull request Jul 27, 2013
Fixes #5917 by not trying to treat `&[T]` as a slice since it already is one.
@luqmana
Copy link
Member Author

luqmana commented Jul 27, 2013

@alexcrichton no, I just tested and it doesn't.

@luqmana
Copy link
Member Author

luqmana commented Jul 27, 2013

Though, looking at that bug there seems to be some sort of weird interaction between the COMMANDS static and iterators. Replacing the for loop with a simple while loop works fine. When done with the for loop it's going past the end, hence the garbage values it passes to str::repeat. The odd thing though is that COMMANDS.len() gives the right value. Though I'm not very familiar with the iterators.

@alexcrichton
Copy link
Member

Weird... Sounds like it needs some more investigation regardless, thanks for checking though!

@bors bors closed this Jul 27, 2013
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.

Rust puts garbage in data structures containing static lists
5 participants