rust/compiler
Nicholas Nethercote 9d5cf0f0bf Remove the InternIteratorElement impl for &'a T.
`InternIteratorElement` is a trait used to intern values produces by
iterators. There are three impls, corresponding to iterators that
produce different types:
- One for `T`, which operates straightforwardly.
- One for `Result<T, E>`, which is fallible, and will fail early with an
  error result if any of the iterator elements are errors.
- One for `&'a T`, which clones the items as it iterates.

That last one is bad: it's extremely easy to use it without realizing
that it clones, which goes against Rust's normal "explicit is better"
approach to cloning.

So this commit just removes it. In practice, there weren't many use
sites. For all but one of them `into_iter()` could be used, which avoids
the need for cloning. And for the one remaining case `copied()` is
used.
2023-02-17 22:24:34 +11:00
..
rustc Add a new rustc_driver dylib to rexport rustc_driver_impl 2023-02-02 07:34:41 +01:00
rustc_abi Rollup merge of #107163 - mikebenfield:parameters-pr, r=TaKO8Ki 2023-02-15 12:24:54 +05:30
rustc_apfloat compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_arena compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_ast rustc_ast: Merge impls and reorder methods for attributes and meta items 2023-02-11 23:23:17 +04:00
rustc_ast_lowering Better label for illegal impl trait types 2023-02-14 23:12:27 +00:00
rustc_ast_passes Rollup merge of #107489 - compiler-errors:non_lifetime_binders, r=cjgillot 2023-02-17 00:19:34 +01:00
rustc_ast_pretty Expand const-if-const trait bounds correctly 2023-02-07 21:00:12 +00:00
rustc_attr Add feature gate for non_lifetime_binders 2023-02-16 03:39:58 +00:00
rustc_baked_icu_data update ICU4X to 1.1.0 2023-02-04 22:28:59 +01:00
rustc_borrowck Replace mk_foo calls with infer_foo where possible. 2023-02-17 22:24:31 +11:00
rustc_builtin_macros Replace some thens with some then_somes 2023-02-16 15:26:03 +00:00
rustc_codegen_cranelift Replace mk_foo calls with infer_foo where possible. 2023-02-17 22:24:31 +11:00
rustc_codegen_gcc s/eval_usize/eval_target_usize/ for clarity 2023-02-14 08:51:19 +00:00
rustc_codegen_llvm remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata 2023-02-16 17:05:56 -07:00
rustc_codegen_ssa Rollup merge of #108086 - alexcrichton:wasm-relaxed-simd-feature, r=eholk 2023-02-17 00:19:36 +01:00
rustc_const_eval Replace mk_foo calls with infer_foo where possible. 2023-02-17 22:24:31 +11:00
rustc_data_structures if $c:expr { Some($r:expr) } else { None } =>> $c.then(|| $r) 2023-02-16 15:26:00 +00:00
rustc_driver Remove unneeded extern crate 2023-02-02 07:47:39 +01:00
rustc_driver_impl Remove save-analysis. 2023-02-16 15:14:45 +11:00
rustc_error_codes Add extended error message for E0523 2023-02-06 06:58:30 -05:00
rustc_error_messages Remove save-analysis. 2023-02-16 15:14:45 +11:00
rustc_errors Rollup merge of #108090 - WaffleLapkin:if_not_now_then_when…, r=oli-obk 2023-02-16 17:51:25 +01:00
rustc_expand Replace some thens with some then_somes 2023-02-16 15:26:03 +00:00
rustc_feature Rollup merge of #107489 - compiler-errors:non_lifetime_binders, r=cjgillot 2023-02-17 00:19:34 +01:00
rustc_fs_util
rustc_graphviz Fix uninlined_format_args for some compiler crates 2023-01-05 19:01:12 +01:00
rustc_hir if $c:expr { Some($r:expr) } else { None } =>> $c.then(|| $r) 2023-02-16 15:26:00 +00:00
rustc_hir_analysis Replace mk_foo calls with infer_foo where possible. 2023-02-17 22:24:31 +11:00
rustc_hir_pretty Use Mutability::{is_mut, is_not} 2023-01-30 12:26:26 +00:00
rustc_hir_typeck Remove the InternIteratorElement impl for &'a T. 2023-02-17 22:24:34 +11:00
rustc_incremental incremental: migrate diagnostics 2023-01-30 17:11:35 +00:00
rustc_index Fix IndexVec::drain_enumerated 2023-01-19 15:25:33 +00:00
rustc_infer Auto merge of #107753 - kylematsuda:type-of, r=BoxyUwU 2023-02-17 04:45:15 +00:00
rustc_interface Move provider fields back to rustc_query_impl 2023-02-16 14:55:05 +01:00
rustc_lexer Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
rustc_lint Auto merge of #107753 - kylematsuda:type-of, r=BoxyUwU 2023-02-17 04:45:15 +00:00
rustc_lint_defs Extend BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE. 2023-02-09 11:47:12 +11:00
rustc_llvm Update the minimum external LLVM to 14 2023-02-10 16:06:25 -08:00
rustc_log Rollup merge of #107895 - matthiaskrgr:cl, r=compiler-errors 2023-02-11 17:18:44 +01:00
rustc_macros Use derive attributes for uninteresting traversals 2023-02-14 15:09:40 +00:00
rustc_metadata Replace mk_foo calls with infer_foo where possible. 2023-02-17 22:24:31 +11:00
rustc_middle Remove the InternIteratorElement impl for &'a T. 2023-02-17 22:24:34 +11:00
rustc_mir_build remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata 2023-02-16 17:05:56 -07:00
rustc_mir_dataflow Replace some thens with some then_somes 2023-02-16 15:26:03 +00:00
rustc_mir_transform Replace mk_foo calls with infer_foo where possible. 2023-02-17 22:24:31 +11:00
rustc_monomorphize remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata 2023-02-16 17:05:56 -07:00
rustc_parse Replace some thens with some then_somes 2023-02-16 15:26:03 +00:00
rustc_parse_format Replace some thens with some then_somes 2023-02-16 15:26:03 +00:00
rustc_passes Auto merge of #107753 - kylematsuda:type-of, r=BoxyUwU 2023-02-17 04:45:15 +00:00
rustc_plugin_impl
rustc_privacy Auto merge of #107753 - kylematsuda:type-of, r=BoxyUwU 2023-02-17 04:45:15 +00:00
rustc_query_impl Move provider fields back to rustc_query_impl 2023-02-16 14:55:05 +01:00
rustc_query_system Auto merge of #107833 - Zoxc:arena-query-clean, r=cjgillot 2023-02-16 22:10:10 +00:00
rustc_resolve Rollup merge of #107489 - compiler-errors:non_lifetime_binders, r=cjgillot 2023-02-17 00:19:34 +01:00
rustc_serialize compiler: remove unnecessary imports and qualified paths 2022-12-10 18:45:34 +01:00
rustc_session Rollup merge of #107489 - compiler-errors:non_lifetime_binders, r=cjgillot 2023-02-17 00:19:34 +01:00
rustc_smir
rustc_span Rollup merge of #107489 - compiler-errors:non_lifetime_binders, r=cjgillot 2023-02-17 00:19:34 +01:00
rustc_symbol_mangling Remove the InternIteratorElement impl for &'a T. 2023-02-17 22:24:34 +11:00
rustc_target Rollup merge of #107968 - ian-h-chamberlain:feature/3ds-enable-thread-local, r=Nilstrieb 2023-02-15 12:24:55 +05:30
rustc_trait_selection Remove the InternIteratorElement impl for &'a T. 2023-02-17 22:24:34 +11:00
rustc_traits remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata 2023-02-16 17:05:56 -07:00
rustc_transmute s/eval_usize/eval_target_usize/ for clarity 2023-02-14 08:51:19 +00:00
rustc_ty_utils Remove the InternIteratorElement impl for &'a T. 2023-02-17 22:24:34 +11:00
rustc_type_ir Remove the InternIteratorElement impl for &'a T. 2023-02-17 22:24:34 +11:00