Commit b81adab
committed
Also recover type for errors in static items in type_of
The const interner uses the body to intern static allocations.
This means that an allocation will be mutable if the resulting type
contains interior mutability.
Const eval contains an assertion that types that are `Freeze` do not
have mutable allocations, which was failing for cases where the type was
a type error.
An alternative fix for this would be to avoid the assertion in const
eval for type errors, allowing those to both be mutable and immutable.
This is implemented in a follow-up commit as well.1 parent 14562dd commit b81adab
File tree
2 files changed
+19
-1
lines changed- compiler
- rustc_hir_analysis/src/collect
- rustc_hir/src
2 files changed
+19
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2509 | 2509 | | |
2510 | 2510 | | |
2511 | 2511 | | |
| 2512 | + | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
2512 | 2530 | | |
2513 | 2531 | | |
2514 | 2532 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
406 | | - | |
| 406 | + | |
407 | 407 | | |
408 | 408 | | |
409 | 409 | | |
| |||
0 commit comments