mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 08:44:35 +00:00
Add comment on cap_to_weakly_not
Co-authored-by: Guillaume Boisseau <Nadrieril@users.noreply.github.com>
This commit is contained in:
parent
7951311c1b
commit
6d5c6f541f
@ -2141,6 +2141,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
||||
let mut inherited_ref_mutbl_match = false;
|
||||
if match_ergonomics_mode != MatchErgonomicsMode::Legacy {
|
||||
if pat_mutbl == Mutability::Not {
|
||||
// Prevent the inner pattern from binding with `ref mut`.
|
||||
pat_info.max_ref_mutbl = pat_info.max_ref_mutbl.cap_to_weakly_not(
|
||||
inner.span.find_ancestor_inside(pat.span).map(|end| pat.span.until(end)),
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user