about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-06-28 15:39:04 +0000
committerbors <bors@rust-lang.org>2023-06-28 15:39:04 +0000
commitea4c5c5ca55ae9614552c0d285ee6c051cf88b30 (patch)
treedbbd40abef29572b61a2448980fbd2bdfceb8022 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent750c7a11da90087c824c4782507c159e4c26ea5a (diff)
parentcee4c4169c0f98bafe2e2c6cd6d3d2d401e5ce18 (diff)
downloadrust-ea4c5c5ca55ae9614552c0d285ee6c051cf88b30.tar.gz
rust-ea4c5c5ca55ae9614552c0d285ee6c051cf88b30.zip
Auto merge of #11035 - y21:issue10729, r=Jarcho
[`option_if_let_else`]: suggest `.as_ref()` if scrutinee is of type `&Option<_>`

Fixes #10729

`Option::map_or` takes ownership, so if matching on an `&Option<_>`, we need to suggest `.as_ref()` before calling `map_or` to get the same effect and to not cause a borrowck error.

changelog: [`option_if_let_else`]: suggest `.as_ref()`/`.as_mut()` if scrutinee is of type `&Option<_>`/`&mut Option<_>`
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions