add docstrings and add issue to FIXMEs
This commit is contained in:
parent
e612f7abfc
commit
d19c46870f
3 changed files with 5 additions and 3 deletions
|
@ -2378,7 +2378,7 @@ impl<'tcx> Debug for Rvalue<'tcx> {
|
||||||
};
|
};
|
||||||
let mut struct_fmt = fmt.debug_struct(&name);
|
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) {
|
if let Some(upvars) = tcx.upvars_mentioned(def_id) {
|
||||||
for (&var_id, place) in iter::zip(upvars.keys(), places) {
|
for (&var_id, place) in iter::zip(upvars.keys(), places) {
|
||||||
let var_name = tcx.hir().name(var_id);
|
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 name = format!("[generator@{:?}]", tcx.hir().span(hir_id));
|
||||||
let mut struct_fmt = fmt.debug_struct(&name);
|
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) {
|
if let Some(upvars) = tcx.upvars_mentioned(def_id) {
|
||||||
for (&var_id, place) in iter::zip(upvars.keys(), places) {
|
for (&var_id, place) in iter::zip(upvars.keys(), places) {
|
||||||
let var_name = tcx.hir().name(var_id);
|
let var_name = tcx.hir().name(var_id);
|
||||||
|
|
|
@ -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 {
|
pub(super) fn var_or_use_path_span(self) -> Span {
|
||||||
match self {
|
match self {
|
||||||
UseSpans::ClosureUse { path_span: span, .. }
|
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 {
|
pub(super) fn var_or_use(self) -> Span {
|
||||||
match self {
|
match self {
|
||||||
UseSpans::ClosureUse { capture_kind_span: span, .. }
|
UseSpans::ClosureUse { capture_kind_span: span, .. }
|
||||||
|
|
|
@ -385,7 +385,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
||||||
|
|
||||||
diag.span_label(*span, message);
|
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 {
|
if let ReturnConstraint::ClosureUpvar(upvar) = kind {
|
||||||
let def_id = match self.regioncx.universal_regions().defining_ty {
|
let def_id = match self.regioncx.universal_regions().defining_ty {
|
||||||
DefiningTy::Closure(def_id, _) => def_id,
|
DefiningTy::Closure(def_id, _) => def_id,
|
||||||
|
|
Loading…
Add table
Reference in a new issue