diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-04-26 09:13:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-26 09:13:40 +0000 |
commit | ab845217887468b500b624f0837023122002c534 (patch) | |
tree | e54833a2cf855895e81f16e78dd546e2cb9a51e5 /gcc/rust/rust-session-manager.cc | |
parent | d7c5bbe6af7189a95d1e4f2d4171fd8b53e826b3 (diff) | |
parent | 461bf1369fa0bb1c411ecdf649dbbe62f86d0070 (diff) | |
parent | 1d19dd8a691fd3fcc6214e99d9da5bc9fcb1c122 (diff) | |
parent | 3e01b6b2a8727142e3bfd8229e8272c288421c5d (diff) | |
parent | d780b204d84433fa3bd88853985e073b02b8f3a2 (diff) | |
download | gcc-ab845217887468b500b624f0837023122002c534.zip gcc-ab845217887468b500b624f0837023122002c534.tar.gz gcc-ab845217887468b500b624f0837023122002c534.tar.bz2 |
Merge #1162 #1167 #1168 #1170
1162: CI: catch malformed test cases r=philberty a=liushuyu
- catch malformed test cases and use GitHub Actions' annotation feature to mark the failures
1167: Fix nullptr when resolving the root of a path expression r=philberty a=philberty
When we resolve paths we don't have a _type_, in this scenario there is a
bug in our resolution of this generic function so this means the root_tyty
is nullptr but the offset is non zero so we return nullptr.
Addresses #1132
This test case no longer ICE's but still fails. I have a fix in progress for this
```rust
mod mem {
extern "rust-intrinsic" {
fn transmute<U, V>(_: U) -> V;
}
}
pub trait Hasher {
fn write(&mut self, bytes: &[u8]);
fn write_u16(&mut self, i: u16) {
self.write(&mem::transmute::<_, [u8; 2]>(i))
}
}
pub struct SipHasher;
impl Hasher for SipHasher {
#[inline]
fn write(&mut self, msg: &[u8]) {}
}
```
1168: ast: resolve: Move ResolveItem into its own source file r=CohenArthur a=CohenArthur
Since we need to add new functions to resolve visibilities, we might as well refactor this file before hand :)
1170: Implement macro expansion in `IfExpr`, `IfExprConseqElse`, `IfExprConseqIf`, `IfExprConseqIfLet`. r=CohenArthur a=antego
Addresses #1141. Following up on #1161.
This change adds support for the macros inside the `if` condition expressions.
Things to note:
1. Judging by my research, the `IfExprConseqIfLet` isn't used. The parser treats the syntax `let var = if ...` as a `let` expression followed by `if` expression:

2. I didn't add the macro expansion to the `IfLetExpr...` family of expressions because I wasn't able to write a test case reproducing the missing macro expansion. I've tried the following code
```rust
fn main() -> i32 {
let mut res = 0;
enum E {
X(u8),
Y(u8),
Z(u8),
}
let v = E::Y(12);
if let E::Y(n) = v {
res = 1;
}
0
}
```
which caused the compiler error
```
FAIL: rust/compile/macro43.rs (internal compiler error: in append_reference_for_def, at rust/resolve/rust-name-resolver.h:227)
```
Co-authored-by: liushuyu <liushuyu011@gmail.com>
Co-authored-by: Philip Herron <philip.herron@embecosm.com>
Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Co-authored-by: antego <antego@users.noreply.github.com>