Skip to content

Commit 02219f1

Browse files
committed
Bless rest tests
1 parent 0232e28 commit 02219f1

31 files changed

+92
-39
lines changed

tests/ui/associated-type-bounds/union-bounds.rs

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

55
trait Tr1: Copy { type As1: Copy; }
66
trait Tr2: Copy { type As2: Copy; }
7-
trait Tr3: Copy { type As3: Copy; }
7+
trait Tr3: Copy { #[allow(dead_code)] type As3: Copy; }
88
trait Tr4<'a>: Copy { type As4: Copy; }
99
trait Tr5: Copy { type As5: Copy; }
1010

tests/ui/associated-types/impl-wf-cycle-5.fixed

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ impl Fiz for bool {}
1111

1212
trait Grault {
1313
type A;
14+
#[allow(dead_code)]
1415
type B;
1516
}
1617

tests/ui/associated-types/impl-wf-cycle-5.rs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ impl Fiz for bool {}
1111

1212
trait Grault {
1313
type A;
14+
#[allow(dead_code)]
1415
type B;
1516
}
1617

tests/ui/associated-types/impl-wf-cycle-5.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0275]: overflow evaluating the requirement `<(T,) as Grault>::A == _`
2-
--> $DIR/impl-wf-cycle-5.rs:22:1
2+
--> $DIR/impl-wf-cycle-5.rs:23:1
33
|
44
LL | / impl<T> Grault for (T,)
55
LL | |
@@ -12,7 +12,7 @@ LL | type A = ();
1212
| ------ associated type `<(T,) as Grault>::A` is specified here
1313
|
1414
note: required for `(T,)` to implement `Grault`
15-
--> $DIR/impl-wf-cycle-5.rs:22:9
15+
--> $DIR/impl-wf-cycle-5.rs:23:9
1616
|
1717
LL | impl<T> Grault for (T,)
1818
| ^^^^^^ ^^^^

tests/ui/associated-types/impl-wf-cycle-6.fixed

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ impl Fiz for bool {}
1111

1212
trait Grault {
1313
type A;
14+
#[allow(dead_code)]
1415
type B;
1516
}
1617

tests/ui/associated-types/impl-wf-cycle-6.rs

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ impl Fiz for bool {}
1111

1212
trait Grault {
1313
type A;
14+
#[allow(dead_code)]
1415
type B;
1516
}
1617

tests/ui/associated-types/impl-wf-cycle-6.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0275]: overflow evaluating the requirement `<(T,) as Grault>::A == _`
2-
--> $DIR/impl-wf-cycle-6.rs:22:1
2+
--> $DIR/impl-wf-cycle-6.rs:23:1
33
|
44
LL | / impl<T: Grault> Grault for (T,)
55
LL | |
@@ -11,7 +11,7 @@ LL | type A = ();
1111
| ------ associated type `<(T,) as Grault>::A` is specified here
1212
|
1313
note: required for `(T,)` to implement `Grault`
14-
--> $DIR/impl-wf-cycle-6.rs:22:17
14+
--> $DIR/impl-wf-cycle-6.rs:23:17
1515
|
1616
LL | impl<T: Grault> Grault for (T,)
1717
| ^^^^^^ ^^^^

tests/ui/const-generics/cross_crate_complex.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ async fn foo() {
1111
async_in_foo(async_out_foo::<4>().await).await;
1212
}
1313

14-
struct Faz<const N: usize>;
14+
struct Faz<const N: usize>; //~ WARN struct `Faz` is never constructed
1515

