Skip to content

Commit af19d44

Browse files
Avi-D-coderJacob Hughes
authored andcommitted
Add test case demonstrating leak
1 parent 2793da3 commit af19d44

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ fn main() {
4444
// and can be used without the 'unstable_default' feature.
4545
let _ = STRUCT1.field;
4646
let _ = Struct1 { field: 1 };
47+
let _ = Struct1 { field: () };
48+
let _ = Struct1 { field: 1isize };
4749
let _: Struct1 = Struct1 { field: 1 };
4850
let _: usize = STRUCT1.field;
4951
let _ = STRUCT1.field + 1;

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,75 +23,75 @@ LL | impl Trait2<usize> for S {
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:81:29
26+
--> $DIR/generics-default-stability.rs:83: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:81:12
34+
--> $DIR/generics-default-stability.rs:83: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:86:12
40+
--> $DIR/generics-default-stability.rs:88: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:87:12
46+
--> $DIR/generics-default-stability.rs:89: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:88:29
52+
--> $DIR/generics-default-stability.rs:90: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:88:12
58+
--> $DIR/generics-default-stability.rs:90: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:94:29
64+
--> $DIR/generics-default-stability.rs:96: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:94:12
70+
--> $DIR/generics-default-stability.rs:96: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:99:12
76+
--> $DIR/generics-default-stability.rs:101: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:100:12
82+
--> $DIR/generics-default-stability.rs:102: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:102:29
88+
--> $DIR/generics-default-stability.rs:104: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:102:12
94+
--> $DIR/generics-default-stability.rs:104:12
9595
|
9696
LL | let _: Struct5<isize> = Struct5 { field: 0 };
9797
| ^^^^^^^^^^^^^^
@@ -121,73 +121,73 @@ LL | let _: Struct1<isize> = Struct1 { field: 0 };
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:67:27
124+
--> $DIR/generics-default-stability.rs:69: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:69:27
132+
--> $DIR/generics-default-stability.rs:71: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:70:27
140+
--> $DIR/generics-default-stability.rs:72: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:94:20
148+
--> $DIR/generics-default-stability.rs:96: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:100:20
156+
--> $DIR/generics-default-stability.rs:102: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:102:20
164+
--> $DIR/generics-default-stability.rs:104: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:81:39
172+
--> $DIR/generics-default-stability.rs:83: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:88:39
178+
--> $DIR/generics-default-stability.rs:90: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:94:39
184+
--> $DIR/generics-default-stability.rs:96: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:102:39
190+
--> $DIR/generics-default-stability.rs:104:39
191191
|
192192
LL | let _: Struct5<isize> = Struct5 { field: 0 };
193193
| ^^^^^^^^

0 commit comments

Comments
 (0)