GCC Rust – Weekly Status Report – 18th to 25th Jan 2021

The completed activities here are the final building blocks to complete the remaining tasks for the first planned milestone. In order to support the size type rules on ArrayIndexExpressions and allow for code such as:

let a;         // <?>
a = 1;         // <?>   = <I?>
let b:u32 = a; // <u32> = <I?>

The LiteralExpression of ‘1’ resolves to an IntegralInferenceVariable which when unified as part of the HM algorithm resolves to a u32 for the chain of references involved. If no type is determined this will default as usual to i32. The PR commit message has a much better explanation of this, which will bootstrap more documentation.

As for constructors for algebraic data types, this test case involving a base reference helped find some general bugs in how we handle returns from functions:

struct Foo {
    a: i32,
    b: i32,

fn foo() -> Foo {
    Foo { a: 42, b: 32 }

fn main() {
    let _f = Foo { a: 10, ..foo() };

Thanks to contributions from Thomas Schwinge for fixing some compilation warnings.

Completed Activities

  • Compilation warning fixes from Thomas Schwinge PR160 PR159
  • Add expressions with parentheses PR156
  • Complete all struct constructors with FieldAccessExpr and TupleIndexExpr – PR162 PR163
  • Enforce Typing rules on Arithmetic, Comparison, LazyBoolean Expressions PR178 PR165
  • Implement Compound Assignment Expressions PR174 PR175
  • Implement Unary Negation Expressions PR176
  • Add Float and Integer Inference variable PR181
  • Add Gimple building block to create QUAL_CONST nodes to enforce mutability PR180

Overall Task Status

CategoryLast WeekThis WeekDelta
In Progress53-2
GitHub Issues

Test Cases

CategoryLast WeekThis WeekDelta
make check-rust

Milestones Progress

MilestoneLast WeekThis WeekDelta
Data Structures 187%92%+5%
Control Flow 125%25%
Data Structures 20%0%
Data Structures 30%0%
Control Flow 20%0%
GitHub Milestones


RiskImpact (1-3)Likelihood (0-10)Risk (I * L)Mitigation
Copyright assignments2510Be up front on all PR’s that the code is destined to be up streamed to FSF

Planned Activities

  • Size Types and enforce them on ArrayIndexExpression
  • Enforce mutability rules
  • Unit Structs
  • Add more Test cases for the milestone on completion
  • Documentation on Name and Type Resolver

Leave a Reply

Your email address will not be published.