Skip to content

Commit 9d117c0

Browse files
committed
Minor fixes
1 parent b50c7a5 commit 9d117c0

File tree

13 files changed

+60
-77
lines changed

13 files changed

+60
-77
lines changed

mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ tidy:
300300
| grep '^$(S)src/libbacktrace' -v \
301301
| grep '^$(S)src/rust-installer' -v \
302302
| xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
303-
$(CFG_PYTHON) $(S)src/etc/featureck.py $(S)src/
303+
$(Q)$(CFG_PYTHON) $(S)src/etc/featureck.py $(S)src/
304304

305305

306306
endif

src/etc/featureck.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
line = line.replace("(", "").replace("),", "").replace(")", "")
4444
parts = line.split(",")
4545
if len(parts) != 3:
46-
print "unexpected number of components in line: " + original_line
46+
print "error: unexpected number of components in line: " + original_line
4747
sys.exit(1)
4848
feature_name = parts[0].strip().replace('"', "")
4949
since = parts[1].strip().replace('"', "")
@@ -102,14 +102,15 @@
102102
lib_features[feature_name] = feature_name
103103
if lib_features_and_level.get((feature_name, level)) is None:
104104
# Add it to the observed features
105-
lib_features_and_level[(feature_name, level)] = (since, path, line_num, line)
105+
lib_features_and_level[(feature_name, level)] = \
106+
(since, path, line_num, line)
106107
else:
107108
# Verify that for this combination of feature_name and level the 'since'
108109
# attribute matches.
109110
(expected_since, source_path, source_line_num, source_line) = \
110111
lib_features_and_level.get((feature_name, level))
111112
if since != expected_since:
112-
print "mismatch in " + level + " feature '" + feature_name + "'"
113+
print "error: mismatch in " + level + " feature '" + feature_name + "'"
113114
print "line " + str(source_line_num) + " of " + source_path + ":"
114115
print source_line
115116
print "line " + str(line_num) + " of " + path + ":"
@@ -118,13 +119,13 @@
118119

119120
# Verify that this lib feature doesn't duplicate a lang feature
120121
if feature_name in language_feature_names:
121-
print "lib feature '" + feature_name + "' duplicates a lang feature"
122+
print "error: lib feature '" + feature_name + "' duplicates a lang feature"
122123
print "line " + str(line_num) + " of " + path + ":"
123124
print line
124125
errors = True
125126

126127
else:
127-
print "misformed stability attribute"
128+
print "error: misformed stability attribute"
128129
print "line " + str(line_num) + " of " + path + ":"
129130
print line
130131
errors = True
@@ -141,7 +142,7 @@
141142
status = "unstable"
142143
stable_since = None
143144
partially_deprecated = False
144-
145+
145146
if f[2] == "Accepted":
146147
status = "stable"
147148
if status == "stable":
@@ -165,7 +166,7 @@
165166
is_deprecated = lib_features_and_level.get((name, "deprecated")) is not None
166167

167168
if is_stable and is_unstable:
168-
print "feature '" + name + "' is both stable and unstable"
169+
print "error: feature '" + name + "' is both stable and unstable"
169170
errors = True
170171

171172
if is_stable:
@@ -189,7 +190,7 @@
189190
for name in lib_feature_stats:
190191
if language_feature_stats.get(name) is not None:
191192
if not name in joint_features:
192-
print "feature '" + name + "' is both a lang and lib feature but not whitelisted"
193+
print "error: feature '" + name + "' is both a lang and lib feature but not whitelisted"
193194
errors = True
194195
lang_status = lang_feature_stats[name][3]
195196
lib_status = lib_feature_stats[name][3]
@@ -199,7 +200,7 @@
199200
lib_partially_deprecated = lib_feature_stats[name][5]
200201

201202
if lang_status != lib_status and lib_status != "deprecated":
202-
print "feature '" + name + "' has lang status " + lang_status + \
203+
print "error: feature '" + name + "' has lang status " + lang_status + \
203204
" but lib status " + lib_status
204205
errors = True
205206

@@ -208,7 +209,7 @@
208209
partially_deprecated = True
209210

