diff options
| author | hi-rustin <rustin.liu@gmail.com> | 2021-03-11 23:30:39 +0800 |
|---|---|---|
| committer | hi-rustin <rustin.liu@gmail.com> | 2021-03-12 12:06:10 +0800 |
| commit | d180f918240d2f8bd3d6f7292b63194f45901759 (patch) | |
| tree | 036c6a6ed4ae43467af16a28e621e3f752475cf6 /compiler/rustc_codegen_ssa/src | |
| parent | 5c6d3bf3896b465e15550f49c2861e3d18102270 (diff) | |
| download | rust-d180f918240d2f8bd3d6f7292b63194f45901759.tar.gz rust-d180f918240d2f8bd3d6f7292b63194f45901759.zip | |
Emit the enum range assumption if the range only contains one element
test: add test case make tidy happy
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/rvalue.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs index 1795710ff53..629cb64d43e 100644 --- a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs +++ b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs @@ -325,7 +325,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { let er = scalar.valid_range_exclusive(bx.cx()); if er.end != er.start - && scalar.valid_range.end() > scalar.valid_range.start() + && scalar.valid_range.end() >= scalar.valid_range.start() { // We want `table[e as usize ± k]` to not // have bound checks, and this is the most |
