diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-09-24 23:45:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-24 23:45:24 +0200 |
| commit | 0d0f753955afe5c79d260b03f7fbe68ee53d4950 (patch) | |
| tree | 4369c406a21e29ac2ecda87881d7c0a6bb5d60c0 /src/rustllvm/RustWrapper.cpp | |
| parent | 6a4be432123209051f7769a6f9101a4470c3798d (diff) | |
| parent | f70665a84692a80a820fccdaed19df5dde94c533 (diff) | |
| download | rust-0d0f753955afe5c79d260b03f7fbe68ee53d4950.tar.gz rust-0d0f753955afe5c79d260b03f7fbe68ee53d4950.zip | |
Rollup merge of #64698 - Centril:infer-const-with-stash, r=estebank
Recover on `const X = 42;` and infer type + Error Stash API
Here we:
1. Introduce a notion of the "error stash".
This is a map in the `Handler` to which you can `err.stash(...)` away your diagnostics and then steal them in a later "phase" of the compiler (e.g. stash in parser, steal in typeck) to enrich them with more information that isn't available in the previous "phase".
I believe I've covered all the bases to make sure these diagnostics are actually emitted eventually even under `#[cfg(FALSE)]` but please check my logic.
2. Recover when parsing `[const | static mut?] $ident = $expr;` which has a missing type.
Use the "error stash" to stash away the error and later steal the error in typeck where we emit the error as `MachineApplicable` with the actual inferred type. This builds on https://github.com/rust-lang/rust/pull/62804.
cc https://github.com/rust-lang/rfcs/pull/2545
r? @estebank
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
