We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7d0f2f commit 6c3e7afCopy full SHA for 6c3e7af
c2rust-analyze/src/rewrite/expr/convert.rs
@@ -323,7 +323,10 @@ impl<'tcx> ConvertVisitor<'tcx> {
323
) -> Option<(&[DistRewrite], &[DistRewrite])> {
324
for (i, mir_rw) in mir_rws.iter().enumerate() {
325
match mir_rw.rw {
326
- // Bail out if we see nested delimiters.
+ // Bail out if we see nested delimiters. This prevents the special
327
+ // `Option::map` rewrite from applying, so the caller will fall back on the
328
+ // `unwrap()` + `Some(_)` rewrites for `OptionMapBegin/End` that are
329
+ // implemented in `convert_cast_rewrite`.
330
mir_op::RewriteKind::OptionMapBegin => return None,
331
mir_op::RewriteKind::OptionMapEnd => {
332
let (a, b) = mir_rws.split_at(i);
0 commit comments