Implement uncommon_codepoints lint.
Part of #55467 . The checks of `$crate` and `{{root}}` are very unfortunate. But i'm not sure where they belongs to.
Allocate HIR on an arena 4/4
This is the fourth and last PR in the series started by #66931, #66936 and #66942.
The last commits should compile on their own.
The difference with the previous PR is given by https://github.com/cjgillot/rust/compare/hirene-ty...hirene
A few more cleanups may be necessary, please tell me.
r? @eddyb like the other
cc @Zoxc
Generalize `array_into_iter` lint to also lint for boxed arrays
`Box` is special in that a method call on a box can move the value out
of the box. Thus, the same backwards-compatibility problem can arise
for boxed arrays as for simple arrays.
---
CC #66145
r? @matthewjasper (as you reviewed the first PR)
`Box` is special in that a method call on a box can move the value out
of the box. Thus, the same backwards-compatibility problem can arise
for boxed arrays as for simple arrays.
Improve diagnostics for invalid assignment
- Improve wording and span information for invalid assignment diagnostics.
- Link to https://github.com/rust-lang/rfcs/issues/372 when it appears the user is trying a destructuring assignment.
- Make the equality constraint in `where` clauses error consistent with the invalid assignment error.
Add simpler entry points to const eval for common usages.
I found the `tcx.const_eval` API to be complex/awkward to work with, because of the inherent complexity from all of the different situations it is called from. Though it mainly used in one of the following ways:
- Evaluates the value of a constant without any substitutions, e.g. evaluating a static, discriminant, etc.
- Evaluates the value of a resolved instance of a constant. this happens when evaluating unevaluated constants or normalising trait constants.
- Evaluates a promoted constant.
This PR adds three new functions `const_eval_mono`, `const_eval_resolve`, and `const_eval_promoted` to `TyCtxt`, which each cater to one of the three ways `tcx.const_eval`
is normally used.
Allocate HIR on an arena 1/4
This PR is the first in a series of 4, aiming at allocating the HIR on an arena, as a memory optimisation.
1. This first PR lays the groundwork and migrates some low-hanging fruits.
2. The second PR will migrate `hir::Expr`, `hir::Pat` and related.
3. The third PR will migrate `hir::Ty` and related.
4. The final PR will be dedicated to eventual cleanups.
In order to make the transition as gradual as possible, some lowering routines receive `Box`-allocated data and move it into the arena. This is a bit wasteful, but hopefully temporary.
Nonetheless, special care should be taken to avoid double arena allocations.
Work mentored by @Zoxc.