aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/rust-session-manager.cc
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-04-26 09:13:40 +0000
committerGitHub <noreply@github.com>2022-04-26 09:13:40 +0000
commitab845217887468b500b624f0837023122002c534 (patch)
treee54833a2cf855895e81f16e78dd546e2cb9a51e5 /gcc/rust/rust-session-manager.cc
parentd7c5bbe6af7189a95d1e4f2d4171fd8b53e826b3 (diff)
parent461bf1369fa0bb1c411ecdf649dbbe62f86d0070 (diff)
parent1d19dd8a691fd3fcc6214e99d9da5bc9fcb1c122 (diff)
parent3e01b6b2a8727142e3bfd8229e8272c288421c5d (diff)
parentd780b204d84433fa3bd88853985e073b02b8f3a2 (diff)
downloadgcc-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: ![Screen Shot 2022-04-26 at 9 47 29 am](https://user-images.githubusercontent.com/1451467/165258060-6a42f918-2585-4aef-9da5-9d60d69ca248.png) 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>