about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-10-06 21:17:50 +0200
committerGitHub <noreply@github.com>2023-10-06 21:17:50 +0200
commitf8dae0c20a03a584c12146c89253e2c2ef93d4b2 (patch)
tree23b91e0c10637ee3b69adbc3991363a84b7dada1 /compiler/rustc_codegen_gcc/src/errors.rs
parent9796dfdd563d9b7d09088b94b8e3314c61a3786c (diff)
parent5432d13bb04cecf213c2753b25cfb1e366cb8026 (diff)
downloadrust-f8dae0c20a03a584c12146c89253e2c2ef93d4b2.tar.gz
rust-f8dae0c20a03a584c12146c89253e2c2ef93d4b2.zip
Rollup merge of #116481 - scottmcm:tweak-combinators, r=cuviper
Reuse existing `Some`s in `Option::(x)or`

LLVM still has trouble re-using discriminants sometimes when rebuilding a two-variant enum, so when we have the correct variant already built, just use it.

That's shorter in the Rust code, as well as simpler in MIR and the optimized LLVM, so might as well: <https://rust.godbolt.org/z/KhdE8eToW>

Thanks to `@veber-alex` for pointing out this opportunity in https://github.com/rust-lang/rust/issues/101210#issuecomment-1732470941
Diffstat (limited to 'compiler/rustc_codegen_gcc/src/errors.rs')
0 files changed, 0 insertions, 0 deletions