Skip to content

Commit 9758c48

Browse files
committed
Deprecated attributes don't take 'feature' names and are paired with stable/unstable
Conflicts: src/libcore/atomic.rs src/libcore/finally.rs src/test/auxiliary/inherited_stability.rs src/test/auxiliary/lint_stability.rs
1 parent cd6d9ea commit 9758c48

File tree

39 files changed

+437
-169
lines changed

39 files changed

+437
-169
lines changed

src/etc/featureck.py

+6-27
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@
8484
level = "unstable"
8585
elif "[stable(" in line:
8686
level = "stable"
87-
elif "[deprecated(" in line:
88-
level = "deprecated"
8987
else:
9088
continue
9189

@@ -94,12 +92,12 @@
9492
# the same line, e.g.
9593
# `#[unstable(feature = "foo", since = "1.0.0")]`
9694

97-
p = re.compile('(unstable|stable|deprecated).*feature *= *"(\w*)"')
95+
p = re.compile('(unstable|stable).*feature *= *"(\w*)"')
9896
m = p.search(line)
9997
if not m is None:
10098
feature_name = m.group(2)
10199
since = None
102-
if "stable" in line or "deprecated" in line:
100+
if "stable" in line:
103101
pp = re.compile('since *= *"([\w\.]*)"')
104102
mm = pp.search(line)
105103
since = m.group(1)
@@ -135,7 +133,7 @@
135133
errors = True
136134

137135
# Merge data about both lists
138-
# name, lang, lib, status, stable since, partially deprecated
136+
# name, lang, lib, status, stable since
139137

140138
language_feature_stats = {}
141139

@@ -145,15 +143,13 @@
145143
lib = False
146144
status = "unstable"
147145
stable_since = None
148-
partially_deprecated = False
149146

150147
if f[2] == "Accepted":
151148
status = "stable"
152149
if status == "stable":
153150
stable_since = f[1]
154151

155-
language_feature_stats[name] = (name, lang, lib, status, stable_since, \
156-
partially_deprecated)
152+
language_feature_stats[name] = (name, lang, lib, status, stable_since)
157153

158154
lib_feature_stats = {}
159155

@@ -163,11 +159,9 @@
163159
lib = True
164160
status = "unstable"
165161
stable_since = None
166-
partially_deprecated = False
167162

168163
is_stable = lib_features_and_level.get((name, "stable")) is not None
169164
is_unstable = lib_features_and_level.get((name, "unstable")) is not None
170-
is_deprecated = lib_features_and_level.get((name, "deprecated")) is not None
171165

172166
if is_stable and is_unstable:
173167
print "error: feature '" + name + "' is both stable and unstable"
@@ -179,14 +173,8 @@
179173
elif is_unstable:
180174
status = "unstable"
181175
stable_since = lib_features_and_level[(name, "unstable")][0]
182-
elif is_deprecated:
183-
status = "deprecated"
184176

185-
if (is_stable or is_unstable) and is_deprecated:
186-
partially_deprecated = True
187-
188-
lib_feature_stats[name] = (name, lang, lib, status, stable_since, \
189-
partially_deprecated)
177+
lib_feature_stats[name] = (name, lang, lib, status, stable_since)
190178

191179
# Check for overlap in two sets
192180
merged_stats = { }
@@ -200,25 +188,18 @@
200188
lib_status = lib_feature_stats[name][3]
201189
lang_stable_since = lang_feature_stats[name][4]
202190
lib_stable_since = lib_feature_stats[name][4]
203-
lang_partially_deprecated = lang_feature_stats[name][5]
204-
lib_partially_deprecated = lib_feature_stats[name][5]
205191

206192
if lang_status != lib_status and lib_status != "deprecated":
207193
print "error: feature '" + name + "' has lang status " + lang_status + \
208194
" but lib status " + lib_status
209195
errors = True
210196

211-
partially_deprecated = lang_partially_deprecated or lib_partially_deprecated
212-
if lib_status == "deprecated" and lang_status != "deprecated":
213-
partially_deprecated = True
214-
215197
if lang_stable_since != lib_stable_since:
216198
print "error: feature '" + name + "' has lang stable since " + lang_stable_since + \
217199
" but lib stable since " + lib_stable_since
218200
errors = True
219201

220-
merged_stats[name] = (name, True, True, lang_status, lang_stable_since, \
221-
partially_deprecated)
202+
merged_stats[name] = (name, True, True, lang_status, lang_stable_since)
222203

223204
del language_feature_stats[name]
224205
del lib_feature_stats[name]
@@ -244,8 +225,6 @@
244225
"{: <8}".format(type_) + \
245226
"{: <12}".format(s[3]) + \
246227
"{: <8}".format(str(s[4]))
247-
if s[5]:
248-
line += "(partially deprecated)"
249228
lines += [line]
250229

