Skip to content

Commit

Permalink
add docstrings and add issue to FIXMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisPardy committed May 1, 2021
1 parent e612f7a commit d19c468
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2378,7 +2378,7 @@ impl<'tcx> Debug for Rvalue<'tcx> {
};
let mut struct_fmt = fmt.debug_struct(&name);

// FIXME: This should be a list of capture names/places
// FIXME(project-rfc-2229#48): This should be a list of capture names/places
if let Some(upvars) = tcx.upvars_mentioned(def_id) {
for (&var_id, place) in iter::zip(upvars.keys(), places) {
let var_name = tcx.hir().name(var_id);
Expand All @@ -2398,7 +2398,7 @@ impl<'tcx> Debug for Rvalue<'tcx> {
let name = format!("[generator@{:?}]", tcx.hir().span(hir_id));
let mut struct_fmt = fmt.debug_struct(&name);

// FIXME: This should be a list of capture names/places
// FIXME(project-rfc-2229#48): This should be a list of capture names/places
if let Some(upvars) = tcx.upvars_mentioned(def_id) {
for (&var_id, place) in iter::zip(upvars.keys(), places) {
let var_name = tcx.hir().name(var_id);
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_mir/src/borrow_check/diagnostics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,7 @@ impl UseSpans<'_> {
}
}

/// Returns the span of `self`, in the case of a `ClosureUse` returns the `path_span`
pub(super) fn var_or_use_path_span(self) -> Span {
match self {
UseSpans::ClosureUse { path_span: span, .. }
Expand All @@ -620,6 +621,7 @@ impl UseSpans<'_> {
}
}

/// Returns the span of `self`, in the case of a `ClosureUse` returns the `capture_kind_span`
pub(super) fn var_or_use(self) -> Span {
match self {
UseSpans::ClosureUse { capture_kind_span: span, .. }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {

diag.span_label(*span, message);

// FIXME: This should store a captured_place not a hir id
// FIXME(project-rfc-2229#48): This should store a captured_place not a hir id
if let ReturnConstraint::ClosureUpvar(upvar) = kind {
let def_id = match self.regioncx.universal_regions().defining_ty {
DefiningTy::Closure(def_id, _) => def_id,
Expand Down

0 comments on commit d19c468

Please sign in to comment.