avoid test-wide allowance of unused/dead code

This commit is contained in:
Ralf Jung 2020-04-16 09:25:12 +02:00
parent b0fe99e81d
commit 974f9c3023
14 changed files with 24 additions and 29 deletions

View file

@ -8,14 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(dead_code)]
use std::mem;
enum Tag<A> {
Tag2(A)
}
#[allow(dead_code)]
struct Rec {
c8: u8,
t: Tag<u64>

View file

@ -1,5 +1,4 @@
#![allow(dead_code)]
#[allow(dead_code)]
struct Foo<T: ?Sized> {
a: u16,
b: T
@ -17,6 +16,7 @@ struct Baz<T: ?Sized> {
a: T
}
#[allow(dead_code)]
struct HasDrop<T: ?Sized> {
ptr: Box<usize>,
data: T

View file

@ -1,7 +1,5 @@
//ignore-windows: Uses POSIX APIs
#![feature(rustc_private)]
#![allow(unused_extern_crates)] // rustc bug https://github.com/rust-lang/rust/issues/56098
extern crate libc;

View file

@ -1,5 +1,4 @@
#![allow(dead_code)]
#[allow(dead_code)]
enum Two { A, B }
impl Drop for Two {
fn drop(&mut self) {

View file

@ -1,7 +1,6 @@
#![allow(dead_code)]
use std::mem;
#[allow(dead_code)]
struct Foo<T: ?Sized> {
a: i64,
b: bool,

View file

@ -1,14 +1,16 @@
#![allow(dead_code)]
#[repr(u16)]
#[allow(dead_code)]
enum DeviceKind {
Nil = 0,
}
#[repr(packed)]
#[allow(dead_code)]
struct DeviceInfo {
endianness: u8,
device_kind: DeviceKind,
}
fn main() {
let _x = None::<(DeviceInfo, u8)>;
let _y = None::<(DeviceInfo, u16)>;

View file

@ -2,14 +2,12 @@
// compile-flags: -Zmiri-disable-isolation
#![feature(rustc_private)]
#![allow(unused)] // necessary on macos due to conditional compilation
use std::path::PathBuf;
extern crate libc;
fn tmp() -> PathBuf {
std::env::var("MIRI_TEMP").map(PathBuf::from).unwrap_or_else(|_| std::env::temp_dir())
#[cfg(target_os = "linux")]
fn tmp() -> std::path::PathBuf {
std::env::var("MIRI_TEMP").map(std::path::PathBuf::from).unwrap_or_else(|_| std::env::temp_dir())
}
#[cfg(target_os = "linux")]

View file

@ -1,4 +1,3 @@
#![allow(dead_code)]
#![feature(unsize, coerce_unsized)]
#[repr(packed)]
@ -8,12 +7,14 @@ struct S {
}
#[repr(packed)]
#[allow(dead_code)]
struct Test1<'a> {
x: u8,
other: &'a u32,
}
#[repr(packed)]
#[allow(dead_code)]
struct Test2<'a> {
x: u8,
other: &'a Test1<'a>,
@ -26,6 +27,7 @@ fn test(t: Test2) {
fn test_unsizing() {
#[repr(packed)]
#[allow(dead_code)]
struct UnalignedPtr<'a, T: ?Sized>
where T: 'a,
{

View file

@ -2,8 +2,6 @@
#![feature(rustc_private)]
#![allow(dead_code)]
extern crate libc;
use std::mem;
@ -13,11 +11,13 @@ struct Bcx<'a> {
fcx: &'a Fcx<'a>
}
#[allow(dead_code)]
struct Fcx<'a> {
arena: &'a Arena,
ccx: &'a Ccx
}
#[allow(dead_code)]
struct Ccx {
x: isize
}

View file

@ -1,4 +1,4 @@
#![allow(dead_code)]
#![allow(dead_code)] // tons of unused statics here...
// very simple test for a 'static static with default lifetime
static STATIC_STR: &str = "&'static str";

View file

@ -1,5 +1,4 @@
#![allow(dead_code)]
#[allow(dead_code)]
enum E {
A = 1,
B = 2,

View file

@ -1,8 +1,7 @@
#![allow(dead_code)]
static mut FOO: i32 = 42;
static BAR: Foo = Foo(unsafe { &FOO as *const _} );
#[allow(dead_code)]
struct Foo(*const i32);
unsafe impl Sync for Foo {}

View file

@ -8,14 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(dead_code)]
use std::mem;
enum Tag<A> {
Tag2(A)
}
#[allow(dead_code)]
struct Rec {
c8: u8,
t: Tag<u64>

View file

@ -1,5 +1,4 @@
#![feature(untagged_unions)]
#![allow(dead_code, unused_variables)]
fn main() {
a();
@ -9,6 +8,7 @@ fn main() {
}
fn a() {
#[allow(dead_code)]
union U {
f1: u32,
f2: f32,
@ -27,6 +27,7 @@ fn b() {
y: u32,
}
#[allow(dead_code)]
union U {
s: S,
both: u64,
@ -82,7 +83,7 @@ fn d() {
unsafe {
match u {
MyUnion { f1: 10 } => { }
MyUnion { f2 } => { panic!("foo"); }
MyUnion { f2: _f2 } => { panic!("foo"); }
}
}
}