210211
if lang_stable_since != lib_stable_since:
211-
print "feature '" + name + "' has lang stable since " + lang_stable_since + \
212+
print "error: feature '" + name + "' has lang stable since " + lang_stable_since + \
212213
" but lib stable since " + lib_stable_since
213214
errors = True
214215

src/liballoc/rc.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -742,11 +742,9 @@ pub struct Weak<T> {
742742
}
743743

744744
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
745-
#[allow(unstable)]
746745
impl<T> !marker::Send for Weak<T> {}
747746

748747
#[cfg(not(stage0))] // NOTE remove cfg after next snapshot
749-
#[allow(unstable)]
750748
impl<T> !marker::Sync for Weak<T> {}
751749

752750

src/libcore/hash/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ pub trait Hasher {
9696

9797
/// A common bound on the `Hasher` parameter to `Hash` implementations in order
9898
/// to generically hash an aggregate.
99-
#[experimental = "this trait will likely be replaced by io::Writer"]
99+
#[unstable(feature = "unnamed_feature", since = "1.0.0",
100+
reason = "this trait will likely be replaced by io::Writer")]
100101
#[allow(missing_docs)]
101102
pub trait Writer {
102103
fn write(&mut self, bytes: &[u8]);

src/libcoretest/cell.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ fn discard_doesnt_unborrow() {
114114
}
115115

116116
#[test]
117-
#[allow(unstable)]
118117
fn clone_ref_updates_flag() {
119118
let x = RefCell::new(0i);
120119
{

src/librustc/middle/stability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ impl<'a, 'tcx> Checker<'a, 'tcx> {
233233
None => {
234234
// This is an 'unmarked' API, which should not exist
235235
// in the standard library.
236-
self.tcx.sess.span_err(span, "use of unmarked staged library feature");
236+
self.tcx.sess.span_err(span, "use of unmarked library feature");
237237
self.tcx.sess.span_note(span, "this is either a bug in the library you are \
238238
using or a bug in the compiler - there is \
239239
no way to use this feature");

src/librustc_driver/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ pub fn phase_2_configure_and_expand(sess: &Session,
486486

487487
// Needs to go *after* expansion to be able to check the results of macro expansion.
488488
time(time_passes, "complete gated feature checking", (), |_| {
489-
let features =
489+
let features =
490490
syntax::feature_gate::check_crate(sess.codemap(),
491491
&sess.parse_sess.span_diagnostic,
492492
&krate);

src/test/auxiliary/lint_output_format.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#![crate_name="lint_output_format"]
1212
#![crate_type = "lib"]
1313
#![staged_api]
14+
#![unstable(feature = "unnamed_feature", since = "1.0.0")]
1415

1516
#[deprecated(feature = "oldstuff", since = "1.0.0")]
1617
pub fn foo() -> uint {

src/test/compile-fail/lint-forbid-cmdline.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -F unstable
11+
// compile-flags: -F deprecated
1212

1313
#![staged_api]
14-
#[allow(unstable)] //~ ERROR allow(unstable) overruled by outer forbid(unstable)
14+
#[allow(deprecated)] //~ ERROR allow(deprecated) overruled by outer forbid(deprecated)
1515
fn main() {
1616
}

src/test/compile-fail/lint-output-format.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags:-F unstable
11+
// compile-flags: -F unused_features
1212
// aux-build:lint_output_format.rs
1313

14-
extern crate lint_output_format; //~ ERROR: use of unmarked item
14+
#![feature(foo)] //~ ERROR unused or unknown feature
15+
16+
extern crate lint_output_format; //~ WARNING: use of unstable library feature
1517
use lint_output_format::{foo, bar};
1618

1719
fn main() {
1820
let _x = foo(); //~ WARNING #[warn(deprecated)] on by default
19-
let _y = bar(); //~ ERROR [-F unstable]
21+
let _y = bar(); //~ WARNING: use of unstable library feature
2022
}

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

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,18 @@
1212
// aux-build:inherited_stability.rs
1313
// aux-build:stability_cfg1.rs
1414
// aux-build:stability_cfg2.rs
15+
// ignore-tidy-linelength
1516

16-
#![deny(unstable)]
1717
#![deny(deprecated)]
18-
#![deny(unstable)]
1918
#![allow(dead_code)]
2019
#![staged_api]
2120

2221
#[macro_use]
23-
extern crate lint_stability; //~ ERROR: use of unmarked item
22+
extern crate lint_stability; //~ ERROR: use of unmarked library feature
2423

2524
mod cross_crate {
2625
extern crate stability_cfg1;
27-
extern crate stability_cfg2; //~ ERROR: use of unstable item
26+
extern crate stability_cfg2; //~ WARNING: use of unstable library feature
2827

2928
use lint_stability::*;
3029

@@ -39,17 +38,17 @@ mod cross_crate {
3938
foo.method_deprecated_text(); //~ ERROR use of deprecated item: text
4039
foo.trait_deprecated_text(); //~ ERROR use of deprecated item: text
4140

42-
unstable(); //~ ERROR use of unstable item
43-
foo.method_unstable(); //~ ERROR use of unstable item
44-
foo.trait_unstable(); //~ ERROR use of unstable item
41+
unstable(); //~ WARNING use of unstable library feature
42+
foo.method_unstable(); //~ WARNING use of unstable library feature
43+
foo.trait_unstable(); //~ WARNING use of unstable library feature
4544

46-
unstable_text(); //~ ERROR use of unstable item: text
47-
foo.method_unstable_text(); //~ ERROR use of unstable item: text
48-
foo.trait_unstable_text(); //~ ERROR use of unstable item: text
45+
unstable_text(); //~ WARNING use of unstable library feature 'unnamed_feature': text
46+
foo.method_unstable_text(); //~ WARNING use of unstable library feature 'unnamed_feature': text
47+
foo.trait_unstable_text(); //~ WARNING use of unstable library feature 'unnamed_feature': text
4948

50-
unmarked(); //~ ERROR use of unmarked item
51-
foo.method_unmarked(); //~ ERROR use of unmarked item
52-
foo.trait_unmarked(); //~ ERROR use of unmarked item
49+
unmarked(); //~ ERROR use of unmarked library feature
50+
foo.method_unmarked(); //~ ERROR use of unmarked library feature
51+
foo.trait_unmarked(); //~ ERROR use of unmarked library feature
5352

5453
stable();
5554
foo.method_stable();
@@ -60,23 +59,23 @@ mod cross_crate {
6059
foo.trait_stable_text();
6160

6261
let _ = DeprecatedStruct { i: 0 }; //~ ERROR use of deprecated item
63-
let _ = UnstableStruct { i: 0 }; //~ ERROR use of unstable item
64-
let _ = UnmarkedStruct { i: 0 }; //~ ERROR use of unmarked item
62+
let _ = UnstableStruct { i: 0 }; //~ WARNING use of unstable library feature
63+
let _ = UnmarkedStruct { i: 0 }; //~ ERROR use of unmarked library feature
6564
let _ = StableStruct { i: 0 };
6665

6766
let _ = DeprecatedUnitStruct; //~ ERROR use of deprecated item
68-
let _ = UnstableUnitStruct; //~ ERROR use of unstable item
69-
let _ = UnmarkedUnitStruct; //~ ERROR use of unmarked item
67+
let _ = UnstableUnitStruct; //~ WARNING use of unstable library feature
68+
let _ = UnmarkedUnitStruct; //~ ERROR use of unmarked library feature
7069
let _ = StableUnitStruct;
7170

7271
let _ = Enum::DeprecatedVariant; //~ ERROR use of deprecated item
73-
let _ = Enum::UnstableVariant; //~ ERROR use of unstable item
74-
let _ = Enum::UnmarkedVariant; //~ ERROR use of unmarked item
72+
let _ = Enum::UnstableVariant; //~ WARNING use of unstable library feature
73+
let _ = Enum::UnmarkedVariant; //~ ERROR use of unmarked library feature
7574
let _ = Enum::StableVariant;
7675

7776
let _ = DeprecatedTupleStruct (1); //~ ERROR use of deprecated item
78-
let _ = UnstableTupleStruct (1); //~ ERROR use of unstable item
79-
let _ = UnmarkedTupleStruct (1); //~ ERROR use of unmarked item
77+
let _ = UnstableTupleStruct (1); //~ WARNING use of unstable library feature
78+
let _ = UnmarkedTupleStruct (1); //~ ERROR use of unmarked library feature
8079
let _ = StableTupleStruct (1);
8180

8281
// At the moment, the lint checker only checks stability in
@@ -93,47 +92,47 @@ mod cross_crate {
9392
fn test_method_param<F: Trait>(foo: F) {
9493
foo.trait_deprecated(); //~ ERROR use of deprecated item
9594
foo.trait_deprecated_text(); //~ ERROR use of deprecated item: text
96-
foo.trait_unstable(); //~ ERROR use of unstable item
97-
foo.trait_unstable_text(); //~ ERROR use of unstable item: text
98-
foo.trait_unmarked(); //~ ERROR use of unmarked item
95+
foo.trait_unstable(); //~ WARNING use of unstable library feature
96+
foo.trait_unstable_text(); //~ WARNING use of unstable library feature 'unnamed_feature': text
97+
foo.trait_unmarked(); //~ ERROR use of unmarked library feature
9998
foo.trait_stable();
10099
}
101100

102101
fn test_method_object(foo: &Trait) {
103102
foo.trait_deprecated(); //~ ERROR use of deprecated item
104103
foo.trait_deprecated_text(); //~ ERROR use of deprecated item: text
105-
foo.trait_unstable(); //~ ERROR use of unstable item
106-
foo.trait_unstable_text(); //~ ERROR use of unstable item: text
107-
foo.trait_unmarked(); //~ ERROR use of unmarked item
104+
foo.trait_unstable(); //~ WARNING use of unstable library feature
105+
foo.trait_unstable_text(); //~ WARNING use of unstable library feature 'unnamed_feature': text
106+
foo.trait_unmarked(); //~ ERROR use of unmarked library feature
108107
foo.trait_stable();
109108
}
110109

111110
struct S;
112111

113-
impl UnstableTrait for S { } //~ ERROR use of unstable item
112+
impl UnstableTrait for S { } //~ WARNING use of unstable library feature
114113

115-
trait LocalTrait : UnstableTrait { } //~ ERROR use of unstable item
114+
trait LocalTrait : UnstableTrait { } //~ WARNING use of unstable library feature
116115
}
117116

118117
mod inheritance {
119-
extern crate inherited_stability; //~ ERROR: use of unstable item
118+
extern crate inherited_stability; //~ WARNING: use of unstable library feature
120119
use self::inherited_stability::*;
121120

122121
fn test_inheritance() {
123-
unstable(); //~ ERROR use of unstable item
122+
unstable(); //~ WARNING use of unstable library feature
124123
stable();
125124

126-
stable_mod::unstable(); //~ ERROR use of unstable item
125+
stable_mod::unstable(); //~ WARNING use of unstable library feature
127126
stable_mod::stable();
128127

129128
unstable_mod::deprecated(); //~ ERROR use of deprecated item
130-
unstable_mod::unstable(); //~ ERROR use of unstable item
129+
unstable_mod::unstable(); //~ WARNING use of unstable library feature
131130

132-
let _ = Unstable::UnstableVariant; //~ ERROR use of unstable item
131+
let _ = Unstable::UnstableVariant; //~ WARNING use of unstable library feature
133132
let _ = Unstable::StableVariant;
134133

135134
let x: usize = 0;
136-
x.unstable(); //~ ERROR use of unstable item
135+
x.unstable(); //~ WARNING use of unstable library feature
137136
x.stable();
138137
}
139138
}

src/test/compile-fail/lint-unknown-feature.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![deny(unknown_features)]
11+
#![deny(unused_features)]
1212

13-
#![feature(this_is_not_a_feature)] //~ ERROR: unknown feature
13+
#![feature(this_is_not_a_feature)] //~ ERROR: unused or unknown feature
1414

1515
fn main() {}

src/test/compile-fail/simd-experimental.rs

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)