Skip to content

Commit 0073ce3

Browse files
committed
make the new lint deny-by-default
1 parent c2a8e23 commit 0073ce3

File tree

6 files changed

+42
-34
lines changed

6 files changed

+42
-34
lines changed

src/librustc_lint/builtin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ pub struct IgnoredGenericBounds;
13941394

13951395
declare_lint! {
13961396
IGNORED_GENERIC_BOUNDS,
1397-
Warn,
1397+
Deny,
13981398
"these generic bounds are ignored"
13991399
}
14001400

src/test/compile-fail/issue-17994.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![warn(ignored_generic_bounds)]
12+
1113
trait Tr {}
1214
type Huh<T> where T: Tr = isize; //~ ERROR type parameter `T` is unused
1315
//~| WARNING where clauses are ignored in type aliases

src/test/compile-fail/issue-39122.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
type Foo<T: std::ops::Add> = T; //~ WARNING bounds on generic type parameters are ignored
11+
type Foo<T: std::ops::Add> = T; //~ ERROR bounds on generic type parameters are ignored
1212

13-
type Bar<T> where T: std::ops::Add = T; //~ WARNING where clauses are ignored
13+
type Bar<T> where T: std::ops::Add = T; //~ ERROR where clauses are ignored

src/test/compile-fail/private-in-public-warn.rs

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#![feature(associated_type_defaults)]
1515
#![deny(private_in_public)]
1616
#![allow(improper_ctypes)]
17+
#![warn(ignored_generic_bounds)]
1718

1819
mod types {
1920
struct Priv;

src/test/ui/param-bounds-ignored.rs

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
// must-compile-successfully
1212
#![allow(dead_code, non_camel_case_types)]
13+
#![warn(ignored_generic_bounds)]
1314

1415
use std::rc::Rc;
1516

+35-31
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,96 @@
11
warning: bounds on generic type parameters are ignored in type aliases
2-
--> $DIR/param-bounds-ignored.rs:16:14
2+
--> $DIR/param-bounds-ignored.rs:17:14
33
|
4-
16 | type SVec<T: Send+Send> = Vec<T>;
4+
17 | type SVec<T: Send+Send> = Vec<T>;
55
| ^^^^ ^^^^
66
|
7-
= note: #[warn(ignored_generic_bounds)] on by default
7+
note: lint level defined here
8+
--> $DIR/param-bounds-ignored.rs:13:9
9+
|
10+
13 | #![warn(ignored_generic_bounds)]
11+
| ^^^^^^^^^^^^^^^^^^^^^^
812

913
warning: bounds on generic lifetime parameters are ignored in type aliases
10-
--> $DIR/param-bounds-ignored.rs:18:19
14+
--> $DIR/param-bounds-ignored.rs:19:19
1115
|
12-
18 | type VVec<'b, 'a: 'b+'b> = Vec<&'a i32>;
16+
19 | type VVec<'b, 'a: 'b+'b> = Vec<&'a i32>;
1317
| ^^ ^^
1418

1519
warning: bounds on generic type parameters are ignored in type aliases
16-
--> $DIR/param-bounds-ignored.rs:20:18
20+
--> $DIR/param-bounds-ignored.rs:21:18
1721
|
18-
20 | type WVec<'b, T: 'b+'b> = Vec<T>;
22+
21 | type WVec<'b, T: 'b+'b> = Vec<T>;
1923
| ^^ ^^
2024

2125
warning: where clauses are ignored in type aliases
22-
--> $DIR/param-bounds-ignored.rs:22:25
26+
--> $DIR/param-bounds-ignored.rs:23:25
2327
|
24-
22 | type W2Vec<'b, T> where T: 'b, T: 'b = Vec<T>;
28+
23 | type W2Vec<'b, T> where T: 'b, T: 'b = Vec<T>;
2529
| ^^^^^ ^^^^^
2630

2731
warning: bounds on generic lifetime parameters are ignored in higher-ranked function types (i.e., `for`)
28-
--> $DIR/param-bounds-ignored.rs:43:22
32+
--> $DIR/param-bounds-ignored.rs:44:22
2933
|
30-
43 | f: for<'xa, 'xb: 'xa> fn(&'xa i32, &'xb i32) -> &'xa i32)
34+
44 | f: for<'xa, 'xb: 'xa> fn(&'xa i32, &'xb i32) -> &'xa i32)
3135
| ^^^
3236

