Skip to content

Commit 7616b30

Browse files
Avi-D-coderJacob Hughes
authored and
Jacob Hughes
committed
Add unstable default feature enabled test
1 parent af19d44 commit 7616b30

File tree

3 files changed

+38
-28
lines changed

3 files changed

+38
-28
lines changed

src/test/ui/stability-attribute/auxiliary/unstable_generic_param.rs

+6
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ pub struct Struct5<#[unstable(feature = "unstable_default", issue = "none")] A =
5555
pub field: A,
5656
}
5757

58+
#[stable(feature = "stable_test_feature", since = "1.0.0")]
59+
pub struct Struct6<#[unstable(feature = "unstable_default6", issue = "none")] T = usize> {
60+
#[stable(feature = "stable_test_feature", since = "1.0.0")]
61+
pub field: T,
62+
}
63+
5864
#[stable(feature = "stable_test_feature", since = "1.0.0")]
5965
pub const STRUCT1: Struct1 = Struct1 { field: 1 };
6066

src/test/ui/stability-attribute/generics-default-stability.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// ignore-tidy-linelength
22
// aux-build:unstable_generic_param.rs
3+
#![feature(unstable_default6)]
34

45
extern crate unstable_generic_param;
56

@@ -105,4 +106,7 @@ fn main() {
105106
//~^ use of deprecated item 'unstable_generic_param::Struct5': test [deprecated]
106107
//~^^ use of deprecated item 'unstable_generic_param::Struct5': test [deprecated]
107108
//~^^^ use of deprecated item 'unstable_generic_param::Struct5::field': test [deprecated]
109+
110+
let _: Struct6<isize> = Struct6 { field: 1 }; // ok
111+
let _: Struct6<isize> = Struct6 { field: 0 }; // ok
108112
}

