rust/compiler/rustc_middle/src
bors 91198820d7 Auto merge of #88575 - eddyb:fn-abi-queries, r=nagisa
Querify `FnAbi::of_{fn_ptr,instance}` as `fn_abi_of_{fn_ptr,instance}`.

*Note: opening this PR as draft because it's based on #88499*

This more or less replicates the `LayoutOf::layout_of` setup from #88499, to replace `FnAbi::of_{fn_ptr,instance}` with `FnAbiOf::fn_abi_of_{fn_ptr,instance}`, and also route them through queries (which `layout_of` has used for a while).

The two changes at the use sites (other than the names) are:
* return type is now wrapped in `&'tcx`
  * the value *is* interned, which may affect performance
* the `extra_args` list is now an interned `&'tcx ty::List<Ty<'tcx>>`
  * should be cheap (it's empty for anything other than C variadics)

Theoretically, a `FnAbiOfHelpers` implementer could choose to keep the `Result<...>` instead of eagerly erroring, but the only existing users of these APIs are codegen backends, so they don't (want to) take advantage of this.
At least miri could make use of this, since it prefers propagating errors (it "just" doesn't use `FnAbi` yet - cc `@RalfJung).`

The way this is done is probably less efficient than what is possible, because the queries handle the correctness-oriented API (i.e. the split into `fn` pointers vs instances), whereas a lower-level query could end up with more reuse between different instances with identical signatures.

r? `@nagisa` cc `@oli-obk` `@bjorn3`
2021-09-19 21:39:47 +00:00
..
dep_graph Make DefPathHash->DefId panic for if the mapping fails. 2021-09-14 13:56:33 +02:00
hir Auto merge of #88703 - cjgillot:lazymod, r=petrochenkov 2021-09-19 16:13:42 +00:00
ich Auto merge of #84373 - cjgillot:resolve-span, r=michaelwoerister,petrochenkov 2021-09-11 23:35:28 +00:00
infer Miscellaneous inlining improvements 2021-06-02 08:49:58 +02:00
middle Make DefPathHash->DefId panic for if the mapping fails. 2021-09-14 13:56:33 +02:00
mir Rollup merge of #88859 - RalfJung:size-helpers, r=oli-obk 2021-09-13 21:20:40 +02:00
query Auto merge of #88575 - eddyb:fn-abi-queries, r=nagisa 2021-09-19 21:39:47 +00:00
thir add a CastKind to Node::Cast 2021-09-09 01:32:03 +01:00
traits Auto merge of #89000 - Mark-Simulacrum:no-new-lrc, r=petrochenkov 2021-09-18 20:13:21 +00:00
ty Auto merge of #88575 - eddyb:fn-abi-queries, r=nagisa 2021-09-19 21:39:47 +00:00
util Make panic/assert calls in rustc compatible with Rust 2021. 2021-02-03 22:42:53 +01:00
arena.rs ty::layout: intern FnAbis as &'tcx. 2021-09-18 01:42:45 +03:00
lib.rs Gather module items after lowering. 2021-09-12 16:33:16 +02:00
lint.rs Fix #88256, remove duplicated diagnostic 2021-09-04 19:26:25 +08:00
macros.rs Auto merge of #78779 - LeSeulArtichaut:ty-visitor-return, r=oli-obk 2020-11-17 12:24:34 +00:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
thir.rs rename mir -> thir around abstract consts 2021-09-09 01:32:03 +01:00