@@ -26,32 +26,32 @@ mod cross_crate {
26
26
let foo = MethodTester ;
27
27
28
28
deprecated ( ) ; //~ ERROR use of deprecated item
29
- foo. method_deprecated ( ) ; // ~ ERROR use of deprecated item
30
- foo. trait_deprecated ( ) ; // ~ ERROR use of deprecated item
29
+ foo. method_deprecated ( ) ; //~ ERROR use of deprecated item
30
+ foo. trait_deprecated ( ) ; //~ ERROR use of deprecated item
31
31
32
32
deprecated_text ( ) ; //~ ERROR use of deprecated item: text
33
- foo. method_deprecated_text ( ) ; // ~ ERROR use of deprecated item: text
34
- foo. trait_deprecated_text ( ) ; // ~ ERROR use of deprecated item: text
33
+ foo. method_deprecated_text ( ) ; //~ ERROR use of deprecated item: text
34
+ foo. trait_deprecated_text ( ) ; //~ ERROR use of deprecated item: text
35
35
36
36
experimental ( ) ; //~ ERROR use of experimental item
37
- foo. method_experimental ( ) ; // ~ ERROR use of experimental item
38
- foo. trait_experimental ( ) ; // ~ ERROR use of experimental item
37
+ foo. method_experimental ( ) ; //~ ERROR use of experimental item
38
+ foo. trait_experimental ( ) ; //~ ERROR use of experimental item
39
39
40
40
experimental_text ( ) ; //~ ERROR use of experimental item: text
41
- foo. method_experimental_text ( ) ; // ~ ERROR use of experimental item: text
42
- foo. trait_experimental_text ( ) ; // ~ ERROR use of experimental item: text
41
+ foo. method_experimental_text ( ) ; //~ ERROR use of experimental item: text
42
+ foo. trait_experimental_text ( ) ; //~ ERROR use of experimental item: text
43
43
44
44
unstable ( ) ; //~ ERROR use of unstable item
45
- foo. method_unstable ( ) ; // ~ ERROR use of unstable item
46
- foo. trait_unstable ( ) ; // ~ ERROR use of unstable item
45
+ foo. method_unstable ( ) ; //~ ERROR use of unstable item
46
+ foo. trait_unstable ( ) ; //~ ERROR use of unstable item
47
47
48
48
unstable_text ( ) ; //~ ERROR use of unstable item: text
49
- foo. method_unstable_text ( ) ; // ~ ERROR use of unstable item: text
50
- foo. trait_unstable_text ( ) ; // ~ ERROR use of unstable item: text
49
+ foo. method_unstable_text ( ) ; //~ ERROR use of unstable item: text
50
+ foo. trait_unstable_text ( ) ; //~ ERROR use of unstable item: text
51
51
52
52
unmarked ( ) ; //~ ERROR use of unmarked item
53
- foo. method_unmarked ( ) ; // ~ ERROR use of unmarked item
54
- foo. trait_unmarked ( ) ; // ~ ERROR use of unmarked item
53
+ foo. method_unmarked ( ) ; //~ ERROR use of unmarked item
54
+ foo. trait_unmarked ( ) ; //~ ERROR use of unmarked item
55
55
56
56
stable ( ) ;
57
57
foo. method_stable ( ) ;
@@ -102,6 +102,28 @@ mod cross_crate {
102
102
let _ = FrozenVariant ;
103
103
let _ = LockedVariant ;
104
104
}
105
+
106
+ fn test_method_param < F : Trait > ( foo : F ) {
107
+ foo. trait_deprecated ( ) ; //~ ERROR use of deprecated item
108
+ foo. trait_deprecated_text ( ) ; //~ ERROR use of deprecated item: text
109
+ foo. trait_experimental ( ) ; //~ ERROR use of experimental item
110
+ foo. trait_experimental_text ( ) ; //~ ERROR use of experimental item: text
111
+ foo. trait_unstable ( ) ; //~ ERROR use of unstable item
112
+ foo. trait_unstable_text ( ) ; //~ ERROR use of unstable item: text
113
+ foo. trait_unmarked ( ) ; //~ ERROR use of unmarked item
114
+ foo. trait_stable ( ) ;
115
+ }
116
+
117
+ fn test_method_object ( foo : & Trait ) {
118
+ foo. trait_deprecated ( ) ; //~ ERROR use of deprecated item
119
+ foo. trait_deprecated_text ( ) ; //~ ERROR use of deprecated item: text
120
+ foo. trait_experimental ( ) ; //~ ERROR use of experimental item
121
+ foo. trait_experimental_text ( ) ; //~ ERROR use of experimental item: text
122
+ foo. trait_unstable ( ) ; //~ ERROR use of unstable item
123
+ foo. trait_unstable_text ( ) ; //~ ERROR use of unstable item: text
124
+ foo. trait_unmarked ( ) ; //~ ERROR use of unmarked item
125
+ foo. trait_stable ( ) ;
126
+ }
105
127
}
106
128
107
129
mod this_crate {
@@ -259,32 +281,32 @@ mod this_crate {
259
281
let foo = MethodTester ;
260
282
261
283
deprecated ( ) ; //~ ERROR use of deprecated item
262
- foo. method_deprecated ( ) ; // ~ ERROR use of deprecated item
263
- foo. trait_deprecated ( ) ; // ~ ERROR use of deprecated item
284
+ foo. method_deprecated ( ) ; //~ ERROR use of deprecated item
285
+ foo. trait_deprecated ( ) ; //~ ERROR use of deprecated item
264
286
265
287
deprecated_text ( ) ; //~ ERROR use of deprecated item: text
266
- foo. method_deprecated_text ( ) ; // ~ ERROR use of deprecated item: text
267
- foo. trait_deprecated_text ( ) ; // ~ ERROR use of deprecated item: text
288
+ foo. method_deprecated_text ( ) ; //~ ERROR use of deprecated item: text
289
+ foo. trait_deprecated_text ( ) ; //~ ERROR use of deprecated item: text
268
290
269
291
experimental ( ) ; //~ ERROR use of experimental item
270
- foo. method_experimental ( ) ; // ~ ERROR use of experimental item
271
- foo. trait_experimental ( ) ; // ~ ERROR use of experimental item
292
+ foo. method_experimental ( ) ; //~ ERROR use of experimental item
293
+ foo. trait_experimental ( ) ; //~ ERROR use of experimental item
272
294
273
295
experimental_text ( ) ; //~ ERROR use of experimental item: text
274
- foo. method_experimental_text ( ) ; // ~ ERROR use of experimental item: text
275
- foo. trait_experimental_text ( ) ; // ~ ERROR use of experimental item: text
296
+ foo. method_experimental_text ( ) ; //~ ERROR use of experimental item: text
297
+ foo. trait_experimental_text ( ) ; //~ ERROR use of experimental item: text
276
298
277
299
unstable ( ) ; //~ ERROR use of unstable item
278
- foo. method_unstable ( ) ; // ~ ERROR use of unstable item
279
- foo. trait_unstable ( ) ; // ~ ERROR use of unstable item
300
+ foo. method_unstable ( ) ; //~ ERROR use of unstable item
301
+ foo. trait_unstable ( ) ; //~ ERROR use of unstable item
280
302
281
303
unstable_text ( ) ; //~ ERROR use of unstable item: text
282
- foo. method_unstable_text ( ) ; // ~ ERROR use of unstable item: text
283
- foo. trait_unstable_text ( ) ; // ~ ERROR use of unstable item: text
304
+ foo. method_unstable_text ( ) ; //~ ERROR use of unstable item: text
305
+ foo. trait_unstable_text ( ) ; //~ ERROR use of unstable item: text
284
306
285
307
unmarked ( ) ; //~ ERROR use of unmarked item
286
- foo. method_unmarked ( ) ; // ~ ERROR use of unmarked item
287
- foo. trait_unmarked ( ) ; // ~ ERROR use of unmarked item
308
+ foo. method_unmarked ( ) ; //~ ERROR use of unmarked item
309
+ foo. trait_unmarked ( ) ; //~ ERROR use of unmarked item
288
310
289
311
stable ( ) ;
290
312
foo. method_stable ( ) ;
@@ -335,6 +357,28 @@ mod this_crate {
335
357
let _ = FrozenVariant ;
336
358
let _ = LockedVariant ;
337
359
}
360
+
361
+ fn test_method_param < F : Trait > ( foo : F ) {
362
+ foo. trait_deprecated ( ) ; //~ ERROR use of deprecated item
363
+ foo. trait_deprecated_text ( ) ; //~ ERROR use of deprecated item: text
364
+ foo. trait_experimental ( ) ; //~ ERROR use of experimental item
365
+ foo. trait_experimental_text ( ) ; //~ ERROR use of experimental item: text
366
+ foo. trait_unstable ( ) ; //~ ERROR use of unstable item
367
+ foo. trait_unstable_text ( ) ; //~ ERROR use of unstable item: text
368
+ foo. trait_unmarked ( ) ; //~ ERROR use of unmarked item
369
+ foo. trait_stable ( ) ;
370
+ }
371
+
372
+ fn test_method_object ( foo : & Trait ) {
373
+ foo. trait_deprecated ( ) ; //~ ERROR use of deprecated item
374
+ foo. trait_deprecated_text ( ) ; //~ ERROR use of deprecated item: text
375
+ foo. trait_experimental ( ) ; //~ ERROR use of experimental item
376
+ foo. trait_experimental_text ( ) ; //~ ERROR use of experimental item: text
377
+ foo. trait_unstable ( ) ; //~ ERROR use of unstable item
378
+ foo. trait_unstable_text ( ) ; //~ ERROR use of unstable item: text
379
+ foo. trait_unmarked ( ) ; //~ ERROR use of unmarked item
380
+ foo. trait_stable ( ) ;
381
+ }
338
382
}
339
383
340
384
fn main ( ) { }
0 commit comments