From c79535eab9500b87ab62f9e077db3953aa06b486 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 16 May 2020 16:29:27 +0200 Subject: [PATCH] remove some unused types from the tests --- src/test/ui/issues/issue-27060-rpass.rs | 11 +---------- src/test/ui/issues/issue-27060.rs | 5 ----- src/test/ui/issues/issue-27060.stderr | 6 +++--- src/test/ui/lint/packed_reference.rs | 5 ----- src/test/ui/lint/packed_reference.stderr | 4 ++-- 5 files changed, 6 insertions(+), 25 deletions(-) diff --git a/src/test/ui/issues/issue-27060-rpass.rs b/src/test/ui/issues/issue-27060-rpass.rs index b6ffc3ecb5133..b20d614b3036b 100644 --- a/src/test/ui/issues/issue-27060-rpass.rs +++ b/src/test/ui/issues/issue-27060-rpass.rs @@ -7,19 +7,10 @@ pub struct Good { aligned: [u8; 32], } -#[repr(packed)] -pub struct JustArray { - array: [u32] -} - // kill this test when that turns to a hard error #[allow(safe_packed_borrows)] fn main() { - let good = Good { - data: &0, - data2: [&0, &0], - aligned: [0; 32] - }; + let good = Good { data: &0, data2: [&0, &0], aligned: [0; 32] }; unsafe { let _ = &good.data; // ok diff --git a/src/test/ui/issues/issue-27060.rs b/src/test/ui/issues/issue-27060.rs index 4caad03a36151..78f2022ed38df 100644 --- a/src/test/ui/issues/issue-27060.rs +++ b/src/test/ui/issues/issue-27060.rs @@ -5,11 +5,6 @@ pub struct Good { aligned: [u8; 32], } -#[repr(packed)] -pub struct JustArray { - array: [u32] -} - #[deny(safe_packed_borrows)] fn main() { let good = Good { diff --git a/src/test/ui/issues/issue-27060.stderr b/src/test/ui/issues/issue-27060.stderr index 6bf6348631a70..d14ae4d41d5c5 100644 --- a/src/test/ui/issues/issue-27060.stderr +++ b/src/test/ui/issues/issue-27060.stderr @@ -1,11 +1,11 @@ error: borrow of packed field is unsafe and requires unsafe function or block (error E0133) - --> $DIR/issue-27060.rs:26:13 + --> $DIR/issue-27060.rs:21:13 | LL | let _ = &good.data; | ^^^^^^^^^^ | note: the lint level is defined here - --> $DIR/issue-27060.rs:13:8 + --> $DIR/issue-27060.rs:8:8 | LL | #[deny(safe_packed_borrows)] | ^^^^^^^^^^^^^^^^^^^ @@ -14,7 +14,7 @@ LL | #[deny(safe_packed_borrows)] = note: fields of packed structs might be misaligned: dereferencing a misaligned pointer or even just creating a misaligned reference is undefined behavior error: borrow of packed field is unsafe and requires unsafe function or block (error E0133) - --> $DIR/issue-27060.rs:28:13 + --> $DIR/issue-27060.rs:23:13 | LL | let _ = &good.data2[0]; | ^^^^^^^^^^^^^^ diff --git a/src/test/ui/lint/packed_reference.rs b/src/test/ui/lint/packed_reference.rs index d588ffd212006..c684fd62ee345 100644 --- a/src/test/ui/lint/packed_reference.rs +++ b/src/test/ui/lint/packed_reference.rs @@ -7,11 +7,6 @@ pub struct Good { aligned: [u8; 32], } -#[repr(packed)] -pub struct JustArray { - array: [u32], -} - fn main() { unsafe { let good = Good { data: &0, data2: [&0, &0], aligned: [0; 32] }; diff --git a/src/test/ui/lint/packed_reference.stderr b/src/test/ui/lint/packed_reference.stderr index 094fb4f34d329..428f4b66944ec 100644 --- a/src/test/ui/lint/packed_reference.stderr +++ b/src/test/ui/lint/packed_reference.stderr @@ -1,5 +1,5 @@ error: reference to packed field is not allowed - --> $DIR/packed_reference.rs:19:17 + --> $DIR/packed_reference.rs:14:17 | LL | let _ = &good.data; | ^^^^^^^^^^ @@ -12,7 +12,7 @@ LL | #![deny(packed_references)] = note: fields of packed structs might be misaligned, and creating a misaligned reference is undefined behavior (even if that reference is never dereferenced) error: reference to packed field is not allowed - --> $DIR/packed_reference.rs:20:17 + --> $DIR/packed_reference.rs:15:17 | LL | let _ = &good.data2[0]; | ^^^^^^^^^^^^^^