rust/compiler/rustc_mir_transform/src
Nicholas Nethercote 2200911616 Rename many interner functions.
(This is a large commit. The changes to
`compiler/rustc_middle/src/ty/context.rs` are the most important ones.)

The current naming scheme is a mess, with a mix of `_intern_`, `intern_`
and `mk_` prefixes, with little consistency. In particular, in many
cases it's easy to use an iterator interner when a (preferable) slice
interner is available.

The guiding principles of the new naming system:
- No `_intern_` prefixes.
- The `intern_` prefix is for internal operations.
- The `mk_` prefix is for external operations.
- For cases where there is a slice interner and an iterator interner,
  the former is `mk_foo` and the latter is `mk_foo_from_iter`.

Also, `slice_interners!` and `direct_interners!` can now be `pub` or
non-`pub`, which helps enforce the internal/external operations
division.

It's not perfect, but I think it's a clear improvement.

The following lists show everything that was renamed.

slice_interners
- const_list
  - mk_const_list -> mk_const_list_from_iter
  - intern_const_list -> mk_const_list
- substs
  - mk_substs -> mk_substs_from_iter
  - intern_substs -> mk_substs
  - check_substs -> check_and_mk_substs (this is a weird one)
- canonical_var_infos
  - intern_canonical_var_infos -> mk_canonical_var_infos
- poly_existential_predicates
  - mk_poly_existential_predicates -> mk_poly_existential_predicates_from_iter
  - intern_poly_existential_predicates -> mk_poly_existential_predicates
  - _intern_poly_existential_predicates -> intern_poly_existential_predicates
- predicates
  - mk_predicates -> mk_predicates_from_iter
  - intern_predicates -> mk_predicates
  - _intern_predicates -> intern_predicates
- projs
  - intern_projs -> mk_projs
- place_elems
  - mk_place_elems -> mk_place_elems_from_iter
  - intern_place_elems -> mk_place_elems
- bound_variable_kinds
  - mk_bound_variable_kinds -> mk_bound_variable_kinds_from_iter
  - intern_bound_variable_kinds -> mk_bound_variable_kinds

direct_interners
- region
  - intern_region (unchanged)
- const
  - mk_const_internal -> intern_const
- const_allocation
  - intern_const_alloc -> mk_const_alloc
- layout
  - intern_layout -> mk_layout
- adt_def
  - intern_adt_def -> mk_adt_def_from_data (unusual case, hard to avoid)
  - alloc_adt_def(!) -> mk_adt_def
- external_constraints
  - intern_external_constraints -> mk_external_constraints

Other
- type_list
  - mk_type_list -> mk_type_list_from_iter
  - intern_type_list -> mk_type_list
- tup
  - mk_tup -> mk_tup_from_iter
  - intern_tup -> mk_tup
