Merge remote-tracking branch 'upstream/master' into rustup
This commit is contained in:
commit
b24360aa87
204 changed files with 2005 additions and 664 deletions
|
|
@ -56,9 +56,10 @@ impl<'tcx> LateLintPass<'tcx> for TrailingEmptyArray {
|
|||
fn is_struct_with_trailing_zero_sized_array<'tcx>(cx: &LateContext<'tcx>, item: &Item<'tcx>) -> bool {
|
||||
if let ItemKind::Struct(data, _) = &item.kind
|
||||
&& let Some(last_field) = data.fields().last()
|
||||
&& let field_ty = cx
|
||||
.tcx
|
||||
.normalize_erasing_regions(cx.typing_env(), cx.tcx.type_of(last_field.def_id).instantiate_identity())
|
||||
&& let field_ty = cx.tcx.normalize_erasing_regions(
|
||||
cx.typing_env(),
|
||||
cx.tcx.type_of(last_field.def_id).instantiate_identity(),
|
||||
)
|
||||
&& let ty::Array(_, array_len) = *field_ty.kind()
|
||||
&& let Some(0) = array_len.try_to_target_usize(cx.tcx)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue