This was the first week back since the Christmas vacation, it was good to get back into Rust. The focus was making sure the name resolver was working correctly by creating an unused name pass which threw up some bugs which had to be resolved on the way.
Implicit Returns was the other big focus and with the help from @bjorn3 it helped me understand fully the implementation the official Rust compiler has made. The particular case in question was:
fn test() -> i32 {
if x > 1 {
5
} else {
0
}
123
}
This test case demonstrates that Rust treats the final last expression as the result of the function. Which means the if block is treated as a statement which should be unit type. Though if you were to remove the final expression of 123 this is now valid.
Completed Activities
- Support suffix hint on literals eg: 5.0f64 – PR #121 #122 #126
- Static variables – PR #120
- Support hex, binary, octal number literals – PR #128
- Bug fix scoping rules – PR #133 #134
- Add check for unused declarations – PR #135
- Support implicit returns – PR #131
- Created GitHub Pages for GCCRS organization https://rust-gcc.github.io/
Overall Task Status
Category | Last Week | This Week | Delta |
TODO | 35 | 32 | -3 |
In Progress | 5 | 6 | +1 |
Completed | 23 | 33 | +10 |
Test Suite
Last Week | This Week | Delta | |
Passing | 124 | 220 | +96 |
Failed | 8 | 0 | -8 |
Milestone Overview
Milestone | Last Week | This Week | Delta |
Core Data Structures | 61% | 79% | +18% |
Basic Control Flow | 14% | 14% | – |
Generics | 0% | 0% | – |
Traits | 0% | 0% | – |
Pattern Matching | 0% | 0% | – |
Imports | 0% | 0% | – |
Planned Activities for week starting 11th Jan
- Release Blog Post on Embecosm website
- Notify GCC Mailing list
- Add documentation for the name resolver on github wiki
- Mutability
- Tuples