2023-02-24 07:32:24 +11:00
..
coverage Replace enum ==s with matches where it makes sense 2023-01-30 12:26:26 +00:00
inline Remove type-traversal trait aliases 2023-02-22 17:04:58 +00:00
abort_unwinding_calls.rs remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata 2023-02-16 17:05:56 -07:00
add_call_guards.rs Replace Body::basic_blocks() with field access 2022-08-26 14:27:08 +02:00
add_moves_for_packed_drops.rs Prefer doc comments over //-comments in compiler 2022-11-27 11:19:04 +00:00
add_retag.rs Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
check_const_item_mutation.rs Refactor rustc lint API 2022-10-01 10:03:06 +00:00
check_packed_ref.rs Properly check for builtin derives 2023-02-16 19:44:03 +00:00
check_unsafety.rs Put a DefId in AggregateKind. 2023-02-02 23:09:51 +00:00
cleanup_post_borrowck.rs Remove false edges in CleanupPostBorrowck 2022-12-17 19:34:45 +01:00
const_debuginfo.rs Rename debugging_opts to unstable_opts 2022-07-13 17:47:06 -05:00
const_goto.rs Disable ConstGoto opt in cleanup blocks 2023-01-26 03:50:37 -08:00
const_prop.rs Remove type-traversal trait aliases 2023-02-22 17:04:58 +00:00
const_prop_lint.rs Remove type-traversal trait aliases 2023-02-22 17:04:58 +00:00
copy_prop.rs Rename many interner functions. 2023-02-24 07:32:24 +11:00
ctfe_limit.rs don't into self 2023-02-16 18:30:25 +01:00
dataflow_const_prop.rs Rollup merge of #108208 - cjgillot:flood-enum, r=oli-obk 2023-02-23 06:18:06 +01:00
dead_store_elimination.rs Create stable metric to measure long computation in Const Eval 2023-01-23 23:56:22 +00:00
deduce_param_attrs.rs remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata 2023-02-16 17:05:56 -07:00
deduplicate_blocks.rs Replace Body::basic_blocks() with field access 2022-08-26 14:27:08 +02:00
deref_separator.rs Refactor MIR phases 2022-08-30 01:40:14 -07:00
dest_prop.rs BasicBlock::new(0) -> START_BLOCK [no functional changes] 2023-02-16 21:33:19 -08:00
dump_mir.rs Auto merge of #105220 - oli-obk:feeding, r=cjgillot 2022-12-06 03:47:41 +00:00
early_otherwise_branch.rs Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
elaborate_box_derefs.rs Rename many interner functions. 2023-02-24 07:32:24 +11:00
elaborate_drops.rs Treat Drop as a rmw operation 2023-01-30 00:20:40 +01:00
ffi_unwind_calls.rs remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata 2023-02-16 17:05:56 -07:00
function_item_references.rs if $c:expr { Some($r:expr) } else { None } =>> $c.then(|| $r) 2023-02-16 15:26:00 +00:00
generator.rs Rename many interner functions. 2023-02-24 07:32:24 +11:00
inline.rs Rename many interner functions. 2023-02-24 07:32:24 +11:00
instcombine.rs Rename many interner functions. 2023-02-24 07:32:24 +11:00
large_enums.rs Rename many interner functions. 2023-02-24 07:32:24 +11:00
lib.rs Rename many interner functions. 2023-02-24 07:32:24 +11:00
lower_intrinsics.rs Replace _with_overflow instrinsics in LowerIntrinsics. 2023-02-18 21:45:10 +00:00
lower_slice_len.rs lint: add bad opt access internal lint 2022-07-27 11:24:27 +01:00
match_branches.rs Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
multiple_return_terminators.rs Replace Body::basic_blocks() with field access 2022-08-26 14:27:08 +02:00
normalize_array_len.rs Remove obsolete comment. 2023-01-29 22:09:51 +00:00
nrvo.rs Replace Body::basic_blocks() with field access 2022-08-26 14:27:08 +02:00
pass_manager.rs Use zero based indexing for pass_count 2022-12-02 15:55:24 +00:00
remove_noop_landing_pads.rs Create stable metric to measure long computation in Const Eval 2023-01-23 23:56:22 +00:00
remove_storage_markers.rs Make MIR basic blocks field public 2022-07-07 08:11:49 +02:00
remove_uninit_drops.rs Replace Body::basic_blocks() with field access 2022-08-26 14:27:08 +02:00
remove_unneeded_drops.rs Make MIR basic blocks field public 2022-07-07 08:11:49 +02:00
remove_zsts.rs remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata 2023-02-16 17:05:56 -07:00
required_consts.rs Don't ICE when encountering ConstKind::Error in RequiredConstsVisitor 2022-11-10 05:14:04 +00:00
reveal_all.rs Add option to mir::MutVisitor to not invalidate CFG. 2022-08-09 01:51:10 -07:00
separate_const_switch.rs Create stable metric to measure long computation in Const Eval 2023-01-23 23:56:22 +00:00
shim.rs Rename many interner functions. 2023-02-24 07:32:24 +11:00
simplify.rs BasicBlock::new(0) -> START_BLOCK [no functional changes] 2023-02-16 21:33:19 -08:00
simplify_branches.rs Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
simplify_comparison_integral.rs Remove unneeded field from SwitchTargets 2022-12-09 04:53:10 -08:00
sroa.rs Rename many interner functions. 2023-02-24 07:32:24 +11:00
ssa.rs Rollup merge of #107489 - compiler-errors:non_lifetime_binders, r=cjgillot 2023-02-17 00:19:34 +01:00
uninhabited_enum_branching.rs move things from rustc_target::abi to rustc_abi 2022-11-24 16:26:13 +03:30
unreachable_prop.rs Change src/test to tests in source files, fix tidy and tests 2023-01-11 09:32:13 +00:00