};
}
-fn const_is_rvalue_promotable_to_static<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
- def_id: DefId)
- -> bool
-{
+fn const_is_rvalue_promotable_to_static<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, def_id: DefId) -> bool {
assert!(def_id.is_local());
let hir_id = tcx.hir().as_local_hir_id(def_id)
tcx.rvalue_promotable_map(def_id).contains(&body_id.hir_id.local_id)
}
-fn rvalue_promotable_map<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
- def_id: DefId)
- -> &'tcx ItemLocalSet
-{
+fn rvalue_promotable_map<'tcx>(tcx: TyCtxt<'tcx, 'tcx>, def_id: DefId) -> &'tcx ItemLocalSet {
let outer_def_id = tcx.closure_base_def_id(def_id);
if outer_def_id != def_id {
return tcx.rvalue_promotable_map(outer_def_id);
}
struct CheckCrateVisitor<'a, 'tcx: 'a> {
- tcx: TyCtxt<'a, 'tcx, 'tcx>,
+ tcx: TyCtxt<'tcx, 'tcx>,
in_fn: bool,
in_static: bool,
mut_rvalue_borrows: HirIdSet,