1
Fork 0

Add a query for CapturedPlace::to_symbol

This commit is contained in:
lrh2000 2021-07-09 22:40:51 +08:00
parent 0cb6f07ef2
commit cf5eda1b4d
5 changed files with 39 additions and 9 deletions

View file

@ -329,6 +329,16 @@ rustc_queries! {
}
}
query symbols_for_closure_captures(
key: (LocalDefId, DefId)
) -> Vec<rustc_span::Symbol> {
desc {
|tcx| "symbols for captures of closure `{}` in `{}`",
tcx.def_path_str(key.1),
tcx.def_path_str(key.0.to_def_id())
}
}
/// MIR after our optimization passes have run. This is MIR that is ready
/// for codegen. This is also the only query that can fetch non-local MIR, at present.
query optimized_mir(key: DefId) -> &'tcx mir::Body<'tcx> {