251230
lines.sort()

src/libarena/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
#![allow(missing_docs)]
3838
#![feature(alloc)]
3939
#![feature(core)]
40+
#![cfg_attr(test, feature(test))]
41+
#![cfg_attr(test, feature(collections))]
4042

4143
extern crate alloc;
4244

src/libcollections/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#![feature(alloc)]
3434
#![feature(unicode)]
3535
#![feature(hash)]
36+
#![cfg_attr(test, feature(test))]
3637

3738
#[macro_use]
3839
extern crate core;

src/libcollections/slice.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,8 @@ pub trait SliceExt {
642642
fn binary_search(&self, x: &Self::Item) -> Result<uint, uint> where Self::Item: Ord;
643643

644644
/// Deprecated: use `binary_search` instead.
645-
#[deprecated(feature = "oldstuff", since = "1.0.0", reason = "use binary_search instead")]
645+
#[unstable(feature = "collections")]
646+
#[deprecated(since = "1.0.0", reason = "use binary_search instead")]
646647
fn binary_search_elem(&self, x: &Self::Item) -> Result<uint, uint> where Self::Item: Ord {
647648
self.binary_search(x)
648649
}

src/libcore/atomic.rs

+8-4
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,8 @@ pub fn fence(order: Ordering) {
10361036
}
10371037
}
10381038

1039-
#[deprecated(feature = "core", since = "1.0.0",
1039+
#[unstable(feature = "core")]
1040+
#[deprecated(since = "1.0.0",
10401041
reason = "renamed to AtomicIsize")]
10411042
#[allow(missing_docs)]
10421043
pub struct AtomicInt {
@@ -1045,7 +1046,8 @@ pub struct AtomicInt {
10451046

10461047
unsafe impl Sync for AtomicInt {}
10471048

1048-
#[deprecated(feature = "core", since = "1.0.0",
1049+
#[unstable(feature = "core")]
1050+
#[deprecated(since = "1.0.0",
10491051
reason = "renamed to AtomicUsize")]
10501052
#[allow(missing_docs)]
10511053
pub struct AtomicUint {
@@ -1054,12 +1056,14 @@ pub struct AtomicUint {
10541056

10551057
unsafe impl Sync for AtomicUint {}
10561058

1057-
#[deprecated(feature = "core", since = "1.0.0",
1059+
#[unstable(feature = "core")]
1060+
#[deprecated(since = "1.0.0",
10581061
reason = "use ATOMIC_ISIZE_INIT instead")]
10591062
#[allow(missing_docs, deprecated)]
10601063
pub const ATOMIC_INT_INIT: AtomicInt =
10611064
AtomicInt { v: UnsafeCell { value: 0 } };
1062-
#[deprecated(feature = "core", since = "1.0.0",
1065+
#[unstable(feature = "core")]
1066+
#[deprecated(since = "1.0.0",
10631067
reason = "use ATOMIC_USIZE_INIT instead")]
10641068
#[allow(missing_docs, deprecated)]
10651069
pub const ATOMIC_UINT_INIT: AtomicUint =

src/libcore/finally.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
//! })
3131
//! ```
3232
33-
#![deprecated(feature = "core", since = "1.0.0",
33+
#![unstable(feature = "core")]
34+
#![deprecated(since = "1.0.0",
3435
reason = "It is unclear if this module is more robust than implementing \
3536
Drop on a custom type, and this module is being removed with no \
3637
replacement. Use a custom Drop implementation to regain existing \

src/libcore/hash/sip.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ impl SipHasher {
112112
}
113113

114114
/// Returns the computed hash.
115-
#[deprecated(feature = "oldstuff", since = "1.0.0", reason = "renamed to finish")]
115+
#[unstable(feature = "hash")]
116+
#[deprecated(since = "1.0.0", reason = "renamed to finish")]
116117
pub fn result(&self) -> u64 { self.finish() }
117118
}
118119

src/libcore/num/f32.rs

+20-10
Original file line numberDiff line numberDiff line change
@@ -178,43 +178,53 @@ impl Float for f32 {
178178
}
179179

180180
#[inline]
181-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
181+
#[unstable(feature = "core")]
182+
#[deprecated(since = "1.0.0")]
182183
fn mantissa_digits(_: Option<f32>) -> uint { MANTISSA_DIGITS }
183184

184185
#[inline]
185-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
186+
#[unstable(feature = "core")]
187+
#[deprecated(since = "1.0.0")]
186188
fn digits(_: Option<f32>) -> uint { DIGITS }
187189

