add docstrings and add issue to FIXMEs

This commit is contained in:
Chris Pardy 2021-04-28 21:53:59 -04:00
parent e612f7abfc
commit d19c46870f
3 changed files with 5 additions and 3 deletions

View file

@ -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);
@ -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);

View file

@ -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, .. }
@ -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, .. }

View file

@ -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,