1616
impl<const N: usize> Foo<N> for Faz<N> {}
1717
impl<const N: usize> Bar<N> for Faz<N> {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
warning: struct `Faz` is never constructed
2+
--> $DIR/cross_crate_complex.rs:14:8
3+
|
4+
LL | struct Faz<const N: usize>;
5+
| ^^^
6+
|
7+
= note: `#[warn(dead_code)]` on by default
8+
9+
warning: 1 warning emitted
10+

tests/ui/const-generics/issues/issue-86535-2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub trait Foo {
99
[(); Self::ASSOC_C]:;
1010
}
1111

12-
struct Bar<const N: &'static ()>;
12+
struct Bar<const N: &'static ()>; //~ WARN struct `Bar` is never constructed
1313
impl<const N: &'static ()> Foo for Bar<N> {
1414
const ASSOC_C: usize = 3;
1515

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
warning: struct `Bar` is never constructed
2+
--> $DIR/issue-86535-2.rs:12:8
3+
|
4+
LL | struct Bar<const N: &'static ()>;
5+
| ^^^
6+
|
7+
= note: `#[warn(dead_code)]` on by default
8+
9+
warning: 1 warning emitted
10+

tests/ui/const-generics/issues/issue-86535.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![feature(adt_const_params, unsized_const_params, generic_const_exprs)]
33
#![allow(incomplete_features, unused_variables)]
44

5-
struct F<const S: &'static str>;
5+
struct F<const S: &'static str>; //~ WARN struct `F` is never constructed
66
impl<const S: &'static str> X for F<{ S }> {
77
const W: usize = 3;
88

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
warning: struct `F` is never constructed
2+
--> $DIR/issue-86535.rs:5:8
3+
|
4+
LL | struct F<const S: &'static str>;
5+
| ^
6+
|
7+
= note: `#[warn(dead_code)]` on by default
8+
9+
warning: 1 warning emitted
10+

tests/ui/deriving/deriving-in-macro.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ macro_rules! define_vec {
66
() => (
77
mod foo {
88
#[derive(PartialEq)]
9-
pub struct bar;
9+
pub struct bar; //~ WARN struct `bar` is never constructed
1010
}
1111
)
1212
}
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
warning: struct `bar` is never constructed
2+
--> $DIR/deriving-in-macro.rs:9:24
3+
|
4+
LL | pub struct bar;
5+
| ^^^
6+
...
7+
LL | define_vec![];
8+
| ------------- in this macro invocation
9+
|
10+
= note: `#[warn(dead_code)]` on by default
11+
= note: this warning originates in the macro `define_vec` (in Nightly builds, run with -Z macro-backtrace for more info)
12+
13+
warning: 1 warning emitted
14+

tests/ui/generic-associated-types/collections.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ trait Collection<T> {
1010
type Iter<'iter>: Iterator<Item=&'iter T> where T: 'iter, Self: 'iter;
1111
type Family: CollectionFamily;
1212
// Test associated type defaults with parameters
13+
#[allow(dead_code)]
1314
type Sibling<U>: Collection<U> =
1415
<<Self as Collection<T>>::Family as CollectionFamily>::Member<U>;
1516

tests/ui/generic-associated-types/missing-bounds.fixed

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

3+
#![allow(dead_code)]
4+
35
use std::ops::Add;
46

57
struct A<B>(B);

tests/ui/generic-associated-types/missing-bounds.rs

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

3+
#![allow(dead_code)]
4+
35
use std::ops::Add;
46

57
struct A<B>(B);

tests/ui/generic-associated-types/missing-bounds.stderr

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: equality constraints are not yet supported in `where` clauses
2-
--> $DIR/missing-bounds.rs:37:33
2+
--> $DIR/missing-bounds.rs:39:33
33
|
44
LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B {
55
| ^^^^^^^^^^^^^^^^^^^^^^ not supported
@@ -11,7 +11,7 @@ LL | impl<B: Add> Add for E<B> where B: Add<Output = B> {
1111
| ~~~~~~~~~~~~~~~~~~
1212

1313
error[E0308]: mismatched types
14-
--> $DIR/missing-bounds.rs:11:11
14+
--> $DIR/missing-bounds.rs:13:11
1515
|
1616
LL | impl<B> Add for A<B> where B: Add {
1717
| - expected this type parameter
@@ -24,14 +24,14 @@ LL | A(self.0 + rhs.0)
2424
= note: expected type parameter `B`
2525
found associated type `<B as Add>::Output`
2626
help: the type constructed contains `<B as Add>::Output` due to the type of the argument passed
27-
--> $DIR/missing-bounds.rs:11:9
27+
--> $DIR/missing-bounds.rs:13:9
2828
|
2929
LL | A(self.0 + rhs.0)
3030
| ^^--------------^
3131
| |
3232
| this argument influences the type of `A`
3333
note: tuple struct defined here
34-
--> $DIR/missing-bounds.rs:5:8
34+
--> $DIR/missing-bounds.rs:7:8
3535
|
3636
LL | struct A<B>(B);
3737
| ^
@@ -41,7 +41,7 @@ LL | impl<B> Add for A<B> where B: Add<Output = B> {
4141
| ++++++++++++
4242

4343
error[E0308]: mismatched types
44-
--> $DIR/missing-bounds.rs:21:14
44+
--> $DIR/missing-bounds.rs:23:14
4545
|
4646
LL | impl<B: Add> Add for C<B> {
4747
| - expected this type parameter
@@ -54,7 +54,7 @@ LL | Self(self.0 + rhs.0)
5454
= note: expected type parameter `B`
5555
found associated type `<B as Add>::Output`
5656
note: tuple struct defined here
57-
--> $DIR/missing-bounds.rs:15:8
57+
--> $DIR/missing-bounds.rs:17:8
5858
|
5959
LL | struct C<B>(B);
6060
| ^
@@ -64,7 +64,7 @@ LL | impl<B: Add<Output = B>> Add for C<B> {
6464
| ++++++++++++
6565

6666
error[E0369]: cannot add `B` to `B`
67-
--> $DIR/missing-bounds.rs:31:21
67+
--> $DIR/missing-bounds.rs:33:21
6868
|
6969
LL | Self(self.0 + rhs.0)
7070
| ------ ^ ----- B
@@ -77,7 +77,7 @@ LL | impl<B: std::ops::Add<Output = B>> Add for D<B> {
7777
| +++++++++++++++++++++++++++
7878

7979
error[E0308]: mismatched types
80-
--> $DIR/missing-bounds.rs:42:14
80+
--> $DIR/missing-bounds.rs:44:14
8181
|
8282
LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B {
8383
| - expected this type parameter
@@ -90,7 +90,7 @@ LL | Self(self.0 + rhs.0)
9090
= note: expected type parameter `B`
9191
found associated type `<B as Add>::Output`
9292
note: tuple struct defined here
93-
--> $DIR/missing-bounds.rs:35:8
93+
--> $DIR/missing-bounds.rs:37:8
9494
|
9595
LL | struct E<B>(B);
9696
| ^

tests/ui/impl-trait/extra-impl-in-trait-impl.fixed

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

3+
#![allow(dead_code)]
4+
35
struct S<T>(T);
46
struct S2;
57

tests/ui/impl-trait/extra-impl-in-trait-impl.rs

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

3+
#![allow(dead_code)]
4+
35
struct S<T>(T);
46
struct S2;
57

tests/ui/impl-trait/extra-impl-in-trait-impl.stderr

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
error: unexpected `impl` keyword
2-
--> $DIR/extra-impl-in-trait-impl.rs:6:18
2+
--> $DIR/extra-impl-in-trait-impl.rs:8:18
33
|
44
LL | impl<T: Default> impl Default for S<T> {
55
| ^^^^^ help: remove the extra `impl`
66
|
77
note: this is parsed as an `impl Trait` type, but a trait is expected at this position
8-
--> $DIR/extra-impl-in-trait-impl.rs:6:18
8+
--> $DIR/extra-impl-in-trait-impl.rs:8:18
99
|
1010
LL | impl<T: Default> impl Default for S<T> {
1111
| ^^^^^^^^^^^^
1212

1313
error: unexpected `impl` keyword
14-
--> $DIR/extra-impl-in-trait-impl.rs:12:6
14+
--> $DIR/extra-impl-in-trait-impl.rs:14:6
1515
|
1616
LL | impl impl Default for S2 {
1717
| ^^^^^ help: remove the extra `impl`
1818
|
1919
note: this is parsed as an `impl Trait` type, but a trait is expected at this position
20-
--> $DIR/extra-impl-in-trait-impl.rs:12:6
20+
--> $DIR/extra-impl-in-trait-impl.rs:14:6
2121
|
2222
LL | impl impl Default for S2 {
2323
| ^^^^^^^^^^^^

tests/ui/lint/dead-code/issue-59003.rs

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

55
#![deny(dead_code)]
66

7+
#[allow(dead_code)]
78
struct Foo {
8-
#[allow(dead_code)]
99
inner: u32,
1010
}
1111

tests/ui/parser/issues/issue-105366.fixed

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

3+
#[allow(dead_code)]
34
struct Foo;
45

56
impl From<i32> for Foo {

tests/ui/parser/issues/issue-105366.rs

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

3+
#[allow(dead_code)]
34
struct Foo;
45

56
fn From<i32> for Foo {

tests/ui/parser/issues/issue-105366.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: you might have meant to write `impl` instead of `fn`
2-
--> $DIR/issue-105366.rs:5:1
2+
--> $DIR/issue-105366.rs:6:1
33
|
44
LL | fn From<i32> for Foo {
55
| ^^

tests/ui/pattern/issue-22546.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ impl<T: ::std::fmt::Display> Foo<T> {
1515
}
1616
}
1717

18-
trait Tr { //~ WARN trait `Tr` is never used
18+
trait Tr {
1919
type U;
2020
}
2121

tests/ui/pattern/issue-22546.stderr

-10
This file was deleted.

tests/ui/sanitizer/cfi/sized-associated-ty.rs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
//@ run-pass
1515

1616
trait Foo {
17+
#[allow(dead_code)]
1718
type Bar<'a>
1819
where
1920
Self: Sized;

tests/ui/traits/issue-38033.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ trait Future {
1616

1717
trait IntoFuture {
1818
type Future: Future<Item=Self::Item, Error=Self::Error>;
19+
//~^ WARN associated items `Future` and `into_future` are never used
1920
type Item;
2021
type Error;
2122

22-
fn into_future(self) -> Self::Future; //~ WARN method `into_future` is never used
23+
fn into_future(self) -> Self::Future;
2324
}
2425

2526
impl<F: Future> IntoFuture for F {

tests/ui/traits/issue-38033.stderr

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
warning: method `into_future` is never used
2-
--> $DIR/issue-38033.rs:22:8
1+
warning: associated items `Future` and `into_future` are never used
2+
--> $DIR/issue-38033.rs:18:10
33
|
44
LL | trait IntoFuture {
5-
| ---------- method in this trait
5+
| ---------- associated items in this trait
6+
LL | type Future: Future<Item=Self::Item, Error=Self::Error>;
7+
| ^^^^^^
68
...
79
LL | fn into_future(self) -> Self::Future;
810
| ^^^^^^^^^^^

0 commit comments

Comments
 (0)