Skip to content

Conversation

ThomasdenH
Copy link

This is a minimal solution to #1391.

As discussed there, the current behaviour for allocating matrices is

  • Vec, Iterator or slice to Const storage:
    - If too small, panic
    - If too large, ignore remaining entries
  • Vec, Iterator or slice to Dyn storage:
    - If too small, panic
    - If too large and finite, panic
    - If too large and infinite, loop indefinitely

This PR merely merges the last two cases and always panics with the same message:

  • Vec, Iterator or slice to Const storage:
    - If too small, panic
    - If too large, ignore remaining entries
  • Vec, Iterator or slice to Dyn storage:
    - If too small, panic
    - If too large, panic

I think it is highly unlikely that existing code relied on the infinite loop behaviour (which would most likely crash if the vec grew too big anyway), and therefore I think this can be safely merged without impacting any existing code. This leaves the decision as to what the desired behaviour would be for later.

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.

1 participant