Mut patterns need more tests #10147
Labels
A-type-system
Area: Type system
E-needs-test
Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
I think we need more tests for the various edge cases introduced by PR #10026.
run-pass tests
I'd like to see run-pass tests that declare mutable values, mutate them, and check that the results are correct within all the possible places that patterns appear:
Ideally we would test for each of those possible sites at least one of each possible sort of pattern with a
mut
binding.Probably also a good idea to have a test that inherited mutability works out.
compile-fail tests
I think we need more tests checking the interaction with the borrow checker, at least. Some things we ought to check:
x
, freeze it with&x
, and then try to mutate it. Do this for various different kinds of patterns etc.That seems like a good start. I'd probably just want to go examine the existing borrow checker tests that cover local variables and try and expand them to also test mutable bindings in the all 3 of the various locations and with various kinds of patterns.
I'll try to find some time to create some tests.
cc @luqmana
The text was updated successfully, but these errors were encountered: