diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2017-03-17 11:49:53 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2017-03-30 07:55:29 -0400 |
| commit | 16a71cce514f29cb8c532248cf749e26972afb01 (patch) | |
| tree | 4c7deb57f9bd62a1f52332a9673a6d00fcadcdfb /src/rustllvm/RustWrapper.cpp | |
| parent | 1ae620bbebadbe4362a28b37bcecd41cfed66cea (diff) | |
| download | rust-16a71cce514f29cb8c532248cf749e26972afb01.tar.gz rust-16a71cce514f29cb8c532248cf749e26972afb01.zip | |
rework how we handle the type of loops
First, we keep a `CoerceMany` now to find the LUB of all the break expressions. Second, this `CoerceMany` is actually an `Option<CoerceMany>`, and we store `None` for loops where "break with an expression" is disallowed. This avoids silly duplicate errors about a type mismatch, since the loops pass already reports an error that the break cannot have an expression. Finally, since we now detect an invalid break target during HIR lowering, refactor `find_loop` to be infallible. Adjust tests as needed: - some spans from breaks are slightly different - break up a single loop into multiple since `CoerceMany` silences redundant and derived errors - add a ui test that we only give on error for loop-break-value
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
