use hir;
use hir::map as hir_map;
use hir::def_id::DefId;
-use middle::region;
+use middle::region::{self, RegionMaps};
use traits::{ObligationCause, ObligationCauseCode};
use ty::{self, Region, TyCtxt, TypeFoldable};
use ty::error::TypeError;
impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
pub fn note_and_explain_region(self,
+ region_maps: &RegionMaps,
err: &mut DiagnosticBuilder,
prefix: &str,
region: ty::Region<'tcx>,
format!("{}unknown scope: {:?}{}. Please report a bug.",
prefix, scope, suffix)
};
- let span = match scope.span(&self.hir) {
- Some(s) => s,
- None => {
- err.note(&unknown_scope());
- return;
- }
- };
+ let span = scope.span(self, region_maps);
let tag = match self.hir.find(scope.node_id()) {
Some(hir_map::NodeBlock(_)) => "block",
Some(hir_map::NodeExpr(expr)) => match expr.node {
}
impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
-
- pub fn report_region_errors(&self, errors: &Vec<RegionResolutionError<'tcx>>) {
+ pub fn report_region_errors(&self,
+ region_maps: &RegionMaps,
+ errors: &Vec<RegionResolutionError<'tcx>>) {
debug!("report_region_errors(): {} errors to start", errors.len());
// try to pre-process the errors, which will group some of them
// the error. If all of these fails, we fall back to a rather
// general bit of code that displays the error information
ConcreteFailure(origin, sub, sup) => {
-
- self.report_concrete_failure(origin, sub, sup).emit();
+ self.report_concrete_failure(region_maps, origin, sub, sup).emit();
}
GenericBoundFailure(kind, param_ty, sub) => {
- self.report_generic_bound_failure(kind, param_ty, sub);
+ self.report_generic_bound_failure(region_maps, kind, param_ty, sub);
}
SubSupConflict(var_origin, sub_origin, sub_r, sup_origin, sup_r) => {
- self.report_sub_sup_conflict(var_origin,
+ self.report_sub_sup_conflict(region_maps,
+ var_origin,
sub_origin,
sub_r,
sup_origin,
}
fn report_generic_bound_failure(&self,
+ region_maps: &RegionMaps,
origin: SubregionOrigin<'tcx>,
bound_kind: GenericKind<'tcx>,
sub: Region<'tcx>)
err.help(&format!("consider adding an explicit lifetime bound for `{}`",
bound_kind));
self.tcx.note_and_explain_region(
+ region_maps,
&mut err,
&format!("{} must be valid for ", labeled_user_string),
sub,
}
fn report_sub_sup_conflict(&self,
+ region_maps: &RegionMaps,
var_origin: RegionVariableOrigin,
sub_origin: SubregionOrigin<'tcx>,
sub_region: Region<'tcx>,
sup_region: Region<'tcx>) {
let mut err = self.report_inference_failure(var_origin);
- self.tcx.note_and_explain_region(&mut err,
+ self.tcx.note_and_explain_region(region_maps, &mut err,
"first, the lifetime cannot outlive ",
sup_region,
"...");
self.note_region_origin(&mut err, &sup_origin);
- self.tcx.note_and_explain_region(&mut err,
+ self.tcx.note_and_explain_region(region_maps, &mut err,
"but, the lifetime must be valid for ",
sub_region,
"...");
// except according to those terms.
use infer::{self, InferCtxt, SubregionOrigin};
+use middle::region::RegionMaps;
use ty::{self, Region};
use ty::error::TypeError;
use errors::DiagnosticBuilder;
}
pub(super) fn report_concrete_failure(&self,
+ region_maps: &RegionMaps,
origin: SubregionOrigin<'tcx>,
sub: Region<'tcx>,
sup: Region<'tcx>)
match origin {
infer::Subtype(trace) => {
let terr = TypeError::RegionsDoesNotOutlive(sup, sub);
- self.report_and_explain_type_error(trace, &terr)
+ let mut err = self.report_and_explain_type_error(trace, &terr);
+ self.tcx.note_and_explain_region(region_maps, &mut err, "", sup, "...");
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "...does not necessarily outlive ", sub, "");
+ err
}
infer::Reborrow(span) => {
let mut err = struct_span_err!(self.tcx.sess,
E0312,
"lifetime of reference outlives lifetime of \
borrowed content...");
- self.tcx.note_and_explain_region(&mut err,
+ self.tcx.note_and_explain_region(region_maps, &mut err,
"...the reference is valid for ",
sub,
"...");
- self.tcx.note_and_explain_region(&mut err,
+ self.tcx.note_and_explain_region(region_maps, &mut err,
"...but the borrowed content is only valid for ",
sup,
"");
of captured variable `{}`...",
self.tcx
.local_var_name_str_def_index(upvar_id.var_id));
- self.tcx.note_and_explain_region(&mut err,
+ self.tcx.note_and_explain_region(region_maps, &mut err,
"...the borrowed pointer is valid for ",
sub,
"...");
- self.tcx
- .note_and_explain_region(
- &mut err,
- &format!("...but `{}` is only valid for ",
- self.tcx.local_var_name_str_def_index(upvar_id.var_id)),
- sup,
- "");
+ self.tcx.note_and_explain_region(
+ region_maps,
+ &mut err,
+ &format!("...but `{}` is only valid for ",
+ self.tcx.local_var_name_str_def_index(upvar_id.var_id)),
+ sup,
+ "");
err
}
infer::InfStackClosure(span) => {
let mut err =
struct_span_err!(self.tcx.sess, span, E0314, "closure outlives stack frame");
- self.tcx.note_and_explain_region(&mut err,
+ self.tcx.note_and_explain_region(region_maps, &mut err,
"...the closure must be valid for ",
sub,
"...");
- self.tcx.note_and_explain_region(&mut err,
+ self.tcx.note_and_explain_region(region_maps, &mut err,
"...but the closure's stack frame is only valid \
for ",
sup,
span,
E0315,
"cannot invoke closure outside of its lifetime");
- self.tcx
- .note_and_explain_region(&mut err, "the closure is only valid for ", sup, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "the closure is only valid for ", sup, "");
err
}
infer::DerefPointer(span) => {
span,
E0473,
"dereference of reference outside its lifetime");
- self.tcx
- .note_and_explain_region(&mut err, "the reference is only valid for ", sup, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "the reference is only valid for ", sup, "");
err
}
infer::FreeVariable(span, id) => {
"captured variable `{}` does not outlive the \
enclosing closure",
self.tcx.local_var_name_str(id));
- self.tcx
- .note_and_explain_region(&mut err, "captured variable is valid for ", sup, "");
- self.tcx.note_and_explain_region(&mut err, "closure is valid for ", sub, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "captured variable is valid for ", sup, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "closure is valid for ", sub, "");
err
}
infer::IndexSlice(span) => {
span,
E0475,
"index of slice outside its lifetime");
- self.tcx.note_and_explain_region(&mut err, "the slice is only valid for ", sup, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "the slice is only valid for ", sup, "");
err
}
infer::RelateObjectBound(span) => {
E0476,
"lifetime of the source pointer does not outlive \
lifetime bound of the object type");
- self.tcx.note_and_explain_region(&mut err, "object type is valid for ", sub, "");
- self.tcx.note_and_explain_region(&mut err,
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "object type is valid for ", sub, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err,
"source pointer is only valid for ",
sup,
"");
self.ty_to_string(ty));
match *sub {
ty::ReStatic => {
- self.tcx.note_and_explain_region(&mut err, "type must satisfy ", sub, "")
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "type must satisfy ", sub, "")
}
_ => {
- self.tcx.note_and_explain_region(&mut err, "type must outlive ", sub, "")
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "type must outlive ", sub, "")
}
}
err
infer::RelateRegionParamBound(span) => {
let mut err =
struct_span_err!(self.tcx.sess, span, E0478, "lifetime bound not satisfied");
- self.tcx.note_and_explain_region(&mut err,
+ self.tcx.note_and_explain_region(region_maps, &mut err,
"lifetime parameter instantiated with ",
sup,
"");
- self.tcx.note_and_explain_region(&mut err,
+ self.tcx.note_and_explain_region(region_maps, &mut err,
"but lifetime parameter must outlive ",
sub,
"");
"the type `{}` (provided as the value of a type \
parameter) is not valid at this point",
self.ty_to_string(ty));
- self.tcx.note_and_explain_region(&mut err, "type must outlive ", sub, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "type must outlive ", sub, "");
err
}
infer::CallRcvr(span) => {
E0480,
"lifetime of method receiver does not outlive the \
method call");
- self.tcx
- .note_and_explain_region(&mut err, "the receiver is only valid for ", sup, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "the receiver is only valid for ", sup, "");
err
}
infer::CallArg(span) => {
E0481,
"lifetime of function argument does not outlive \
the function call");
- self.tcx.note_and_explain_region(&mut err,
+ self.tcx.note_and_explain_region(region_maps, &mut err,
"the function argument is only valid for ",
sup,
"");
E0482,
"lifetime of return value does not outlive the \
function call");
- self.tcx.note_and_explain_region(&mut err,
+ self.tcx.note_and_explain_region(region_maps, &mut err,
"the return value is only valid for ",
sup,
"");
E0483,
"lifetime of operand does not outlive the \
operation");
- self.tcx
- .note_and_explain_region(&mut err, "the operand is only valid for ", sup, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "the operand is only valid for ", sup, "");
err
}
infer::AddrOf(span) => {
span,
E0484,
"reference is not valid at the time of borrow");
- self.tcx
- .note_and_explain_region(&mut err, "the borrow is only valid for ", sup, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "the borrow is only valid for ", sup, "");
err
}
infer::AutoBorrow(span) => {
E0485,
"automatically reference is not valid at the time \
of borrow");
- self.tcx.note_and_explain_region(&mut err,
+ self.tcx.note_and_explain_region(region_maps, &mut err,
"the automatic borrow is only valid for ",
sup,
"");
"type of expression contains references that are \
not valid during the expression: `{}`",
self.ty_to_string(t));
- self.tcx.note_and_explain_region(&mut err, "type is only valid for ", sup, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "type is only valid for ", sup, "");
err
}
infer::SafeDestructor(span) => {
"unsafe use of destructor: destructor might be \
called while references are dead");
// FIXME (22171): terms "super/subregion" are suboptimal
- self.tcx.note_and_explain_region(&mut err, "superregion: ", sup, "");
- self.tcx.note_and_explain_region(&mut err, "subregion: ", sub, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err, "superregion: ", sup, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err, "subregion: ", sub, "");
err
}
infer::BindingTypeIsNotValidAtDecl(span) => {
E0488,
"lifetime of variable does not enclose its \
declaration");
- self.tcx
- .note_and_explain_region(&mut err, "the variable is only valid for ", sup, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "the variable is only valid for ", sup, "");
err
}
infer::ParameterInScope(_, span) => {
span,
E0489,
"type/lifetime parameter not in scope here");
- self.tcx
- .note_and_explain_region(&mut err, "the parameter is only valid for ", sub, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "the parameter is only valid for ", sub, "");
err
}
infer::DataBorrowed(ty, span) => {
E0490,
"a value of type `{}` is borrowed for too long",
self.ty_to_string(ty));
- self.tcx.note_and_explain_region(&mut err, "the type is valid for ", sub, "");
- self.tcx.note_and_explain_region(&mut err, "but the borrow lasts for ", sup, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "the type is valid for ", sub, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "but the borrow lasts for ", sup, "");
err
}
infer::ReferenceOutlivesReferent(ty, span) => {
"in type `{}`, reference has a longer lifetime \
than the data it references",
self.ty_to_string(ty));
- self.tcx.note_and_explain_region(&mut err, "the pointer is valid for ", sub, "");
- self.tcx.note_and_explain_region(&mut err,
+ self.tcx.note_and_explain_region(region_maps, &mut err,
+ "the pointer is valid for ", sub, "");
+ self.tcx.note_and_explain_region(region_maps, &mut err,
"but the referenced data is only valid for ",
sup,
"");
// this infcx was in use. This is totally hokey but
// otherwise we have a hard time separating legit region
// errors from silly ones.
- self.report_region_errors(&errors); // see error_reporting module
+ self.report_region_errors(region_map, &errors); // see error_reporting module
}
}
//! Most of the documentation on regions can be found in
//! `middle/infer/region_inference/README.md`
-use hir::map as hir_map;
use util::nodemap::{FxHashMap, NodeMap, NodeSet};
use ty;
/// Returns the span of this CodeExtent. Note that in general the
/// returned span may not correspond to the span of any node id in
/// the AST.
- pub fn span(&self, hir_map: &hir_map::Map) -> Option<Span> {
- match hir_map.find(self.node_id()) {
- Some(hir_map::NodeBlock(ref blk)) => {
- match *self {
- CodeExtent::CallSiteScope(_) |
- CodeExtent::ParameterScope(_) |
- CodeExtent::Misc(_) |
- CodeExtent::DestructionScope(_) => Some(blk.span),
-
- CodeExtent::Remainder(r) => {
- assert_eq!(r.block, blk.id);
- // Want span for extent starting after the
- // indexed statement and ending at end of
- // `blk`; reuse span of `blk` and shift `lo`
- // forward to end of indexed statement.
- //
- // (This is the special case aluded to in the
- // doc-comment for this method)
- let stmt_span = blk.stmts[r.first_statement_index as usize].span;
- Some(Span::new(stmt_span.hi(), blk.span.hi(), stmt_span.ctxt()))
- }
+ pub fn span(&self, tcx: TyCtxt, region_maps: &RegionMaps) -> Span {
+ let root_node = region_maps.root_body.unwrap().node_id;
+ assert_eq!(DefId::local(tcx.hir.node_to_hir_id(self.node_id()).owner),
+ DefId::local(tcx.hir.node_to_hir_id(root_node).owner));
+ let span = tcx.hir.span(self.node_id());
+ if let CodeExtent::Remainder(r) = *self {
+ if let hir::map::NodeBlock(ref blk) = tcx.hir.get(r.block) {
+ // Want span for extent starting after the
+ // indexed statement and ending at end of
+ // `blk`; reuse span of `blk` and shift `lo`
+ // forward to end of indexed statement.
+ //
+ // (This is the special case aluded to in the
+ // doc-comment for this method)
+
+ let stmt_span = blk.stmts[r.first_statement_index as usize].span;
+
+ // To avoid issues with macro-generated spans, the span
+ // of the statement must be nested in that of the block.
+ if span.lo() <= stmt_span.lo() && stmt_span.lo() <= span.hi() {
+ return Span::new(stmt_span.lo(), span.hi(), span.ctxt());
}
}
- Some(hir_map::NodeExpr(ref expr)) => Some(expr.span),
- Some(hir_map::NodeStmt(ref stmt)) => Some(stmt.span),
- Some(hir_map::NodeItem(ref item)) => Some(item.span),
- Some(_) | None => None,
}
+ span
}
}
TupleSize(ExpectedFound<usize>),
FixedArraySize(ExpectedFound<usize>),
ArgCount,
+
RegionsDoesNotOutlive(Region<'tcx>, Region<'tcx>),
- RegionsNotSame(Region<'tcx>, Region<'tcx>),
- RegionsNoOverlap(Region<'tcx>, Region<'tcx>),
RegionsInsufficientlyPolymorphic(BoundRegion, Region<'tcx>),
RegionsOverlyPolymorphic(BoundRegion, Region<'tcx>),
+
Sorts(ExpectedFound<Ty<'tcx>>),
IntMismatch(ExpectedFound<ty::IntVarValue>),
FloatMismatch(ExpectedFound<ast::FloatTy>),
RegionsDoesNotOutlive(..) => {
write!(f, "lifetime mismatch")
}
- RegionsNotSame(..) => {
- write!(f, "lifetimes are not the same")
- }
- RegionsNoOverlap(..) => {
- write!(f, "lifetimes do not intersect")
- }
RegionsInsufficientlyPolymorphic(br, _) => {
write!(f,
"expected bound lifetime parameter{}{}, found concrete lifetime",
use self::TypeError::*;
match err.clone() {
- RegionsDoesNotOutlive(subregion, superregion) => {
- self.note_and_explain_region(db, "", subregion, "...");
- self.note_and_explain_region(db, "...does not necessarily outlive ",
- superregion, "");
- }
- RegionsNotSame(region1, region2) => {
- self.note_and_explain_region(db, "", region1, "...");
- self.note_and_explain_region(db, "...is not the same lifetime as ",
- region2, "");
- }
- RegionsNoOverlap(region1, region2) => {
- self.note_and_explain_region(db, "", region1, "...");
- self.note_and_explain_region(db, "...does not overlap ",
- region2, "");
- }
- RegionsInsufficientlyPolymorphic(_, conc_region) => {
- self.note_and_explain_region(db, "concrete lifetime that was found is ",
- conc_region, "");
- }
- RegionsOverlyPolymorphic(_, &ty::ReVar(_)) => {
- // don't bother to print out the message below for
- // inference variables, it's not very illuminating.
- }
- RegionsOverlyPolymorphic(_, conc_region) => {
- self.note_and_explain_region(db, "expected concrete lifetime is ",
- conc_region, "");
- }
Sorts(values) => {
let expected_str = values.expected.sort_string(self);
let found_str = values.found.sort_string(self);
RegionsDoesNotOutlive(a, b) => {
return tcx.lift(&(a, b)).map(|(a, b)| RegionsDoesNotOutlive(a, b))
}
- RegionsNotSame(a, b) => {
- return tcx.lift(&(a, b)).map(|(a, b)| RegionsNotSame(a, b))
- }
- RegionsNoOverlap(a, b) => {
- return tcx.lift(&(a, b)).map(|(a, b)| RegionsNoOverlap(a, b))
- }
RegionsInsufficientlyPolymorphic(a, b) => {
return tcx.lift(&b).map(|b| RegionsInsufficientlyPolymorphic(a, b))
}
RegionsDoesNotOutlive(a, b) => {
RegionsDoesNotOutlive(a.fold_with(folder), b.fold_with(folder))
},
- RegionsNotSame(a, b) => {
- RegionsNotSame(a.fold_with(folder), b.fold_with(folder))
- },
- RegionsNoOverlap(a, b) => {
- RegionsNoOverlap(a.fold_with(folder), b.fold_with(folder))
- },
RegionsInsufficientlyPolymorphic(a, b) => {
RegionsInsufficientlyPolymorphic(a, b.fold_with(folder))
},
match *self {
UnsafetyMismatch(x) => x.visit_with(visitor),
AbiMismatch(x) => x.visit_with(visitor),
- RegionsDoesNotOutlive(a, b) |
- RegionsNotSame(a, b) |
- RegionsNoOverlap(a, b) => {
+ RegionsDoesNotOutlive(a, b) => {
a.visit_with(visitor) || b.visit_with(visitor)
},
RegionsInsufficientlyPolymorphic(_, b) |
}
None => {
self.tcx.note_and_explain_region(
+ &self.region_maps,
&mut db,
"borrowed value must be valid for ",
sub_scope,
}
None => {
self.tcx.note_and_explain_region(
+ &self.region_maps,
&mut db,
"...but borrowed value is only valid for ",
super_scope,
None => self.cmt_to_string(&err.cmt),
};
self.tcx.note_and_explain_region(
+ &self.region_maps,
&mut db,
&format!("{} would have to be valid for ",
descr),
loan_scope,
"...");
self.tcx.note_and_explain_region(
+ &self.region_maps,
&mut db,
&format!("...but {} is only valid for ", descr),
ptr_scope,
fn region_end_span(&self, region: ty::Region<'tcx>) -> Option<Span> {
match *region {
ty::ReScope(scope) => {
- match scope.span(&self.tcx.hir) {
- Some(s) => {
- Some(s.end_point())
- }
- None => {
- None
- }
- }
+ Some(scope.span(self.tcx, &self.region_maps).end_point())
}
_ => None
}
let outer_visibility_scope = this.visibility_scope;
let source_info = this.source_info(span);
for stmt in stmts {
- let Stmt { span, kind, opt_destruction_extent } = this.hir.mirror(stmt);
+ let Stmt { kind, opt_destruction_extent } = this.hir.mirror(stmt);
match kind {
StmtKind::Expr { scope, expr } => {
unpack!(block = this.in_opt_scope(
}));
}
StmtKind::Let { remainder_scope, init_scope, pattern, initializer } => {
- let tcx = this.hir.tcx();
-
// Enter the remainder scope, i.e. the bindings' destruction scope.
this.push_scope((remainder_scope, source_info));
let_extent_stack.push(remainder_scope);
// Declare the bindings, which may create a visibility scope.
- let remainder_span = remainder_scope.span(&tcx.hir);
- let remainder_span = remainder_span.unwrap_or(span);
+ let remainder_span = remainder_scope.span(this.hir.tcx(),
+ &this.hir.region_maps);
let scope = this.declare_bindings(None, remainder_span, &pattern);
// Evaluate the initializer, if present.
if let DropKind::Value { .. } = drop_kind {
scope.needs_cleanup = true;
}
- let tcx = self.hir.tcx();
- let extent_span = extent.span(&tcx.hir).unwrap();
+ let extent_span = extent.span(self.hir.tcx(), &self.hir.region_maps);
// Attribute scope exit drops to scope's closing brace
let scope_end = extent_span.with_lo(extent_span.hi());
scope.drops.push(DropData {
hir::StmtExpr(ref expr, id) |
hir::StmtSemi(ref expr, id) => {
result.push(StmtRef::Mirror(Box::new(Stmt {
- span: stmt.span,
kind: StmtKind::Expr {
scope: CodeExtent::Misc(id),
expr: expr.to_ref(),
cx.tables(),
&local.pat);
result.push(StmtRef::Mirror(Box::new(Stmt {
- span: stmt.span,
kind: StmtKind::Let {
remainder_scope: remainder_extent,
init_scope: CodeExtent::Misc(id),
#[derive(Clone, Debug)]
pub struct Stmt<'tcx> {
- pub span: Span,
pub kind: StmtKind<'tcx>,
pub opt_destruction_extent: Option<CodeExtent>,
}
//! is calculated in `rustc_mir::transform::generator` and may be a subset of the
//! types computed here.
-use log;
use rustc::hir::def_id::DefId;
use rustc::hir::intravisit::{self, Visitor, NestedVisitorMap};
use rustc::hir::{self, Body, Pat, PatKind, Expr};
fn record(&mut self, ty: Ty<'tcx>, scope: Option<CodeExtent>, expr: Option<&'tcx Expr>) {
use syntax_pos::DUMMY_SP;
- let live_across_yield = scope.map(|s| {
- self.fcx.tcx.yield_in_extent(s, &mut self.cache).is_some()
- }).unwrap_or(true);
+ let live_across_yield = scope.map_or(Some(DUMMY_SP), |s| {
+ self.fcx.tcx.yield_in_extent(s, &mut self.cache)
+ });
- if live_across_yield {
+ if let Some(span) = live_across_yield {
let ty = self.fcx.resolve_type_vars_if_possible(&ty);
- if log_enabled!(log::LogLevel::Debug) {
- let span = scope.map(|s| s.span(&self.fcx.tcx.hir).unwrap_or(DUMMY_SP));
- debug!("type in expr = {:?}, scope = {:?}, type = {:?}, span = {:?}",
- expr, scope, ty, span);
- }
+ debug!("type in expr = {:?}, scope = {:?}, type = {:?}, span = {:?}",
+ expr, scope, ty, span);
// Map the type to the number of types added before it
let entries = self.types.len();
18 | baz(|_| ());
| ^^^ expected bound lifetime parameter, found concrete lifetime
|
- = note: concrete lifetime that was found is lifetime '_#0r
= note: required because of the requirements on the impl of `Foo` for `[closure@$DIR/closure-mismatch.rs:18:9: 18:15]`
= note: required by `baz`