Skip to content

Commit f18282b

Browse files
committed
Stabilize debug builders
1 parent 314b1f1 commit f18282b

File tree

6 files changed

+22
-25
lines changed

6 files changed

+22
-25
lines changed

src/libcollections/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
#![feature(str_char)]
4141
#![feature(str_words)]
4242
#![feature(slice_patterns)]
43-
#![feature(debug_builders)]
4443
#![feature(utf8_error)]
4544
#![cfg_attr(test, feature(rand, rustc_private, test, hash, collections))]
4645
#![cfg_attr(test, allow(deprecated))] // rand

src/libcore/fmt/builders.rs

+16-11
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ impl<'a, 'b: 'a> fmt::Write for PadAdapter<'a, 'b> {
5454
///
5555
/// Constructed by the `Formatter::debug_struct` method.
5656
#[must_use]
57+
#[stable(feature = "debug_builders", since = "1.1.0")]
5758
pub struct DebugStruct<'a, 'b: 'a> {
5859
fmt: &'a mut fmt::Formatter<'b>,
5960
result: fmt::Result,
@@ -72,7 +73,7 @@ pub fn debug_struct_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>, name: &str)
7273

7374
impl<'a, 'b: 'a> DebugStruct<'a, 'b> {
7475
/// Adds a new field to the generated struct output.
75-
#[unstable(feature = "debug_builders", reason = "method was just created")]
76+
#[stable(feature = "debug_builders", since = "1.1.0")]
7677
pub fn field(mut self, name: &str, value: &fmt::Debug) -> DebugStruct<'a, 'b> {
7778
self.result = self.result.and_then(|_| {
7879
let prefix = if self.has_fields {
@@ -95,7 +96,7 @@ impl<'a, 'b: 'a> DebugStruct<'a, 'b> {
9596

9697
/// Consumes the `DebugStruct`, finishing output and returning any error
9798
/// encountered.
98-
#[unstable(feature = "debug_builders", reason = "method was just created")]
99+
#[stable(feature = "debug_builders", since = "1.1.0")]
99100
pub fn finish(mut self) -> fmt::Result {
100101
if self.has_fields {
101102
self.result = self.result.and_then(|_| {
@@ -118,6 +119,7 @@ impl<'a, 'b: 'a> DebugStruct<'a, 'b> {
118119
///
119120
/// Constructed by the `Formatter::debug_tuple` method.
120121
#[must_use]
122+
#[stable(feature = "debug_builders", since = "1.1.0")]
121123
pub struct DebugTuple<'a, 'b: 'a> {
122124
fmt: &'a mut fmt::Formatter<'b>,
123125
result: fmt::Result,
@@ -135,7 +137,7 @@ pub fn debug_tuple_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>, name: &str) -> D
135137

136138
impl<'a, 'b: 'a> DebugTuple<'a, 'b> {
137139
/// Adds a new field to the generated tuple struct output.
138-
#[unstable(feature = "debug_builders", reason = "method was just created")]
140+
#[stable(feature = "debug_builders", since = "1.1.0")]
139141
pub fn field(mut self, value: &fmt::Debug) -> DebugTuple<'a, 'b> {
140142
self.result = self.result.and_then(|_| {
141143
let (prefix, space) = if self.has_fields {
@@ -158,7 +160,7 @@ impl<'a, 'b: 'a> DebugTuple<'a, 'b> {
158160

159161
/// Consumes the `DebugTuple`, finishing output and returning any error
160162
/// encountered.
161-
#[unstable(feature = "debug_builders", reason = "method was just created")]
163+
#[stable(feature = "debug_builders", since = "1.1.0")]
162164
pub fn finish(mut self) -> fmt::Result {
163165
if self.has_fields {
164166
self.result = self.result.and_then(|_| {
@@ -199,7 +201,7 @@ impl<'a, 'b: 'a> DebugInner<'a, 'b> {
199201
self.has_fields = true;
200202
}
201203

202-
pub fn finish(&mut self) {
204+
fn finish(&mut self) {
203205
let prefix = if self.is_pretty() && self.has_fields { "\n" } else { "" };
204206
self.result = self.result.and_then(|_| self.fmt.write_str(prefix));
205207
}
@@ -213,6 +215,7 @@ impl<'a, 'b: 'a> DebugInner<'a, 'b> {
213215
///
214216
/// Constructed by the `Formatter::debug_set` method.
215217
#[must_use]
218+
#[stable(feature = "debug_builders", since = "1.1.0")]
216219
pub struct DebugSet<'a, 'b: 'a> {
217220
inner: DebugInner<'a, 'b>,
218221
}
@@ -230,15 +233,15 @@ pub fn debug_set_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugSet<'a, 'b
230233

231234
impl<'a, 'b: 'a> DebugSet<'a, 'b> {
232235
/// Adds a new entry to the set output.
233-
#[unstable(feature = "debug_builders", reason = "method was just created")]
236+
#[stable(feature = "debug_builders", since = "1.1.0")]
234237
pub fn entry(mut self, entry: &fmt::Debug) -> DebugSet<'a, 'b> {
235238
self.inner.entry(entry);
236239
self
237240
}
238241

239242
/// Consumes the `DebugSet`, finishing output and returning any error
240243
/// encountered.
241-
#[unstable(feature = "debug_builders", reason = "method was just created")]
244+
#[stable(feature = "debug_builders", since = "1.1.0")]
242245
pub fn finish(mut self) -> fmt::Result {
243246
self.inner.finish();
244247
self.inner.result.and_then(|_| self.inner.fmt.write_str("}"))
@@ -249,6 +252,7 @@ impl<'a, 'b: 'a> DebugSet<'a, 'b> {
249252
///
250253
/// Constructed by the `Formatter::debug_list` method.
251254
#[must_use]
255+
#[stable(feature = "debug_builders", since = "1.1.0")]
252256
pub struct DebugList<'a, 'b: 'a> {
253257
inner: DebugInner<'a, 'b>,
254258
}
@@ -266,15 +270,15 @@ pub fn debug_list_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugList<'a,
266270

267271
impl<'a, 'b: 'a> DebugList<'a, 'b> {
268272
/// Adds a new entry to the set output.
269-
#[unstable(feature = "debug_builders", reason = "method was just created")]
273+
#[stable(feature = "debug_builders", since = "1.1.0")]
270274
pub fn entry(mut self, entry: &fmt::Debug) -> DebugList<'a, 'b> {
271275
self.inner.entry(entry);
272276
self
273277
}
274278

275279
/// Consumes the `DebugSet`, finishing output and returning any error
276280
/// encountered.
277-
#[unstable(feature = "debug_builders", reason = "method was just created")]
281+
#[stable(feature = "debug_builders", since = "1.1.0")]
278282
pub fn finish(mut self) -> fmt::Result {
279283
self.inner.finish();
280284
self.inner.result.and_then(|_| self.inner.fmt.write_str("]"))
@@ -285,6 +289,7 @@ impl<'a, 'b: 'a> DebugList<'a, 'b> {
285289
///
286290
/// Constructed by the `Formatter::debug_map` method.
287291
#[must_use]
292+
#[stable(feature = "debug_builders", since = "1.1.0")]
288293
pub struct DebugMap<'a, 'b: 'a> {
289294
fmt: &'a mut fmt::Formatter<'b>,
290295
result: fmt::Result,
@@ -302,7 +307,7 @@ pub fn debug_map_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugMap<'a, 'b
302307

303308
impl<'a, 'b: 'a> DebugMap<'a, 'b> {
304309
/// Adds a new entry to the map output.
305-
#[unstable(feature = "debug_builders", reason = "method was just created")]
310+
#[stable(feature = "debug_builders", since = "1.1.0")]
306311
pub fn entry(mut self, key: &fmt::Debug, value: &fmt::Debug) -> DebugMap<'a, 'b> {
307312
self.result = self.result.and_then(|_| {
308313
if self.is_pretty() {
@@ -321,7 +326,7 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
321326

322327
/// Consumes the `DebugMap`, finishing output and returning any error
323328
/// encountered.
324-
#[unstable(feature = "debug_builders", reason = "method was just created")]
329+
#[stable(feature = "debug_builders", since = "1.1.0")]
325330
pub fn finish(self) -> fmt::Result {
326331
let prefix = if self.is_pretty() && self.has_fields { "\n" } else { "" };
327332
self.result.and_then(|_| write!(self.fmt, "{}}}", prefix))

src/libcore/fmt/mod.rs

+5-10
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,6 @@ impl<'a> Formatter<'a> {
649649
/// # Examples
650650
///
651651
/// ```rust
652-
/// # #![feature(debug_builders, core)]
653652
/// use std::fmt;
654653
///
655654
/// struct Foo {
@@ -669,7 +668,7 @@ impl<'a> Formatter<'a> {
669668
/// // prints "Foo { bar: 10, baz: "Hello World" }"
670669
/// println!("{:?}", Foo { bar: 10, baz: "Hello World".to_string() });
671670
/// ```
672-
#[unstable(feature = "debug_builders", reason = "method was just created")]
671+
#[stable(feature = "debug_builders", since = "1.1.0")]
673672
#[inline]
674673
pub fn debug_struct<'b>(&'b mut self, name: &str) -> DebugStruct<'b, 'a> {
675674
builders::debug_struct_new(self, name)
@@ -681,7 +680,6 @@ impl<'a> Formatter<'a> {
681680
/// # Examples
682681
///
683682
/// ```rust
684-
/// # #![feature(debug_builders, core)]
685683
/// use std::fmt;
686684
///
687685
/// struct Foo(i32, String);
@@ -698,7 +696,7 @@ impl<'a> Formatter<'a> {
698696
/// // prints "Foo(10, "Hello World")"
699697
/// println!("{:?}", Foo(10, "Hello World".to_string()));
700698
/// ```
701-
#[unstable(feature = "debug_builders", reason = "method was just created")]
699+
#[stable(feature = "debug_builders", since = "1.1.0")]
702700
#[inline]
703701
pub fn debug_tuple<'b>(&'b mut self, name: &str) -> DebugTuple<'b, 'a> {
704702
builders::debug_tuple_new(self, name)
@@ -710,7 +708,6 @@ impl<'a> Formatter<'a> {
710708
/// # Examples
711709
///
712710
/// ```rust
713-
/// # #![feature(debug_builders, core)]
714711
/// use std::fmt;
715712
///
716713
/// struct Foo(Vec<i32>);
@@ -724,7 +721,7 @@ impl<'a> Formatter<'a> {
724721
/// // prints "[10, 11]"
725722
/// println!("{:?}", Foo(vec![10, 11]));
726723
/// ```
727-
#[unstable(feature = "debug_builders", reason = "method was just created")]
724+
#[stable(feature = "debug_builders", since = "1.1.0")]
728725
#[inline]
729726
pub fn debug_list<'b>(&'b mut self) -> DebugList<'b, 'a> {
730727
builders::debug_list_new(self)
@@ -736,7 +733,6 @@ impl<'a> Formatter<'a> {
736733
/// # Examples
737734
///
738735
/// ```rust
739-
/// # #![feature(debug_builders, core)]
740736
/// use std::fmt;
741737
///
742738
/// struct Foo(Vec<i32>);
@@ -750,7 +746,7 @@ impl<'a> Formatter<'a> {
750746
/// // prints "{10, 11}"
751747
/// println!("{:?}", Foo(vec![10, 11]));
752748
/// ```
753-
#[unstable(feature = "debug_builders", reason = "method was just created")]
749+
#[stable(feature = "debug_builders", since = "1.1.0")]
754750
#[inline]
755751
pub fn debug_set<'b>(&'b mut self) -> DebugSet<'b, 'a> {
756752
builders::debug_set_new(self)
@@ -762,7 +758,6 @@ impl<'a> Formatter<'a> {
762758
/// # Examples
763759
///
764760
/// ```rust
765-
/// # #![feature(debug_builders, core)]
766761
/// use std::fmt;
767762
///
768763
/// struct Foo(Vec<(String, i32)>);
@@ -776,7 +771,7 @@ impl<'a> Formatter<'a> {
776771
/// // prints "{"A": 10, "B": 11}"
777772
/// println!("{:?}", Foo(vec![("A".to_string(), 10), ("B".to_string(), 11)]));
778773
/// ```
779-
#[unstable(feature = "debug_builders", reason = "method was just created")]
774+
#[stable(feature = "debug_builders", since = "1.1.0")]
780775
#[inline]
781776
pub fn debug_map<'b>(&'b mut self) -> DebugMap<'b, 'a> {
782777
builders::debug_map_new(self)

src/libcoretest/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#![feature(std_misc)]
2222
#![feature(libc)]
2323
#![feature(hash)]
24-
#![feature(debug_builders)]
2524
#![feature(unique)]
2625
#![feature(step_by)]
2726
#![feature(slice_patterns)]

src/libstd/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@
127127
#![feature(into_cow)]
128128
#![feature(std_misc)]
129129
#![feature(slice_patterns)]
130-
#![feature(debug_builders)]
131130
#![feature(zero_one)]
132131
#![cfg_attr(test, feature(float_from_str_radix))]
133132
#![cfg_attr(test, feature(test, rustc_private, std_misc))]

src/test/run-pass/deriving-associated-types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(core, debug_builders)]
11+
#![feature(core)]
1212

1313
pub trait DeclaredTrait {
1414
type Type;

0 commit comments

Comments
 (0)