src/test/ui/stability-attribute/generics-default-stability.stderr

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,193 +1,193 @@
11
error[E0658]: use of unstable library feature 'unstable_default'
2-
--> $DIR/generics-default-stability.rs:16:13
2+
--> $DIR/generics-default-stability.rs:17:13
33
|
44
LL | impl Trait1<usize> for S {
55
| ^^^^^
66
|
77
= help: add `#![feature(unstable_default)]` to the crate attributes to enable
88

99
error[E0658]: use of unstable library feature 'unstable_default'
10-
--> $DIR/generics-default-stability.rs:20:13
10+
--> $DIR/generics-default-stability.rs:21:13
1111
|
1212
LL | impl Trait1<isize> for S {
1313
| ^^^^^
1414
|
1515
= help: add `#![feature(unstable_default)]` to the crate attributes to enable
1616

1717
error[E0658]: use of unstable library feature 'unstable_default'
18-
--> $DIR/generics-default-stability.rs:24:13
18+
--> $DIR/generics-default-stability.rs:25:13
1919
|
2020
LL | impl Trait2<usize> for S {
2121
| ^^^^^
2222
|
2323
= help: add `#![feature(unstable_default)]` to the crate attributes to enable
2424

2525
warning: use of deprecated item 'unstable_generic_param::Struct4': test
26-
--> $DIR/generics-default-stability.rs:83:29
26+
--> $DIR/generics-default-stability.rs:84:29
2727
|
2828
LL | let _: Struct4<isize> = Struct4 { field: 1 };
2929
| ^^^^^^^
3030
|
3131
= note: `#[warn(deprecated)]` on by default
3232

3333
warning: use of deprecated item 'unstable_generic_param::Struct4': test
34-
--> $DIR/generics-default-stability.rs:83:12
34+
--> $DIR/generics-default-stability.rs:84:12
3535
|
3636
LL | let _: Struct4<isize> = Struct4 { field: 1 };
3737
| ^^^^^^^^^^^^^^
3838

3939
warning: use of deprecated item 'unstable_generic_param::Struct4': test
40-
--> $DIR/generics-default-stability.rs:88:12
40+
--> $DIR/generics-default-stability.rs:89:12
4141
|
4242
LL | let _: Struct4 = STRUCT4;
4343
| ^^^^^^^
4444

4545
warning: use of deprecated item 'unstable_generic_param::Struct4': test
46-
--> $DIR/generics-default-stability.rs:89:12
46+
--> $DIR/generics-default-stability.rs:90:12
4747
|
4848
LL | let _: Struct4<usize> = STRUCT4;
4949
| ^^^^^^^^^^^^^^
5050

5151
warning: use of deprecated item 'unstable_generic_param::Struct4': test
52-
--> $DIR/generics-default-stability.rs:90:29
52+
--> $DIR/generics-default-stability.rs:91:29
5353
|
5454
LL | let _: Struct4<isize> = Struct4 { field: 0 };
5555
| ^^^^^^^
5656

5757
warning: use of deprecated item 'unstable_generic_param::Struct4': test
58-
--> $DIR/generics-default-stability.rs:90:12
58+
--> $DIR/generics-default-stability.rs:91:12
5959
|
6060
LL | let _: Struct4<isize> = Struct4 { field: 0 };
6161
| ^^^^^^^^^^^^^^
6262

6363
warning: use of deprecated item 'unstable_generic_param::Struct5': test
64-
--> $DIR/generics-default-stability.rs:96:29
64+
--> $DIR/generics-default-stability.rs:97:29
6565
|
6666
LL | let _: Struct5<isize> = Struct5 { field: 1 };
6767
| ^^^^^^^
6868

6969
warning: use of deprecated item 'unstable_generic_param::Struct5': test
70-
--> $DIR/generics-default-stability.rs:96:12
70+
--> $DIR/generics-default-stability.rs:97:12
7171
|
7272
LL | let _: Struct5<isize> = Struct5 { field: 1 };
7373
| ^^^^^^^^^^^^^^
7474

7575
warning: use of deprecated item 'unstable_generic_param::Struct5': test
76-
--> $DIR/generics-default-stability.rs:101:12
76+
--> $DIR/generics-default-stability.rs:102:12
7777
|
7878
LL | let _: Struct5 = STRUCT5;
7979
| ^^^^^^^
8080

8181
warning: use of deprecated item 'unstable_generic_param::Struct5': test
82-
--> $DIR/generics-default-stability.rs:102:12
82+
--> $DIR/generics-default-stability.rs:103:12
8383
|
8484
LL | let _: Struct5<usize> = STRUCT5;
8585
| ^^^^^^^^^^^^^^
8686

8787
warning: use of deprecated item 'unstable_generic_param::Struct5': test
88-
--> $DIR/generics-default-stability.rs:104:29
88+
--> $DIR/generics-default-stability.rs:105:29
8989
|
9090
LL | let _: Struct5<isize> = Struct5 { field: 0 };
9191
| ^^^^^^^
9292

9393
warning: use of deprecated item 'unstable_generic_param::Struct5': test
94-
--> $DIR/generics-default-stability.rs:104:12
94+
--> $DIR/generics-default-stability.rs:105:12
9595
|
9696
LL | let _: Struct5<isize> = Struct5 { field: 0 };
9797
| ^^^^^^^^^^^^^^
9898

9999
error[E0658]: use of unstable library feature 'unstable_default'
100-
--> $DIR/generics-default-stability.rs:35:20
100+
--> $DIR/generics-default-stability.rs:36:20
101101
|
102102
LL | let _: Struct1<isize> = Struct1 { field: 1 };
103103
| ^^^^^
104104
|
105105
= help: add `#![feature(unstable_default)]` to the crate attributes to enable
106106

107107
error[E0658]: use of unstable library feature 'unstable_default'
108-
--> $DIR/generics-default-stability.rs:39:20
108+
--> $DIR/generics-default-stability.rs:40:20
109109
|
110110
LL | let _: Struct1<usize> = STRUCT1;
111111
| ^^^^^
112112
|
113113
= help: add `#![feature(unstable_default)]` to the crate attributes to enable
114114

115115
error[E0658]: use of unstable library feature 'unstable_default'
116-
--> $DIR/generics-default-stability.rs:40:20
116+
--> $DIR/generics-default-stability.rs:41:20
117117
|
118118
LL | let _: Struct1<isize> = Struct1 { field: 0 };
119119
| ^^^^^
120120
|
121121
= help: add `#![feature(unstable_default)]` to the crate attributes to enable
122122

123123
error[E0658]: use of unstable library feature 'unstable_default'
124-
--> $DIR/generics-default-stability.rs:69:27
124+
--> $DIR/generics-default-stability.rs:70:27
125125
|
126126
LL | let _: Struct3<isize, usize> = STRUCT3;
127127
| ^^^^^
128128
|
129129
= help: add `#![feature(unstable_default)]` to the crate attributes to enable
130130

131131
error[E0658]: use of unstable library feature 'unstable_default'
132-
--> $DIR/generics-default-stability.rs:71:27
132+
--> $DIR/generics-default-stability.rs:72:27
133133
|
134134
LL | let _: Struct3<isize, isize> = Struct3 { field1: 0, field2: 0 };
135135
| ^^^^^
136136
|
137137
= help: add `#![feature(unstable_default)]` to the crate attributes to enable
138138

139139
error[E0658]: use of unstable library feature 'unstable_default'
140-
--> $DIR/generics-default-stability.rs:72:27
140+
--> $DIR/generics-default-stability.rs:73:27
141141
|
142142
LL | let _: Struct3<usize, usize> = Struct3 { field1: 0, field2: 0 };
143143
| ^^^^^
144144
|
145145
= help: add `#![feature(unstable_default)]` to the crate attributes to enable
146146

147147
error[E0658]: use of unstable library feature 'unstable_default'
148-
--> $DIR/generics-default-stability.rs:96:20
148+
--> $DIR/generics-default-stability.rs:97:20
149149
|
150150
LL | let _: Struct5<isize> = Struct5 { field: 1 };
151151
| ^^^^^
152152
|
153153
= help: add `#![feature(unstable_default)]` to the crate attributes to enable
154154

155155
error[E0658]: use of unstable library feature 'unstable_default'
156-
--> $DIR/generics-default-stability.rs:102:20
156+
--> $DIR/generics-default-stability.rs:103:20
157157
|
158158
LL | let _: Struct5<usize> = STRUCT5;
159159
| ^^^^^
160160
|
161161
= help: add `#![feature(unstable_default)]` to the crate attributes to enable
162162

163163
error[E0658]: use of unstable library feature 'unstable_default'
164-
--> $DIR/generics-default-stability.rs:104:20
164+
--> $DIR/generics-default-stability.rs:105:20
165165
|
166166
LL | let _: Struct5<isize> = Struct5 { field: 0 };
167167
| ^^^^^
168168
|
169169
= help: add `#![feature(unstable_default)]` to the crate attributes to enable
170170

171171
warning: use of deprecated item 'unstable_generic_param::Struct4::field': test
172-
--> $DIR/generics-default-stability.rs:83:39
172+
--> $DIR/generics-default-stability.rs:84:39
173173
|
174174
LL | let _: Struct4<isize> = Struct4 { field: 1 };
175175
| ^^^^^^^^
176176

177177
warning: use of deprecated item 'unstable_generic_param::Struct4::field': test
178-
--> $DIR/generics-default-stability.rs:90:39
178+
--> $DIR/generics-default-stability.rs:91:39
179179
|
180180
LL | let _: Struct4<isize> = Struct4 { field: 0 };
181181
| ^^^^^^^^
182182

183183
warning: use of deprecated item 'unstable_generic_param::Struct5::field': test
184-
--> $DIR/generics-default-stability.rs:96:39
184+
--> $DIR/generics-default-stability.rs:97:39
185185
|
186186
LL | let _: Struct5<isize> = Struct5 { field: 1 };
187187
| ^^^^^^^^
188188

189189
warning: use of deprecated item 'unstable_generic_param::Struct5::field': test
190-
--> $DIR/generics-default-stability.rs:104:39
190+
--> $DIR/generics-default-stability.rs:105:39
191191
|
192192
LL | let _: Struct5<isize> = Struct5 { field: 0 };
193193
| ^^^^^^^^

0 commit comments

Comments
 (0)