Throw TypeErrors instead of uncatcheable exceptions in CodegenRust.py (fixes #347, #3065).
Merge pull request #3207 from Ms2ger/347-3065-typeerror

Throw TypeErrors instead of uncatcheable exceptions in CodegenRust.py (fixes #347, #3065).