@@ -1883,16 +1883,6 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1883
1883
let error_access;
1884
1884
let the_place_err;
1885
1885
1886
- // rust-lang/rust#21232, #54986: during period where we reject
1887
- // partial initialization, do not complain about mutability
1888
- // errors except for actual mutation (as opposed to an attempt
1889
- // to do a partial initialization).
1890
- let previously_initialized = if let PlaceBase :: Local ( local) = place. base {
1891
- self . is_local_ever_initialized ( local, flow_state) . is_some ( )
1892
- } else {
1893
- true
1894
- } ;
1895
-
1896
1886
match kind {
1897
1887
Reservation ( WriteKind :: MutableBorrow ( borrow_kind @ BorrowKind :: Unique ) )
1898
1888
| Reservation ( WriteKind :: MutableBorrow ( borrow_kind @ BorrowKind :: Mut { .. } ) )
@@ -1966,8 +1956,18 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1966
1956
}
1967
1957
}
1968
1958
1959
+ // rust-lang/rust#21232, #54986: during period where we reject
1960
+ // partial initialization, do not complain about mutability
1961
+ // errors except for actual mutation (as opposed to an attempt
1962
+ // to do a partial initialization).
1963
+ let previously_initialized = if let PlaceBase :: Local ( local) = place. base {
1964
+ self . is_local_ever_initialized ( local, flow_state) . is_some ( )
1965
+ } else {
1966
+ true
1967
+ } ;
1968
+
1969
1969
// at this point, we have set up the error reporting state.
1970
- return if previously_initialized {
1970
+ if previously_initialized {
1971
1971
self . report_mutability_error (
1972
1972
place,
1973
1973
span,
@@ -1978,7 +1978,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1978
1978
true
1979
1979
} else {
1980
1980
false
1981
- } ;
1981
+ }
1982
1982
}
1983
1983
1984
1984
fn is_local_ever_initialized (
0 commit comments