188190
#[inline]
189-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
191+
#[unstable(feature = "core")]
192+
#[deprecated(since = "1.0.0")]
190193
fn epsilon() -> f32 { EPSILON }
191194

192195
#[inline]
193-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
196+
#[unstable(feature = "core")]
197+
#[deprecated(since = "1.0.0")]
194198
fn min_exp(_: Option<f32>) -> int { MIN_EXP }
195199

196200
#[inline]
197-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
201+
#[unstable(feature = "core")]
202+
#[deprecated(since = "1.0.0")]
198203
fn max_exp(_: Option<f32>) -> int { MAX_EXP }
199204

200205
#[inline]
201-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
206+
#[unstable(feature = "core")]
207+
#[deprecated(since = "1.0.0")]
202208
fn min_10_exp(_: Option<f32>) -> int { MIN_10_EXP }
203209

204210
#[inline]
205-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
211+
#[unstable(feature = "core")]
212+
#[deprecated(since = "1.0.0")]
206213
fn max_10_exp(_: Option<f32>) -> int { MAX_10_EXP }
207214

208215
#[inline]
209-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
216+
#[unstable(feature = "core")]
217+
#[deprecated(since = "1.0.0")]
210218
fn min_value() -> f32 { MIN_VALUE }
211219

212220
#[inline]
213-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
221+
#[unstable(feature = "core")]
222+
#[deprecated(since = "1.0.0")]
214223
fn min_pos_value(_: Option<f32>) -> f32 { MIN_POS_VALUE }
215224

216225
#[inline]
217-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
226+
#[unstable(feature = "core")]
227+
#[deprecated(since = "1.0.0")]
218228
fn max_value() -> f32 { MAX_VALUE }
219229

220230
/// Returns the mantissa, exponent and sign as integers.

src/libcore/num/f64.rs

+20-10
Original file line numberDiff line numberDiff line change
@@ -185,43 +185,53 @@ impl Float for f64 {
185185
}
186186

187187
#[inline]
188-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
188+
#[unstable(feature = "core")]
189+
#[deprecated(since = "1.0.0")]
189190
fn mantissa_digits(_: Option<f64>) -> uint { MANTISSA_DIGITS }
190191

191192
#[inline]
192-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
193+
#[unstable(feature = "core")]
194+
#[deprecated(since = "1.0.0")]
193195
fn digits(_: Option<f64>) -> uint { DIGITS }
194196

195197
#[inline]
196-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
198+
#[unstable(feature = "core")]
199+
#[deprecated(since = "1.0.0")]
197200
fn epsilon() -> f64 { EPSILON }
198201

199202
#[inline]
200-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
203+
#[unstable(feature = "core")]
204+
#[deprecated(since = "1.0.0")]
201205
fn min_exp(_: Option<f64>) -> int { MIN_EXP }
202206

203207
#[inline]
204-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
208+
#[unstable(feature = "core")]
209+
#[deprecated(since = "1.0.0")]
205210
fn max_exp(_: Option<f64>) -> int { MAX_EXP }
206211

207212
#[inline]
208-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
213+
#[unstable(feature = "core")]
214+
#[deprecated(since = "1.0.0")]
209215
fn min_10_exp(_: Option<f64>) -> int { MIN_10_EXP }
210216

211217
#[inline]
212-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
218+
#[unstable(feature = "core")]
219+
#[deprecated(since = "1.0.0")]
213220
fn max_10_exp(_: Option<f64>) -> int { MAX_10_EXP }
214221

215222
#[inline]
216-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
223+
#[unstable(feature = "core")]
224+
#[deprecated(since = "1.0.0")]
217225
fn min_value() -> f64 { MIN_VALUE }
218226

219227
#[inline]
220-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
228+
#[unstable(feature = "core")]
229+
#[deprecated(since = "1.0.0")]
221230
fn min_pos_value(_: Option<f64>) -> f64 { MIN_POS_VALUE }
222231

223232
#[inline]
224-
#[deprecated(feature = "oldstuff", since = "1.0.0")]
233+
#[unstable(feature = "core")]
234+
#[deprecated(since = "1.0.0")]
225235
fn max_value() -> f64 { MAX_VALUE }
226236

227237
/// Returns the mantissa, exponent and sign as integers.

src/libcore/num/int.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
//! alpha cycle along with the development of clearer conventions
1515
//! around integer types.
1616
17-
#![deprecated(feature = "oldstuff", since = "1.0.0", reason = "replaced by isize")]
17+
#![unstable(feature = "core")]
18+
#![deprecated(since = "1.0.0", reason = "replaced by isize")]
1819

1920
#[cfg(target_pointer_width = "32")] int_module! { int, 32 }
2021
#[cfg(target_pointer_width = "64")] int_module! { int, 64 }

0 commit comments

Comments
 (0)