3337
warning: bounds on generic lifetime parameters are ignored in higher-ranked trait bounds (i.e., `for`)
34-
--> $DIR/param-bounds-ignored.rs:51:34
38+
--> $DIR/param-bounds-ignored.rs:52:34
3539
|
36-
51 | fn bar2<'a, 'b, F: for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32>(
40+
52 | fn bar2<'a, 'b, F: for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32>(
3741
| ^^^
3842

3943
warning: bounds on generic lifetime parameters are ignored in higher-ranked trait bounds (i.e., `for`)
40-
--> $DIR/param-bounds-ignored.rs:66:28
44+
--> $DIR/param-bounds-ignored.rs:67:28
4145
|
42-
66 | where F: for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32
46+
67 | where F: for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32
4347
| ^^^
4448

4549
warning: bounds on generic lifetime parameters are ignored in higher-ranked trait bounds (i.e., `for`)
46-
--> $DIR/param-bounds-ignored.rs:78:25
50+
--> $DIR/param-bounds-ignored.rs:79:25
4751
|
48-
78 | where for<'xa, 'xb: 'xa> F: Fn(&'xa i32, &'xb i32) -> &'xa i32
52+
79 | where for<'xa, 'xb: 'xa> F: Fn(&'xa i32, &'xb i32) -> &'xa i32
4953
| ^^^
5054

5155
warning: bounds on generic lifetime parameters are ignored in higher-ranked trait bounds (i.e., `for`)
52-
--> $DIR/param-bounds-ignored.rs:86:28
56+
--> $DIR/param-bounds-ignored.rs:87:28
5357
|
54-
86 | struct S1<F: for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32>(F);
58+
87 | struct S1<F: for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32>(F);
5559
| ^^^
5660

5761
warning: bounds on generic lifetime parameters are ignored in higher-ranked trait bounds (i.e., `for`)
58-
--> $DIR/param-bounds-ignored.rs:88:40
62+
--> $DIR/param-bounds-ignored.rs:89:40
5963
|
60-
88 | struct S2<F>(F) where F: for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32;
64+
89 | struct S2<F>(F) where F: for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32;
6165
| ^^^
6266

6367
warning: bounds on generic lifetime parameters are ignored in higher-ranked trait bounds (i.e., `for`)
64-
--> $DIR/param-bounds-ignored.rs:90:37
68+
--> $DIR/param-bounds-ignored.rs:91:37
6569
|
66-
90 | struct S3<F>(F) where for<'xa, 'xb: 'xa> F: Fn(&'xa i32, &'xb i32) -> &'xa i32;
70+
91 | struct S3<F>(F) where for<'xa, 'xb: 'xa> F: Fn(&'xa i32, &'xb i32) -> &'xa i32;
6771
| ^^^
6872

6973
warning: bounds on generic lifetime parameters are ignored in higher-ranked function types (i.e., `for`)
70-
--> $DIR/param-bounds-ignored.rs:93:29
74+
--> $DIR/param-bounds-ignored.rs:94:29
7175
|
72-
93 | struct S_fnty(for<'xa, 'xb: 'xa> fn(&'xa i32, &'xb i32) -> &'xa i32);
76+
94 | struct S_fnty(for<'xa, 'xb: 'xa> fn(&'xa i32, &'xb i32) -> &'xa i32);
7377
| ^^^
7478

7579
warning: bounds on generic lifetime parameters are ignored in higher-ranked trait bounds (i.e., `for`)
76-
--> $DIR/param-bounds-ignored.rs:96:29
80+
--> $DIR/param-bounds-ignored.rs:97:29
7781
|
78-
96 | type T1 = Box<for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32>;
82+
97 | type T1 = Box<for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32>;
7983
| ^^^
8084

8185
warning: bounds on generic lifetime parameters are ignored in higher-ranked function types (i.e., `for`)
82-
--> $DIR/param-bounds-ignored.rs:100:34
86+
--> $DIR/param-bounds-ignored.rs:101:34
8387
|
84-
100 | let _ : Option<for<'xa, 'xb: 'xa> fn(&'xa i32, &'xb i32) -> &'xa i32> = None;
88+
101 | let _ : Option<for<'xa, 'xb: 'xa> fn(&'xa i32, &'xb i32) -> &'xa i32> = None;
8589
| ^^^
8690

8791
warning: bounds on generic lifetime parameters are ignored in higher-ranked trait bounds (i.e., `for`)
88-
--> $DIR/param-bounds-ignored.rs:102:38
92+
--> $DIR/param-bounds-ignored.rs:103:38
8993
|
90-
102 | let _ : Option<Box<for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32>> = None;
94+
103 | let _ : Option<Box<for<'xa, 'xb: 'xa> Fn(&'xa i32, &'xb i32) -> &'xa i32>> = None;
9195
| ^^^
9296

0 commit comments

Comments
 (0)