diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2019-01-10 13:26:35 +0200 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2019-03-15 13:25:10 +0200 |
| commit | 37e918526a7107bc3c8de48f9a535b0100da40f5 (patch) | |
| tree | 579d87126d04c47e8e00cadca7286204c937456a /src/librustc_codegen_utils | |
| parent | 5616ca857dd05e5e62b4bfcd11bd1ea0f2e22f5e (diff) | |
| download | rust-37e918526a7107bc3c8de48f9a535b0100da40f5.tar.gz rust-37e918526a7107bc3c8de48f9a535b0100da40f5.zip | |
rustc: split off most of ty::print::PrintCx's fields into a separate struct.
Diffstat (limited to 'src/librustc_codegen_utils')
| -rw-r--r-- | src/librustc_codegen_utils/symbol_names.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustc_codegen_utils/symbol_names.rs b/src/librustc_codegen_utils/symbol_names.rs index c73c5950c0d..8f4b1d1638a 100644 --- a/src/librustc_codegen_utils/symbol_names.rs +++ b/src/librustc_codegen_utils/symbol_names.rs @@ -225,9 +225,10 @@ fn get_symbol_hash<'a, 'tcx>( } fn def_symbol_name<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> ty::SymbolName { - let mut cx = PrintCx::new(tcx, SymbolPath::new(tcx)); - let _ = cx.print_def_path(def_id, None, Namespace::ValueNS, iter::empty()); - cx.printer.into_interned() + PrintCx::with(tcx, SymbolPath::new(tcx), |mut cx| { + let _ = cx.print_def_path(def_id, None, Namespace::ValueNS, iter::empty()); + cx.printer.into_interned() + }) } fn symbol_name<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, instance: Instance<'tcx>) -> ty::SymbolName { |
