granite-rust/library/core
Matthias Krüger f8dae0c20a
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
2023-10-06 21:17:50 +02:00
..
benches fix 2023-07-23 09:58:31 +00:00
src Rollup merge of #116481 - scottmcm:tweak-combinators, r=cuviper 2023-10-06 21:17:50 +02:00
tests MIRI -> Miri 2023-10-02 08:35:08 +02:00
Cargo.toml Update rand in the stdlib tests, and remove the getrandom feature from it 2023-01-04 14:52:41 -08:00