Rollup merge of #136205 - compiler-errors:len-3, r=BoxyUwU
Properly check that array length is valid type during built-in unsizing in index This results in duplicated errors, but this class of errors is not new; in general, we aren't really equipped to detect cases where a WF error due to a field type would be shadowed by the parent struct of that field also not being WF. This also adds a note for these types of mismatches to make it clear that this is due to an array type. Fixes #134352 r? boxyuwu
This commit is contained in:
commit
e8289d801c
13 changed files with 63 additions and 9 deletions
|
@ -194,6 +194,9 @@ pub enum ObligationCauseCode<'tcx> {
|
|||
/// A slice or array is WF only if `T: Sized`.
|
||||
SliceOrArrayElem,
|
||||
|
||||
/// An array `[T; N]` can only be indexed (and is only well-formed if) `N` has type usize.
|
||||
ArrayLen(Ty<'tcx>),
|
||||
|
||||
/// A tuple is WF only if its middle elements are `Sized`.
|
||||
TupleElem,
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue