rust/compiler/rustc_middle/src
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
..
dep_graph Simplify tls::enter_context. 2023-02-09 15:25:45 +11:00
hir remove bound_type_of query; make type_of return EarlyBinder; change type_of in metadata 2023-02-16 17:05:56 -07:00
infer Add specialized variants of mk_region. 2023-02-15 09:02:44 +11:00
middle Make things actually work 2023-02-16 03:39:59 +00:00
mir Replace mk_foo calls with infer_foo where possible. 2023-02-17 22:24:31 +11:00
query Auto merge of #107753 - kylematsuda:type-of, r=BoxyUwU 2023-02-17 04:45:15 +00:00
thir address review 2023-01-27 22:13:55 +01:00
traits Auto merge of #107753 - kylematsuda:type-of, r=BoxyUwU 2023-02-17 04:45:15 +00:00
ty Remove the InternIteratorElement impl for &'a T. 2023-02-17 22:24:34 +11:00
util Add some docs to bug, span_bug and delay_span_bug 2022-12-30 16:47:56 +01:00
arena.rs Rollup merge of #107163 - mikebenfield:parameters-pr, r=TaKO8Ki 2023-02-15 12:24:54 +05:30
error.rs Match crate and slug names 2022-11-21 15:24:50 +01:00
lib.rs Move folding and visiting traits into type library 2023-02-13 10:24:50 +00:00
lint.rs create helper function for rustc_lint_defs::Level and remove it's duplicated code r=ozkanonur 2023-01-10 10:56:17 +03:00
macros.rs Move folding and visiting traits into type library 2023-02-13 10:24:50 +00:00
metadata.rs rustc: Parameterize ty::Visibility over used ID 2022-09-07 13:35:41 +04:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
thir.rs output tree representation for thir-tree 2023-01-26 11:31:55 +01:00
values.rs add EarlyBinder::subst_identity; impl ParameterizedOverTcx (needed for rustc_metadata) and Value for EarlyBinder 2023-01-14 00:13:06 -07:00