@@ -29,45 +29,104 @@ mod cross_crate {
29
29
use lint_stability:: * ;
30
30
31
31
fn test ( ) {
32
+ type Foo = MethodTester ;
32
33
let foo = MethodTester ;
33
34
34
35
deprecated ( ) ; //~ ERROR use of deprecated item
35
36
foo. method_deprecated ( ) ; //~ ERROR use of deprecated item
37
+ Foo :: method_deprecated ( & foo) ; //~ ERROR use of deprecated item
38
+ <Foo >:: method_deprecated ( & foo) ; //~ ERROR use of deprecated item
36
39
foo. trait_deprecated ( ) ; //~ ERROR use of deprecated item
40
+ Trait :: trait_deprecated ( & foo) ; //~ ERROR use of deprecated item
41
+ <Foo >:: trait_deprecated ( & foo) ; //~ ERROR use of deprecated item
42
+ <Foo as Trait >:: trait_deprecated ( & foo) ; //~ ERROR use of deprecated item
37
43
38
44
deprecated_text ( ) ; //~ ERROR use of deprecated item: text
39
45
foo. method_deprecated_text ( ) ; //~ ERROR use of deprecated item: text
46
+ Foo :: method_deprecated_text ( & foo) ; //~ ERROR use of deprecated item: text
47
+ <Foo >:: method_deprecated_text ( & foo) ; //~ ERROR use of deprecated item: text
40
48
foo. trait_deprecated_text ( ) ; //~ ERROR use of deprecated item: text
49
+ Trait :: trait_deprecated_text ( & foo) ; //~ ERROR use of deprecated item: text
50
+ <Foo >:: trait_deprecated_text ( & foo) ; //~ ERROR use of deprecated item: text
51
+ <Foo as Trait >:: trait_deprecated_text ( & foo) ; //~ ERROR use of deprecated item: text
41
52
42
53
deprecated_unstable ( ) ; //~ ERROR use of deprecated item
43
54
//~^ WARNING use of unstable library feature
44
55
foo. method_deprecated_unstable ( ) ; //~ ERROR use of deprecated item
45
56
//~^ WARNING use of unstable library feature
57
+ Foo :: method_deprecated_unstable ( & foo) ; //~ ERROR use of deprecated item
58
+ //~^ WARNING use of unstable library feature
59
+ <Foo >:: method_deprecated_unstable ( & foo) ; //~ ERROR use of deprecated item
60
+ //~^ WARNING use of unstable library feature
46
61
foo. trait_deprecated_unstable ( ) ; //~ ERROR use of deprecated item
47
62
//~^ WARNING use of unstable library feature
63
+ Trait :: trait_deprecated_unstable ( & foo) ; //~ ERROR use of deprecated item
64
+ //~^ WARNING use of unstable library feature
65
+ <Foo >:: trait_deprecated_unstable ( & foo) ; //~ ERROR use of deprecated item
66
+ //~^ WARNING use of unstable library feature
67
+ <Foo as Trait >:: trait_deprecated_unstable ( & foo) ; //~ ERROR use of deprecated item
68
+ //~^ WARNING use of unstable library feature
48
69
49
70
deprecated_unstable_text ( ) ; //~ ERROR use of deprecated item: text
50
71
//~^ WARNING use of unstable library feature
51
72
foo. method_deprecated_unstable_text ( ) ; //~ ERROR use of deprecated item: text
52
73
//~^ WARNING use of unstable library feature
74
+ Foo :: method_deprecated_unstable_text ( & foo) ; //~ ERROR use of deprecated item: text
75
+ //~^ WARNING use of unstable library feature
76
+ <Foo >:: method_deprecated_unstable_text ( & foo) ; //~ ERROR use of deprecated item: text
77
+ //~^ WARNING use of unstable library feature
53
78
foo. trait_deprecated_unstable_text ( ) ; //~ ERROR use of deprecated item: text
54
79
//~^ WARNING use of unstable library feature
80
+ Trait :: trait_deprecated_unstable_text ( & foo) ; //~ ERROR use of deprecated item: text
81
+ //~^ WARNING use of unstable library feature
82
+ <Foo >:: trait_deprecated_unstable_text ( & foo) ; //~ ERROR use of deprecated item: text
83
+ //~^ WARNING use of unstable library feature
84
+ <Foo as Trait >:: trait_deprecated_unstable_text ( & foo) ; //~ ERROR use of deprecated item: text
85
+ //~^ WARNING use of unstable library feature
55
86
56
87
unstable ( ) ; //~ WARNING use of unstable library feature
57
88
foo. method_unstable ( ) ; //~ WARNING use of unstable library feature
89
+ Foo :: method_unstable ( & foo) ; //~ WARNING use of unstable library feature
90
+ <Foo >:: method_unstable ( & foo) ; //~ WARNING use of unstable library feature
58
91
foo. trait_unstable ( ) ; //~ WARNING use of unstable library feature
92
+ Trait :: trait_unstable ( & foo) ; //~ WARNING use of unstable library feature
93
+ <Foo >:: trait_unstable ( & foo) ; //~ WARNING use of unstable library feature
94
+ <Foo as Trait >:: trait_unstable ( & foo) ; //~ WARNING use of unstable library feature
59
95
60
- unstable_text ( ) ; //~ WARNING use of unstable library feature 'test_feature': text
61
- foo. method_unstable_text ( ) ; //~ WARNING use of unstable library feature 'test_feature': text
62
- foo. trait_unstable_text ( ) ; //~ WARNING use of unstable library feature 'test_feature': text
96
+ unstable_text ( ) ;
97
+ //~^ WARNING use of unstable library feature 'test_feature': text
98
+ foo. method_unstable_text ( ) ;
99
+ //~^ WARNING use of unstable library feature 'test_feature': text
100
+ Foo :: method_unstable_text ( & foo) ;
101
+ //~^ WARNING use of unstable library feature 'test_feature': text
102
+ <Foo >:: method_unstable_text ( & foo) ;
103
+ //~^ WARNING use of unstable library feature 'test_feature': text
104
+ foo. trait_unstable_text ( ) ;
105
+ //~^ WARNING use of unstable library feature 'test_feature': text
106
+ Trait :: trait_unstable_text ( & foo) ;
107
+ //~^ WARNING use of unstable library feature 'test_feature': text
108
+ <Foo >:: trait_unstable_text ( & foo) ;
109
+ //~^ WARNING use of unstable library feature 'test_feature': text
110
+ <Foo as Trait >:: trait_unstable_text ( & foo) ;
111
+ //~^ WARNING use of unstable library feature 'test_feature': text
63
112
64
113
stable ( ) ;
65
114
foo. method_stable ( ) ;
115
+ Foo :: method_stable ( & foo) ;
116
+ <Foo >:: method_stable ( & foo) ;
66
117
foo. trait_stable ( ) ;
118
+ Trait :: trait_stable ( & foo) ;
119
+ <Foo >:: trait_stable ( & foo) ;
120
+ <Foo as Trait >:: trait_stable ( & foo) ;
67
121
68
122
stable_text ( ) ;
69
123
foo. method_stable_text ( ) ;
124
+ Foo :: method_stable_text ( & foo) ;
125
+ <Foo >:: method_stable_text ( & foo) ;
70
126
foo. trait_stable_text ( ) ;
127
+ Trait :: trait_stable_text ( & foo) ;
128
+ <Foo >:: trait_stable_text ( & foo) ;
129
+ <Foo as Trait >:: trait_stable_text ( & foo) ;
71
130
72
131
let _ = DeprecatedStruct { i : 0 } ; //~ ERROR use of deprecated item
73
132
let _ = DeprecatedUnstableStruct { i : 0 } ; //~ ERROR use of deprecated item
@@ -104,16 +163,47 @@ mod cross_crate {
104
163
macro_test_arg ! ( macro_test_arg!( deprecated_text( ) ) ) ; //~ ERROR use of deprecated item: text
105
164
}
106
165
107
- fn test_method_param < F : Trait > ( foo : F ) {
166
+ fn test_method_param < Foo : Trait > ( foo : Foo ) {
108
167
foo. trait_deprecated ( ) ; //~ ERROR use of deprecated item
168
+ Trait :: trait_deprecated ( & foo) ; //~ ERROR use of deprecated item
169
+ <Foo >:: trait_deprecated ( & foo) ; //~ ERROR use of deprecated item
170
+ <Foo as Trait >:: trait_deprecated ( & foo) ; //~ ERROR use of deprecated item
109
171
foo. trait_deprecated_text ( ) ; //~ ERROR use of deprecated item: text
172
+ Trait :: trait_deprecated_text ( & foo) ; //~ ERROR use of deprecated item: text
173
+ <Foo >:: trait_deprecated_text ( & foo) ; //~ ERROR use of deprecated item: text
174
+ <Foo as Trait >:: trait_deprecated_text ( & foo) ; //~ ERROR use of deprecated item: text
110
175
foo. trait_deprecated_unstable ( ) ; //~ ERROR use of deprecated item
111
176
//~^ WARNING use of unstable library feature
177
+ Trait :: trait_deprecated_unstable ( & foo) ; //~ ERROR use of deprecated item
178
+ //~^ WARNING use of unstable library feature
179
+ <Foo >:: trait_deprecated_unstable ( & foo) ; //~ ERROR use of deprecated item
180
+ //~^ WARNING use of unstable library feature
181
+ <Foo as Trait >:: trait_deprecated_unstable ( & foo) ; //~ ERROR use of deprecated item
182
+ //~^ WARNING use of unstable library feature
112
183
foo. trait_deprecated_unstable_text ( ) ; //~ ERROR use of deprecated item: text
113
184
//~^ WARNING use of unstable library feature
185
+ Trait :: trait_deprecated_unstable_text ( & foo) ; //~ ERROR use of deprecated item: text
186
+ //~^ WARNING use of unstable library feature
187
+ <Foo >:: trait_deprecated_unstable_text ( & foo) ; //~ ERROR use of deprecated item: text
188
+ //~^ WARNING use of unstable library feature
189
+ <Foo as Trait >:: trait_deprecated_unstable_text ( & foo) ; //~ ERROR use of deprecated item: text
190
+ //~^ WARNING use of unstable library feature
114
191
foo. trait_unstable ( ) ; //~ WARNING use of unstable library feature
115
- foo. trait_unstable_text ( ) ; //~ WARNING use of unstable library feature 'test_feature': text
192
+ Trait :: trait_unstable ( & foo) ; //~ WARNING use of unstable library feature
193
+ <Foo >:: trait_unstable ( & foo) ; //~ WARNING use of unstable library feature
194
+ <Foo as Trait >:: trait_unstable ( & foo) ; //~ WARNING use of unstable library feature
195
+ foo. trait_unstable_text ( ) ;
196
+ //~^ WARNING use of unstable library feature 'test_feature': text
197
+ Trait :: trait_unstable_text ( & foo) ;
198
+ //~^ WARNING use of unstable library feature 'test_feature': text
199
+ <Foo >:: trait_unstable_text ( & foo) ;
200
+ //~^ WARNING use of unstable library feature 'test_feature': text
201
+ <Foo as Trait >:: trait_unstable_text ( & foo) ;
202
+ //~^ WARNING use of unstable library feature 'test_feature': text
116
203
foo. trait_stable ( ) ;
204
+ Trait :: trait_stable ( & foo) ;
205
+ <Foo >:: trait_stable ( & foo) ;
206
+ <Foo as Trait >:: trait_stable ( & foo) ;
117
207
}
118
208
119
209
fn test_method_object ( foo : & Trait ) {
@@ -124,7 +214,8 @@ mod cross_crate {
124
214
foo. trait_deprecated_unstable_text ( ) ; //~ ERROR use of deprecated item: text
125
215
//~^ WARNING use of unstable library feature
126
216
foo. trait_unstable ( ) ; //~ WARNING use of unstable library feature
127
- foo. trait_unstable_text ( ) ; //~ WARNING use of unstable library feature 'test_feature': text
217
+ foo. trait_unstable_text ( ) ;
218
+ //~^ WARNING use of unstable library feature 'test_feature': text
128
219
foo. trait_stable ( ) ;
129
220
}
130
221
@@ -264,31 +355,62 @@ mod this_crate {
264
355
// errors, because other stability attributes now have meaning
265
356
// only *across* crates, not within a single crate.
266
357
358
+ type Foo = MethodTester ;
267
359
let foo = MethodTester ;
268
360
269
361
deprecated ( ) ; //~ ERROR use of deprecated item
270
362
foo. method_deprecated ( ) ; //~ ERROR use of deprecated item
363
+ Foo :: method_deprecated ( & foo) ; //~ ERROR use of deprecated item
364
+ <Foo >:: method_deprecated ( & foo) ; //~ ERROR use of deprecated item
271
365
foo. trait_deprecated ( ) ; //~ ERROR use of deprecated item
366
+ Trait :: trait_deprecated ( & foo) ; //~ ERROR use of deprecated item
367
+ <Foo >:: trait_deprecated ( & foo) ; //~ ERROR use of deprecated item
368
+ <Foo as Trait >:: trait_deprecated ( & foo) ; //~ ERROR use of deprecated item
272
369
273
370
deprecated_text ( ) ; //~ ERROR use of deprecated item: text
274
371
foo. method_deprecated_text ( ) ; //~ ERROR use of deprecated item: text
372
+ Foo :: method_deprecated_text ( & foo) ; //~ ERROR use of deprecated item: text
373
+ <Foo >:: method_deprecated_text ( & foo) ; //~ ERROR use of deprecated item: text
275
374
foo. trait_deprecated_text ( ) ; //~ ERROR use of deprecated item: text
375
+ Trait :: trait_deprecated_text ( & foo) ; //~ ERROR use of deprecated item: text
376
+ <Foo >:: trait_deprecated_text ( & foo) ; //~ ERROR use of deprecated item: text
377
+ <Foo as Trait >:: trait_deprecated_text ( & foo) ; //~ ERROR use of deprecated item: text
276
378
277
379
unstable ( ) ;
278
380
foo. method_unstable ( ) ;
381
+ Foo :: method_unstable ( & foo) ;
382
+ <Foo >:: method_unstable ( & foo) ;
279
383
foo. trait_unstable ( ) ;
384
+ Trait :: trait_unstable ( & foo) ;
385
+ <Foo >:: trait_unstable ( & foo) ;
386
+ <Foo as Trait >:: trait_unstable ( & foo) ;
280
387
281
388
unstable_text ( ) ;
282
389
foo. method_unstable_text ( ) ;
390
+ Foo :: method_unstable_text ( & foo) ;
391
+ <Foo >:: method_unstable_text ( & foo) ;
283
392
foo. trait_unstable_text ( ) ;
393
+ Trait :: trait_unstable_text ( & foo) ;
394
+ <Foo >:: trait_unstable_text ( & foo) ;
395
+ <Foo as Trait >:: trait_unstable_text ( & foo) ;
284
396
285
397
stable ( ) ;
286
398
foo. method_stable ( ) ;
399
+ Foo :: method_stable ( & foo) ;
400
+ <Foo >:: method_stable ( & foo) ;
287
401
foo. trait_stable ( ) ;
402
+ Trait :: trait_stable ( & foo) ;
403
+ <Foo >:: trait_stable ( & foo) ;
404
+ <Foo as Trait >:: trait_stable ( & foo) ;
288
405
289
406
stable_text ( ) ;
290
407
foo. method_stable_text ( ) ;
408
+ Foo :: method_stable_text ( & foo) ;
409
+ <Foo >:: method_stable_text ( & foo) ;
291
410
foo. trait_stable_text ( ) ;
411
+ Trait :: trait_stable_text ( & foo) ;
412
+ <Foo >:: trait_stable_text ( & foo) ;
413
+ <Foo as Trait >:: trait_stable_text ( & foo) ;
292
414
293
415
let _ = DeprecatedStruct { i : 0 } ; //~ ERROR use of deprecated item
294
416
let _ = UnstableStruct { i : 0 } ;
@@ -307,12 +429,27 @@ mod this_crate {
307
429
let _ = StableTupleStruct ( 1 ) ;
308
430
}
309
431
310
- fn test_method_param < F : Trait > ( foo : F ) {
432
+ fn test_method_param < Foo : Trait > ( foo : Foo ) {
311
433
foo. trait_deprecated ( ) ; //~ ERROR use of deprecated item
434
+ Trait :: trait_deprecated ( & foo) ; //~ ERROR use of deprecated item
435
+ <Foo >:: trait_deprecated ( & foo) ; //~ ERROR use of deprecated item
436
+ <Foo as Trait >:: trait_deprecated ( & foo) ; //~ ERROR use of deprecated item
312
437
foo. trait_deprecated_text ( ) ; //~ ERROR use of deprecated item: text
438
+ Trait :: trait_deprecated_text ( & foo) ; //~ ERROR use of deprecated item: text
439
+ <Foo >:: trait_deprecated_text ( & foo) ; //~ ERROR use of deprecated item: text
440
+ <Foo as Trait >:: trait_deprecated_text ( & foo) ; //~ ERROR use of deprecated item: text
313
441
foo. trait_unstable ( ) ;
442
+ Trait :: trait_unstable ( & foo) ;
443
+ <Foo >:: trait_unstable ( & foo) ;
444
+ <Foo as Trait >:: trait_unstable ( & foo) ;
314
445
foo. trait_unstable_text ( ) ;
446
+ Trait :: trait_unstable_text ( & foo) ;
447
+ <Foo >:: trait_unstable_text ( & foo) ;
448
+ <Foo as Trait >:: trait_unstable_text ( & foo) ;
315
449
foo. trait_stable ( ) ;
450
+ Trait :: trait_stable ( & foo) ;
451
+ <Foo >:: trait_stable ( & foo) ;
452
+ <Foo as Trait >:: trait_stable ( & foo) ;
316
453
}
317
454
318
455
fn test_method_object ( foo : & Trait ) {
0 commit comments