Thanks again to Open Source Security, inc and Embecosm for their ongoing support for this project.
Milestone Progress
We are in the final few weeks to close out declarative macros by the end of the month; this should be the last prominent feature required before compiling more of an older version of libcore. We should be roughly on time, maybe a few days out, but nothing significant stands out as a roadblock right now. I imagine we might move some of the built-in macros to be part of the builtins and intrinsics ongoing milestone since some of these may require more builtins such as panic!.
To keep on track with our aggressive timeline, we want to begin investigations into achieving our crate metadata exports with GCC since we have several options available to us, such as LTO streaming, CPP modules, or roll our own system such as GCCGO’s .go_export section in object files with a simplified AST.
Monthly Community Call
We had our regular community call on 4th March 2022, please find our meeting notes over on: https://github.com/Rust-GCC/Reporting/blob/main/2022-03-04-community-call.md
Completed Activities
- Refactor substitution context during macro expansion to be in its own file PR981
- Enforce quites during command line cfg arguments PR983
- Bugfix memory corruption of lexing string buffers PR988
- Remove bad lambda from iteration of arguments on function types PR984
- Add must_use attribute support PR990
- Bug fix parsing macro invocation with semicolon’s during statement contexts PR985
- Fix ICE during recursive macro invocations PR986
- Support repetition separators in macro rules PR991
- Refactor HIR visitor and split it up in stmt, vis-item, pattern, external-item, impl, type and expression visitors PR954
Contributors this month
Overall Task Status
Category | Last Week | This Week | Delta |
TODO | 118 | 113 | -5 |
In Progress | 17 | 17 | – |
Completed | 297 | 306 | +9 |
Test Cases
Category | Last Week | This Week | Delta |
Passing | 6068 | 6177 | +109 |
Failed | – | – | – |
XFAIL | 21 | 21 | – |
XPASS | – | – | – |
Bugs
Category | Last Week | This Week | Delta |
TODO | 40 | 38 | -2 |
In Progress | 5 | 6 | +1 |
Completed | 109 | 112 | +3 |
Milestones Progress
Milestone | Last Week | This Week | Delta | Start Date | Completion Date | Target |
Data Structures 1 – Core | 100% | 100% | – | 30th Nov 2020 | 27th Jan 2021 | 29th Jan 2021 |
Control Flow 1 – Core | 100% | 100% | – | 28th Jan 2021 | 10th Feb 2021 | 26th Feb 2021 |
Data Structures 2 – Generics | 100% | 100% | – | 11th Feb 2021 | 14th May 2021 | 28th May 2021 |
Data Structures 3 – Traits | 100% | 100% | – | 20th May 2021 | 17th Sept 2021 | 27th Aug 2021 |
Control Flow 2 – Pattern Matching | 100% | 100% | – | 20th Sept 2021 | 9th Dec 2021 | 29th Nov 2021 |
Macros and cfg expansion | 65% | 70% | +5% | 1st Dec 2021 | – | 28th Mar 2022 |
Imports and Visibility | 0% | 0% | – | 29th Mar 2022 | – | 27th May 2022 |
Const Generics | 0% | 0% | – | 30th May 2022 | – | 25th Jul 2022 |
Intrinsics | 0% | 0% | – | 6th Sept 2021 | – | 30th Sept 2022 |
Risks
Risk | Impact (1-3) | Likelihood (0-10) | Risk (I * L) | Mitigation |
Rust Language Changes | 3 | 7 | 21 | Keep up to date with the Rust language on a regular basis |
Going over target dates | 2 | 5 | 10 | Maintain status reports and issue tracking to stakeholders |
Planned Activities
- Continue work on macros
- Continue work into Slices
- Merge unused code warning fixes
- Support the mutable context during type checking for dereference or array index operations
- Create more good-first-pr’s
Detailed changelog
must use attribute
To support must use, the GCC CPP front-end already supports the C++ nodiscard attribute which is analogus to rust must use attribute. Rust also supports using must use on types which we still need to test/support but this is the building block to support this on functions which discard their results.
#[must_use = "TEST 1"]
fn test1() -> i32 {
123
}
#[must_use = "TEST 2"]
fn test2() -> i32 {
456
}
fn main() {
let _a = test1();
test2();
}
The error respects GCC -Wunused-result but this is turned on by default in the front-end.
<source>:14:5: warning: ignoring return value of 'example::test2', that must be used: 'TEST 2' [-Wunused-result]
14 | test2();
| ^
<source>:7:1: note: declared here
7 | fn test2() -> i32 {
| ^
see: https://godbolt.org/z/81j9G584e
Recursive macros using seperators
Macros can be recusive resulting in new macro invocations which need to be expanded. They also can have matchers which are like regular expressions in their matchers which require n-number of arguments delimited by a single matcher to terminate the sequence. This looks very similar to bison grammer files which is pretty impressive how expressive macros are in rust.
macro_rules! add {
($e:expr | $($es:expr) | *) => {
$e + add!($($es) | *)
};
($e:expr) => {
$e
};
}
fn test() -> i32 {
add!(1 | 2 | 3 | 4 | 5 | 6)
}