@@ -26,32 +26,32 @@ mod cross_crate {
2626 let foo = MethodTester ;
2727
2828 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
3131
3232 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
3535
3636 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
3939
4040 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
4343
4444 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
4747
4848 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
5151
5252 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
5555
5656 stable ( ) ;
5757 foo. method_stable ( ) ;
@@ -102,6 +102,28 @@ mod cross_crate {
102102 let _ = FrozenVariant ;
103103 let _ = LockedVariant ;
104104 }
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+ }
105127}
106128
107129mod this_crate {
@@ -259,32 +281,32 @@ mod this_crate {
259281 let foo = MethodTester ;
260282
261283 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
264286
265287 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
268290
269291 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
272294
273295 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
276298
277299 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
280302
281303 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
284306
285307 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
288310
289311 stable ( ) ;
290312 foo. method_stable ( ) ;
@@ -335,6 +357,28 @@ mod this_crate {
335357 let _ = FrozenVariant ;
336358 let _ = LockedVariant ;
337359 }
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+ }
338382}
339383
340384fn main ( ) { }
0 commit comments