Skip to content

Commit 510976b

Browse files
authored
Rollup merge of rust-lang#64078 - Mark-Simulacrum:compiletest-lint-unused, r=petrochenkov
compiletest: disable -Aunused for run-pass tests Disabled the flag, but that led to quite a bit of fall out -- I think most of it is benign but I've not investigated thoroughly. r? @petrochenkov
2 parents 2b8116d + 6fdbece commit 510976b

File tree

59 files changed

+131
-69
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+131
-69
lines changed

src/test/ui/associated-type-bounds/bounds-on-assoc-in-trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-pass
1+
// check-pass
22

33
#![feature(associated_type_bounds)]
44

src/test/ui/associated-type-bounds/fn-apit.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-pass
22
// aux-build:fn-aux.rs
33

4+
#![allow(unused)]
45
#![feature(associated_type_bounds)]
56

67
extern crate fn_aux;

src/test/ui/associated-type-bounds/fn-dyn-apit.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-pass
22
// aux-build:fn-dyn-aux.rs
33

4+
#![allow(unused)]
45
#![feature(associated_type_bounds)]
56

67
extern crate fn_dyn_aux;

src/test/ui/associated-type-bounds/fn-inline.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-pass
22
// aux-build:fn-aux.rs
33

4+
#![allow(unused)]
45
#![feature(associated_type_bounds)]
56

67
extern crate fn_aux;

src/test/ui/associated-type-bounds/fn-where.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-pass
22
// aux-build:fn-aux.rs
33

4+
#![allow(unused)]
45
#![feature(associated_type_bounds)]
56

67
extern crate fn_aux;

src/test/ui/associated-type-bounds/fn-wrap-apit.rs

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// aux-build:fn-aux.rs
33

44
#![feature(associated_type_bounds)]
5+
#![allow(dead_code)]
56

67
extern crate fn_aux;
78

src/test/ui/associated-type-bounds/struct-bounds.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// run-pass
22

3+
#![allow(unused)]
34
#![feature(associated_type_bounds)]
45

56
trait Tr1 { type As1; }

src/test/ui/async-await/argument-patterns.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// edition:2018
2-
// run-pass
2+
// check-pass
33

4-
#![allow(unused_variables)]
54
#![deny(unused_mut)]
65

76
type A = Vec<u32>;

src/test/ui/async-await/async-await.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// run-pass
22

3+
#![allow(unused)]
4+
35
// edition:2018
46
// aux-build:arc_wake.rs
57

src/test/ui/async-await/drop-order/drop-order-for-locals-when-cancelled.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,16 @@
33
// run-pass
44

55
#![deny(dead_code)]
6+
#![allow(unused_variables)]
7+
#![allow(unused_must_use)]
8+
#![allow(path_statements)]
69

710
// Test that the drop order for locals in a fn and async fn matches up.
811
extern crate arc_wake;
912

1013
use arc_wake::ArcWake;
1114
use std::cell::RefCell;
1215
use std::future::Future;
13-
use std::marker::PhantomData;
1416
use std::pin::Pin;
1517
use std::rc::Rc;
1618
use std::sync::Arc;
@@ -42,7 +44,7 @@ struct NeverReady;
4244

4345
impl Future for NeverReady {
4446
type Output = ();
45-
fn poll(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
47+
fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
4648
Poll::Pending
4749
}
4850
}

src/test/ui/async-await/drop-order/drop-order-when-cancelled.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// parameters (used or unused) are not dropped until the async fn is cancelled.
77
// This file is mostly copy-pasted from drop-order-for-async-fn-parameters.rs
88

9+
#![allow(unused_variables)]
10+
911
extern crate arc_wake;
1012

1113
use arc_wake::ArcWake;
@@ -43,7 +45,7 @@ struct NeverReady;
4345

