Skip to content

Commit 90aa581

Browse files
committed
Remove unused stability levels from compiler
1 parent 6869645 commit 90aa581

File tree

5 files changed

+8
-32
lines changed

5 files changed

+8
-32
lines changed

src/librbml/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,10 @@ pub mod writer {
845845

846846
// Set to true to generate more debugging in EBML code.
847847
// Totally lame approach.
848+
#[cfg(not(ndebug))]
848849
static DEBUG: bool = true;
850+
#[cfg(ndebug)]
851+
static DEBUG: bool = false;
849852

850853
impl<'a, W: Writer + Seek> Encoder<'a, W> {
851854
// used internally to emit things like the vector length and so on

src/librustc/lint/builtin.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,9 +660,6 @@ impl LintPass for UnusedAttributes {
660660
// FIXME: #14407 these are only looked at on-demand so we can't
661661
// guarantee they'll have already been checked
662662
"deprecated",
663-
"experimental",
664-
"frozen",
665-
"locked",
666663
"must_use",
667664
"stable",
668665
"unstable",

src/librustdoc/html/format.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -765,9 +765,6 @@ impl fmt::String for ModuleSummary {
765765
try!(write!(f, "<span class='summary Unstable' \
766766
style='width: {:.4}%; display: inline-block'>&nbsp</span>",
767767
(100 * cnt.unstable) as f64/tot as f64));
768-
try!(write!(f, "<span class='summary Experimental' \
769-
style='width: {:.4}%; display: inline-block'>&nbsp</span>",
770-
(100 * cnt.experimental) as f64/tot as f64));
771768
try!(write!(f, "<span class='summary Deprecated' \
772769
style='width: {:.4}%; display: inline-block'>&nbsp</span>",
773770
(100 * cnt.deprecated) as f64/tot as f64));
@@ -786,12 +783,11 @@ impl fmt::String for ModuleSummary {
786783
let mut context = Vec::new();
787784

788785
let tot = self.counts.total();
789-
let (stable, unstable, experimental, deprecated, unmarked) = if tot == 0 {
790-
(0, 0, 0, 0, 0)
786+
let (stable, unstable, deprecated, unmarked) = if tot == 0 {
787+
(0, 0, 0, 0)
791788
} else {
792789
((100 * self.counts.stable)/tot,
793790
(100 * self.counts.unstable)/tot,
794-
(100 * self.counts.experimental)/tot,
795791
(100 * self.counts.deprecated)/tot,
796792
(100 * self.counts.unmarked)/tot)
797793
};
@@ -804,13 +800,12 @@ its children (percentages total for {name}):
804800
<blockquote>
805801
<a class='stability Stable'></a> stable ({}%),<br/>
806802
<a class='stability Unstable'></a> unstable ({}%),<br/>
807-
<a class='stability Experimental'></a> experimental ({}%),<br/>
808803
<a class='stability Deprecated'></a> deprecated ({}%),<br/>
809804
<a class='stability Unmarked'></a> unmarked ({}%)
810805
</blockquote>
811806
The counts do not include methods or trait
812807
implementations that are visible only through a re-exported type.",
813-
stable, unstable, experimental, deprecated, unmarked,
808+
stable, unstable, deprecated, unmarked,
814809
name=self.name));
815810
try!(write!(f, "<table>"));
816811
try!(fmt_inner(f, &mut context, self));

src/librustdoc/stability_summary.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use std::cmp::Ordering;
1717
use std::ops::Add;
1818

19-
use syntax::attr::{Deprecated, Experimental, Unstable, Stable, Frozen, Locked};
19+
use syntax::attr::{Deprecated, Unstable, Stable};
2020
use syntax::ast::Public;
2121

2222
use clean::{Crate, Item, ModuleItem, Module, EnumItem, Enum};
@@ -30,11 +30,8 @@ use html::render::cache;
3030
#[derive(Copy)]
3131
pub struct Counts {
3232
pub deprecated: uint,
33-
pub experimental: uint,
3433
pub unstable: uint,
3534
pub stable: uint,
36-
pub frozen: uint,
37-
pub locked: uint,
3835

3936
/// No stability level, inherited or otherwise.
4037
pub unmarked: uint,
@@ -46,11 +43,8 @@ impl Add for Counts {
4643
fn add(self, other: Counts) -> Counts {
4744
Counts {
4845
deprecated: self.deprecated + other.deprecated,
49-
experimental: self.experimental + other.experimental,
5046
unstable: self.unstable + other.unstable,
5147
stable: self.stable + other.stable,
52-
frozen: self.frozen + other.frozen,
53-
locked: self.locked + other.locked,
5448
unmarked: self.unmarked + other.unmarked,
5549
}
5650
}
@@ -60,18 +54,14 @@ impl Counts {
6054
fn zero() -> Counts {
6155
Counts {
6256
deprecated: 0,
63-
experimental: 0,
6457
unstable: 0,
6558
stable: 0,
66-
frozen: 0,
67-
locked: 0,
6859
unmarked: 0,
6960
}
7061
}
7162

7263
pub fn total(&self) -> uint {
73-
self.deprecated + self.experimental + self.unstable + self.stable +
74-
self.frozen + self.locked + self.unmarked
64+
self.deprecated + self.unstable + self.stable + self.unmarked
7565
}
7666
}
7767

@@ -109,11 +99,8 @@ fn count_stability(stab: Option<&Stability>) -> Counts {
10999
None => Counts { unmarked: 1, .. Counts::zero() },
110100
Some(ref stab) => match stab.level {
111101
Deprecated => Counts { deprecated: 1, .. Counts::zero() },
112-
Experimental => Counts { experimental: 1, .. Counts::zero() },
113102
Unstable => Counts { unstable: 1, .. Counts::zero() },
114103
Stable => Counts { stable: 1, .. Counts::zero() },
115-
Frozen => Counts { frozen: 1, .. Counts::zero() },
116-
Locked => Counts { locked: 1, .. Counts::zero() },
117104
}
118105
}
119106
}

src/libsyntax/attr.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,8 @@ pub struct Stability {
351351
#[derive(RustcEncodable,RustcDecodable,PartialEq,PartialOrd,Clone,Show,Copy)]
352352
pub enum StabilityLevel {
353353
Deprecated,
354-
Experimental,
355354
Unstable,
356355
Stable,
357-
Frozen,
358-
Locked
359356
}
360357

361358
impl fmt::String for StabilityLevel {
@@ -372,11 +369,8 @@ pub fn find_stability_generic<'a,
372369
for attr in attrs {
373370
let level = match attr.name().get() {
374371
"deprecated" => Deprecated,
375-
"experimental" => Experimental,
376372
"unstable" => Unstable,
377373
"stable" => Stable,
378-
"frozen" => Frozen,
379-
"locked" => Locked,
380374
_ => continue // not a stability level
381375
};
382376

0 commit comments

Comments
 (0)