diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-11-22 18:12:12 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-11-27 07:14:49 +0000 |
| commit | 881862ecb79a447c9631becb7f35c1c47b406346 (patch) | |
| tree | bb79090a9faae94868c216bbd372e2096dc2bdcd /compiler/rustc_middle | |
| parent | 0e9eee68111ec742c3d60bb96078994c494a59fb (diff) | |
| download | rust-881862ecb79a447c9631becb7f35c1c47b406346.tar.gz rust-881862ecb79a447c9631becb7f35c1c47b406346.zip | |
Rename `fn_trait_kind_from_{from_lang=>def_id}` to better convey meaning
Diffstat (limited to 'compiler/rustc_middle')
| -rw-r--r-- | compiler/rustc_middle/src/middle/lang_items.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/print/pretty.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_middle/src/middle/lang_items.rs b/compiler/rustc_middle/src/middle/lang_items.rs index dd4332d0db6..e1bcb74b281 100644 --- a/compiler/rustc_middle/src/middle/lang_items.rs +++ b/compiler/rustc_middle/src/middle/lang_items.rs @@ -27,7 +27,7 @@ impl<'tcx> TyCtxt<'tcx> { }) } - pub fn fn_trait_kind_from_lang_item(self, id: DefId) -> Option<ty::ClosureKind> { + pub fn fn_trait_kind_from_def_id(self, id: DefId) -> Option<ty::ClosureKind> { let items = self.lang_items(); match Some(id) { x if x == items.fn_trait() => Some(ty::ClosureKind::Fn), diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index d5e196b2e9f..6afb8bdc457 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -1085,7 +1085,7 @@ pub trait PrettyPrinter<'tcx>: let mut resugared = false; // Special-case `Fn(...) -> ...` and re-sugar it. - let fn_trait_kind = cx.tcx().fn_trait_kind_from_lang_item(principal.def_id); + let fn_trait_kind = cx.tcx().fn_trait_kind_from_def_id(principal.def_id); if !cx.should_print_verbose() && fn_trait_kind.is_some() { if let ty::Tuple(tys) = principal.substs.type_at(0).kind() { let mut projections = predicates.projection_bounds(); |
