Skip to content

Commit 2b87651

Browse files
committed
Fix fallout from correct stability handling in UFCS.
1 parent 79ff90f commit 2b87651

File tree

3 files changed

+145
-9
lines changed

3 files changed

+145
-9
lines changed

src/libcollections/slice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ pub trait SliceExt {
790790
fn ends_with(&self, needle: &[Self::Item]) -> bool where Self::Item: PartialEq;
791791

792792
/// Convert `self` into a vector without clones or allocation.
793-
#[unstable(feature = "collections")]
793+
#[stable(feature = "rust1", since = "1.0.0")]
794794
fn into_vec(self: Box<Self>) -> Vec<Self::Item>;
795795
}
796796

src/librustc_privacy/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
1818
html_root_url = "http://doc.rust-lang.org/nightly/")]
1919

20-
#![feature(core)]
2120
#![feature(int_uint)]
2221
#![feature(rustc_diagnostic_macros)]
2322
#![feature(rustc_private)]

src/test/compile-fail/lint-stability.rs

Lines changed: 144 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,45 +29,104 @@ mod cross_crate {
2929
use lint_stability::*;
3030

3131
fn test() {
32+
type Foo = MethodTester;
3233
let foo = MethodTester;
3334

3435
deprecated(); //~ ERROR use of deprecated item
3536
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
3639
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
3743

3844
deprecated_text(); //~ ERROR use of deprecated item: text
3945
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
4048
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
4152

4253
deprecated_unstable(); //~ ERROR use of deprecated item
4354
//~^ WARNING use of unstable library feature
4455
foo.method_deprecated_unstable(); //~ ERROR use of deprecated item
4556
//~^ 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
4661
foo.trait_deprecated_unstable(); //~ ERROR use of deprecated item
4762
//~^ 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
4869

4970
deprecated_unstable_text(); //~ ERROR use of deprecated item: text
5071
//~^ WARNING use of unstable library feature
5172
foo.method_deprecated_unstable_text(); //~ ERROR use of deprecated item: text
5273
//~^ 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
5378
foo.trait_deprecated_unstable_text(); //~ ERROR use of deprecated item: text
5479
//~^ 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
5586

5687
unstable(); //~ WARNING use of unstable library feature
5788
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
5891
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
5995

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
63112

64113
stable();
65114
foo.method_stable();
115+
Foo::method_stable(&foo);
116+
<Foo>::method_stable(&foo);
66117
foo.trait_stable();
118+
Trait::trait_stable(&foo);
119+
<Foo>::trait_stable(&foo);
120+
<Foo as Trait>::trait_stable(&foo);
67121

68122
stable_text();
69123
foo.method_stable_text();
124+
Foo::method_stable_text(&foo);
125+
<Foo>::method_stable_text(&foo);
70126
foo.trait_stable_text();
127+
Trait::trait_stable_text(&foo);
128+
<Foo>::trait_stable_text(&foo);
129+
<Foo as Trait>::trait_stable_text(&foo);
71130

72131
let _ = DeprecatedStruct { i: 0 }; //~ ERROR use of deprecated item
73132
let _ = DeprecatedUnstableStruct { i: 0 }; //~ ERROR use of deprecated item
@@ -104,16 +163,47 @@ mod cross_crate {
104163
macro_test_arg!(macro_test_arg!(deprecated_text())); //~ ERROR use of deprecated item: text
105164
}
106165

107-
fn test_method_param<F: Trait>(foo: F) {
166+
fn test_method_param<Foo: Trait>(foo: Foo) {
108167
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
109171
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
110175
foo.trait_deprecated_unstable(); //~ ERROR use of deprecated item
111176
//~^ 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
112183
foo.trait_deprecated_unstable_text(); //~ ERROR use of deprecated item: text
113184
//~^ 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
114191
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
116203
foo.trait_stable();
204+
Trait::trait_stable(&foo);
205+
<Foo>::trait_stable(&foo);
206+
<Foo as Trait>::trait_stable(&foo);
117207
}
118208

119209
fn test_method_object(foo: &Trait) {
@@ -124,7 +214,8 @@ mod cross_crate {
124214
foo.trait_deprecated_unstable_text(); //~ ERROR use of deprecated item: text
125215
//~^ WARNING use of unstable library feature
126216
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
128219
foo.trait_stable();
129220
}
130221

@@ -264,31 +355,62 @@ mod this_crate {
264355
// errors, because other stability attributes now have meaning
265356
// only *across* crates, not within a single crate.
266357

358+
type Foo = MethodTester;
267359
let foo = MethodTester;
268360

269361
deprecated(); //~ ERROR use of deprecated item
270362
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
271365
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
272369

273370
deprecated_text(); //~ ERROR use of deprecated item: text
274371
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
275374
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
276378

277379
unstable();
278380
foo.method_unstable();
381+
Foo::method_unstable(&foo);
382+
<Foo>::method_unstable(&foo);
279383
foo.trait_unstable();
384+
Trait::trait_unstable(&foo);
385+
<Foo>::trait_unstable(&foo);
386+
<Foo as Trait>::trait_unstable(&foo);
280387

281388
unstable_text();
282389
foo.method_unstable_text();
390+
Foo::method_unstable_text(&foo);
391+
<Foo>::method_unstable_text(&foo);
283392
foo.trait_unstable_text();
393+
Trait::trait_unstable_text(&foo);
394+
<Foo>::trait_unstable_text(&foo);
395+
<Foo as Trait>::trait_unstable_text(&foo);
284396

285397
stable();
286398
foo.method_stable();
399+
Foo::method_stable(&foo);
400+
<Foo>::method_stable(&foo);
287401
foo.trait_stable();
402+
Trait::trait_stable(&foo);
403+
<Foo>::trait_stable(&foo);
404+
<Foo as Trait>::trait_stable(&foo);
288405

289406
stable_text();
290407
foo.method_stable_text();
408+
Foo::method_stable_text(&foo);
409+
<Foo>::method_stable_text(&foo);
291410
foo.trait_stable_text();
411+
Trait::trait_stable_text(&foo);
412+
<Foo>::trait_stable_text(&foo);
413+
<Foo as Trait>::trait_stable_text(&foo);
292414

293415
let _ = DeprecatedStruct { i: 0 }; //~ ERROR use of deprecated item
294416
let _ = UnstableStruct { i: 0 };
@@ -307,12 +429,27 @@ mod this_crate {
307429
let _ = StableTupleStruct (1);
308430
}
309431

310-
fn test_method_param<F: Trait>(foo: F) {
432+
fn test_method_param<Foo: Trait>(foo: Foo) {
311433
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
312437
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
313441
foo.trait_unstable();
442+
Trait::trait_unstable(&foo);
443+
<Foo>::trait_unstable(&foo);
444+
<Foo as Trait>::trait_unstable(&foo);
314445
foo.trait_unstable_text();
446+
Trait::trait_unstable_text(&foo);
447+
<Foo>::trait_unstable_text(&foo);
448+
<Foo as Trait>::trait_unstable_text(&foo);
315449
foo.trait_stable();
450+
Trait::trait_stable(&foo);
451+
<Foo>::trait_stable(&foo);
452+
<Foo as Trait>::trait_stable(&foo);
316453
}
317454

318455
fn test_method_object(foo: &Trait) {

0 commit comments

Comments
 (0)