4446
impl Future for NeverReady {
4547
type Output = ();
46-
fn poll(mut self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
48+
fn poll(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Self::Output> {
4749
Poll::Pending
4850
}
4951
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
warning: unnecessary parentheses around assigned value
2+
--> $DIR/issue-54752-async-block.rs:6:22
3+
|
4+
LL | fn main() { let _a = (async { }); }
5+
| ^^^^^^^^^^^^ help: remove these parentheses
6+
|
7+
= note: `#[warn(unused_parens)]` on by default
8+

src/test/ui/async-await/issues/issue-59972.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// run-pass
66

7-
// compile-flags: --edition=2018
7+
// compile-flags: --edition=2018 -Aunused
88

99
pub enum Uninhabited { }
1010

src/test/ui/async-await/multiple-lifetimes/hrtb.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// edition:2018
2-
// run-pass
2+
// check-pass
33

44
// Test that we can use async fns with multiple arbitrary lifetimes.
55

src/test/ui/borrowck/borrowck-migrate-to-nll.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// revisions: zflag edition
1818
//[zflag]compile-flags: -Z borrowck=migrate
1919
//[edition]edition:2018
20-
//[zflag] run-pass
20+
//[zflag] check-pass
2121

2222
pub struct Block<'a> {
2323
current: &'a u8,

src/test/ui/borrowck/issue-10876.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-pass
1+
// check-pass
22

33
enum Nat {
44
S(Box<Nat>),

src/test/ui/borrowck/two-phase-multiple-activations.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ pub trait FakeRead {
1111
}
1212

1313
impl FakeRead for Foo {
14-
fn read_to_end(&mut self, buf: &mut Vec<u8>) -> Result<usize> {
14+
fn read_to_end(&mut self, _buf: &mut Vec<u8>) -> Result<usize> {
1515
Ok(4)
1616
}
1717
}
1818

1919
fn main() {
2020
let mut a = Foo {};
2121
let mut v = Vec::new();
22-
a.read_to_end(&mut v);
22+
a.read_to_end(&mut v).unwrap();
2323
}

src/test/ui/const-generics/apit-with-const-param.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-pass
1+
// check-pass
22

33
#![feature(const_generics)]
44
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash

src/test/ui/const-generics/array-wrapper-struct-ctor.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
#![feature(const_generics)]
44
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
55

6+
#![allow(dead_code)]
7+
68
struct ArrayStruct<T, const N: usize> {
79
data: [T; N],
810
}

src/test/ui/const-generics/const-types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#![feature(const_generics)]
44
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
55

6-
#[allow(dead_code)]
6+
#![allow(dead_code, unused_variables)]
77

88
struct ConstArray<T, const LEN: usize> {
99
array: [T; LEN],

src/test/ui/const-generics/issue-61422.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-pass
1+
// check-pass
22

33
#![feature(const_generics)]
44
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash
@@ -8,7 +8,7 @@ use std::mem;
88
fn foo<const SIZE: usize>() {
99
let arr: [u8; SIZE] = unsafe {
1010
#[allow(deprecated)]
11-
let mut array: [u8; SIZE] = mem::uninitialized();
11+
let array: [u8; SIZE] = mem::uninitialized();
1212
array
1313
};
1414
}

src/test/ui/const-generics/unused-const-param.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-pass
1+
// check-pass
22

33
#![feature(const_generics)]
44
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash

src/test/ui/consts/const-eval/const_transmute.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-pass
22

33
#![feature(const_fn_union)]
4+
#![allow(dead_code)]
45

56
#[repr(C)]
67
union Transmute<T: Copy, U: Copy> {

src/test/ui/consts/const-labeled-break.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-pass
1+
// build-pass
22

33
// Using labeled break in a while loop has caused an illegal instruction being
44
// generated, and an ICE later.
+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
warning: unreachable pattern
2+
--> $DIR/packed_pattern.rs:16:9
3+
|
4+
LL | FOO => unreachable!(),
5+
| ^^^
6+
|
7+
= note: `#[warn(unreachable_patterns)]` on by default
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
warning: unreachable pattern
2+
--> $DIR/packed_pattern2.rs:24:9
3+
|
4+
LL | FOO => unreachable!(),
5+
| ^^^
6+
|
7+
= note: `#[warn(unreachable_patterns)]` on by default
8+

src/test/ui/deprecation/deprecation-in-future.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-pass
1+
// check-pass
22

33
#![deny(deprecated_in_future)]
44

src/test/ui/drop/dynamic-drop-async.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// ignore-wasm32-bare compiled with panic=abort by default
99

1010
#![feature(slice_patterns)]
11+
#![allow(unused)]
1112

1213
use std::{
1314
cell::{Cell, RefCell},

src/test/ui/hrtb/issue-57639.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// See [this comment on GitHub][c] for more details.
1212
//
13-
// run-pass
13+
// check-pass
1414
//
1515
// [c]: https://github.com/rust-lang/rust/issues/57639#issuecomment-455685861
1616

src/test/ui/if-ret.stderr

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
warning: unreachable block in `if` expression
2+
--> $DIR/if-ret.rs:6:24
3+
|
4+
LL | fn foo() { if (return) { } }
5+
| ^^^
6+
|
7+
= note: `#[warn(unreachable_code)]` on by default
8+

src/test/ui/impl-trait/closure-calling-parent-fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// `foo` and hence is treated opaquely within the closure body. This
66
// resulted in a failed subtype relationship.
77
//
8-
// run-pass
8+
// check-pass
99

1010
fn foo() -> impl Copy { || foo(); }
1111
fn bar() -> impl Copy { || bar(); }

src/test/ui/impl-trait/issues/issue-53457.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-pass
1+
// check-pass
22

33
#![feature(type_alias_impl_trait)]
44

@@ -9,7 +9,7 @@ fn bar<F: Fn(&i32) + Clone>(f: F) -> F {
99
}
1010

1111
fn foo() -> X {
12-
bar(|x| ())
12+
bar(|_| ())
1313
}
1414

1515
fn main() {}

src/test/ui/impl-trait/multiple-lifetimes/inverse-bounds.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// edition:2018
2-
// run-pass
2+
// check-pass
33
// revisions: migrate mir
44
//[mir]compile-flags: -Z borrowck=mir
55

src/test/ui/impl-trait/needs_least_region_or_bound.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
// run-pass
1+
// check-pass
22

33
#![feature(member_constraints)]
44

5-
use std::fmt::Debug;
6-
75
trait MultiRegionTrait<'a, 'b> {}
86
impl<'a, 'b> MultiRegionTrait<'a, 'b> for (&'a u32, &'b u32) {}
97

src/test/ui/issues/issue-26448-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-pass
1+
// check-pass
22

33
pub struct Bar<T> {
44
items: Vec<&'static str>,

src/test/ui/issues/issue-26448-3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-pass
1+
// check-pass
22

33
pub struct Item {
44
_inner: &'static str,

src/test/ui/issues/issue-27697.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-pass
1+
// check-pass
22

33
use std::ops::Deref;
44

src/test/ui/issues/issue-38591.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-pass
1+
// check-pass
22

33
struct S<T> {
44
t : T,

src/test/ui/issues/issue-43806.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-pass
1+
// check-pass
22

33
#![deny(unused_results)]
44

src/test/ui/issues/issue-48132.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
// run-pass
55

6+
#![allow(dead_code)]
7+
68
struct Inner<I, V> {
79
iterator: I,
810
item: V,

src/test/ui/issues/issue-48179.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Regression test for #48132. This was failing due to problems around
22
// the projection caching and dropck type enumeration.
33

4-
// run-pass
4+
// check-pass
55

66
pub struct Container<T: Iterator> {
77
value: Option<T::Item>,

src/test/ui/issues/issue-61711-once-caused-rustc-inf-loop.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// aux-build:xcrate-issue-61711-b.rs
66
// compile-flags:--extern xcrate_issue_61711_b
77

8-
// run-pass
8+
// build-pass
99

1010
fn f<F: Fn(xcrate_issue_61711_b::Struct)>(_: F) { }
1111
fn main() { }

src/test/ui/lint/empty-lint-attributes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![feature(lint_reasons)]
22

3-
// run-pass
3+
// check-pass
44

55
// Empty (and reason-only) lint attributes are legal—although we may want to
66
// lint them in the future (Issue #55112).

src/test/ui/nll/issue-55288.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// run-pass
1+
// check-pass
22

33
struct Slice(&'static [&'static [u8]]);
44

0 commit comments

Comments
 (0)