Skip to content

Commit ffd5327

Browse files
committed
Add fixme for precise path diagnostics
1 parent c748f32 commit ffd5327

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

compiler/rustc_mir/src/borrow_check/diagnostics/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
215215
PlaceRef { local, projection: [proj_base @ .., elem] } => {
216216
match elem {
217217
ProjectionElem::Deref => {
218+
// FIXME(project-rfc_2229#36): print capture precisely here.
218219
let upvar_field_projection = self.is_upvar_field_projection(place);
219220
if let Some(field) = upvar_field_projection {
220221
let var_index = field.index();
@@ -259,6 +260,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
259260
ProjectionElem::Field(field, _ty) => {
260261
autoderef = true;
261262

263+
// FIXME(project-rfc_2229#36): print capture precisely here.
262264
let upvar_field_projection = self.is_upvar_field_projection(place);
263265
if let Some(field) = upvar_field_projection {
264266
let var_index = field.index();

compiler/rustc_mir/src/borrow_check/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ crate use region_infer::RegionInferenceContext;
7373
// FIXME(eddyb) perhaps move this somewhere more centrally.
7474
#[derive(Debug)]
7575
crate struct Upvar<'tcx> {
76-
// FIXME(project-rfc-2229#8): ty::CapturePlace should have a to_string(), or similar
77-
// then this should not be needed.
76+
// FIXME(project-rfc_2229#36): print capture precisely here.
7877
name: Symbol,
7978

8079
place: CapturedPlace<'tcx>,
@@ -2156,6 +2155,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
21562155
place: PlaceRef<'tcx>,
21572156
is_local_mutation_allowed: LocalMutationIsAllowed,
21582157
) -> Result<RootPlace<'tcx>, PlaceRef<'tcx>> {
2158+
debug!("is_mutable: place={:?}, is_local...={:?}", place, is_local_mutation_allowed);
21592159
match place.last_projection() {
21602160
None => {
21612161
let local = &self.body.local_decls[place.local];
@@ -2237,9 +2237,9 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
22372237
if let Some(field) = upvar_field_projection {
22382238
let upvar = &self.upvars[field.index()];
22392239
debug!(
2240-
"upvar.mutability={:?} local_mutation_is_allowed={:?} \
2241-
place={:?}",
2242-
upvar, is_local_mutation_allowed, place
2240+
"is_mutable: upvar.mutability={:?} local_mutation_is_allowed={:?} \
2241+
place={:?}, place_base={:?}",
2242+
upvar, is_local_mutation_allowed, place, place_base
22432243
);
22442244
match (upvar.place.mutability, is_local_mutation_allowed) {
22452245
(

0 commit comments

Comments
 (0)