Skip to content

Commit 676ffbb

Browse files
author
Oliver Schneider
committed
---
yaml --- r: 208885 b: refs/heads/master c: 0c74a73 h: refs/heads/master i: 208883: 82356ab v: v3
1 parent 49be43c commit 676ffbb

File tree

20 files changed

+178
-57
lines changed

20 files changed

+178
-57
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 65ead717a7719f0d0b761794500e5e8d3ebbcb65
2+
refs/heads/master: 0c74a73bd588c0a496b20f751a3b36f34210c69d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
55
refs/heads/try: 7b4ef47b7805a402d756fb8157101f64880a522f

trunk/mk/dist.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ dist-install-dir-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
123123
dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
124124
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
125125
dist-install-dir-$(1): PREPARE_CLEAN=true
126-
dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
126+
dist-install-dir-$(1): prepare-base-dir-$(1) docs
127127
$$(Q)mkdir -p $$(PREPARE_DEST_DIR)/share/doc/rust
128128
$$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR)/share/doc/rust
129129
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)/share/doc/rust
@@ -163,7 +163,7 @@ endif
163163
--legacy-manifest-dirs=rustlib,cargo
164164
$$(Q)rm -R tmp/dist/$$(PKG_NAME)-$(1)-image
165165

166-
dist-doc-install-dir-$(1): docs compiler-docs
166+
dist-doc-install-dir-$(1): docs
167167
$$(Q)mkdir -p tmp/dist/$$(DOC_PKG_NAME)-$(1)-image/share/doc/rust
168168
$$(Q)cp -r doc tmp/dist/$$(DOC_PKG_NAME)-$(1)-image/share/doc/rust/html
169169

@@ -251,7 +251,7 @@ distcheck-tar-bins: dist-tar-bins
251251

252252
# Just copy the docs to a folder under dist with the appropriate name
253253
# for uploading to S3
254-
dist-docs: docs compiler-docs
254+
dist-docs: docs
255255
$(Q) rm -Rf dist/doc
256256
$(Q) mkdir -p dist/doc/
257257
$(Q) cp -r doc dist/doc/$(CFG_PACKAGE_VERS)

trunk/mk/docs.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ ERR_IDX_GEN = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(ERR_IDX_GEN_EXE)
7777

7878
D := $(S)src/doc
7979

80-
DOC_TARGETS := trpl style error-index
80+
# FIXME (#25705) eventually may want to put error-index target back here.
81+
DOC_TARGETS := trpl style
8182
COMPILER_DOC_TARGETS :=
8283
DOC_L10N_TARGETS :=
8384

trunk/src/doc/reference.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3622,6 +3622,14 @@ The `Sized` trait indicates that the size of this type is known at compile-time.
36223622
The `Drop` trait provides a destructor, to be run whenever a value of this type
36233623
is to be destroyed.
36243624

3625+
## The `Deref` trait
3626+
3627+
The `Deref<Target = U>` trait allows a type to implicitly implement all the methods
3628+
of the type `U`. When attempting to resolve a method call, the compiler will search
3629+
the top-level type for the implementation of the called method. If no such method is
3630+
found, `.deref()` is called and the compiler continues to search for the method
3631+
implementation in the returned type `U`.
3632+
36253633
# Memory model
36263634

36273635
A Rust program's memory consists of a static set of *items* and a *heap*.

trunk/src/doc/trpl/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,8 @@ of those times. As the error explains, while we made our binding mutable, we
150150
still cannot call `push`. This is because we already have a reference to an
151151
element of the vector, `y`. Mutating something while another reference exists
152152
is dangerous, because we may invalidate the reference. In this specific case,
153-
when we create the vector, we may have only allocated space for three elements.
154-
Adding a fourth would mean allocating a new chunk of memory for all those elements,
153+
when we create the vector, we may have only allocated space for two elements.
154+
Adding a third would mean allocating a new chunk of memory for all those elements,
155155
copying the old values over, and updating the internal pointer to that memory.
156156
That all works just fine. The problem is that `y` wouldn’t get updated, and so
157157
we’d have a ‘dangling pointer’. That’s bad. Any use of `y` would be an error in

trunk/src/doc/trpl/guessing-game.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ a few tricks up their sleeves.
148148
For example, they’re [immutable][immutable] by default. That’s why our example
149149
uses `mut`: it makes a binding mutable, rather than immutable. `let` doesn’t
150150
take a name on the left hand side, it actually accepts a
151-
[pattern][patterns]’. We’ll use patterns more later. It’s easy enough
151+
[pattern][patterns]’. We’ll use patterns later. It’s easy enough
152152
to use for now:
153153

154154
```rust

trunk/src/doc/trpl/the-stack-and-the-heap.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,9 +277,9 @@ allocated on the heap:
277277
| 0 | x | ?????? |
278278

279279
[drop]: drop.html
280-
[moving]: We can make the memory live longer by transferring ownership,
281-
sometimes called ‘moving out of the box’. More complex examples will
282-
be covered later.
280+
[^moving]: We can make the memory live longer by transferring ownership,
281+
sometimes called ‘moving out of the box’. More complex examples will
282+
be covered later.
283283

284284

285285
And then the stack frame goes away, freeing all of our memory.

trunk/src/libcollections/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
#![feature(str_char)]
4040
#![feature(str_words)]
4141
#![feature(slice_patterns)]
42-
#![feature(debug_builders)]
4342
#![feature(utf8_error)]
4443
#![cfg_attr(test, feature(rand, rustc_private, test, hash, collections,
4544
collections_drain, collections_range))]

trunk/src/libcore/fmt/builders.rs

Lines changed: 18 additions & 13 deletions
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.2.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.2.0")]
7677
pub fn field(&mut self, name: &str, value: &fmt::Debug) -> &mut DebugStruct<'a, 'b> {
7778
self.result = self.result.and_then(|_| {
7879
let prefix = if self.has_fields {
@@ -94,7 +95,7 @@ impl<'a, 'b: 'a> DebugStruct<'a, 'b> {
9495
}
9596

9697
/// Finishes output and returns any error encountered.
97-
#[unstable(feature = "debug_builders", reason = "method was just created")]
98+
#[stable(feature = "debug_builders", since = "1.2.0")]
9899
pub fn finish(&mut self) -> fmt::Result {
99100
if self.has_fields {
100101
self.result = self.result.and_then(|_| {
@@ -117,6 +118,7 @@ impl<'a, 'b: 'a> DebugStruct<'a, 'b> {
117118
///
118119
/// Constructed by the `Formatter::debug_tuple` method.
119120
#[must_use]
121+
#[stable(feature = "debug_builders", since = "1.2.0")]
120122
pub struct DebugTuple<'a, 'b: 'a> {
121123
fmt: &'a mut fmt::Formatter<'b>,
122124
result: fmt::Result,
@@ -134,7 +136,7 @@ pub fn debug_tuple_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>, name: &str) -> D
134136

135137
impl<'a, 'b: 'a> DebugTuple<'a, 'b> {
136138
/// Adds a new field to the generated tuple struct output.
137-
#[unstable(feature = "debug_builders", reason = "method was just created")]
139+
#[stable(feature = "debug_builders", since = "1.2.0")]
138140
pub fn field(&mut self, value: &fmt::Debug) -> &mut DebugTuple<'a, 'b> {
139141
self.result = self.result.and_then(|_| {
140142
let (prefix, space) = if self.has_fields {
@@ -156,7 +158,7 @@ impl<'a, 'b: 'a> DebugTuple<'a, 'b> {
156158
}
157159

158160
/// Finishes output and returns any error encountered.
159-
#[unstable(feature = "debug_builders", reason = "method was just created")]
161+
#[stable(feature = "debug_builders", since = "1.2.0")]
160162
pub fn finish(&mut self) -> fmt::Result {
161163
if self.has_fields {
162164
self.result = self.result.and_then(|_| {
@@ -211,6 +213,7 @@ impl<'a, 'b: 'a> DebugInner<'a, 'b> {
211213
///
212214
/// Constructed by the `Formatter::debug_set` method.
213215
#[must_use]
216+
#[stable(feature = "debug_builders", since = "1.2.0")]
214217
pub struct DebugSet<'a, 'b: 'a> {
215218
inner: DebugInner<'a, 'b>,
216219
}
@@ -228,14 +231,14 @@ pub fn debug_set_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugSet<'a, 'b
228231

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

237240
/// Adds the contents of an iterator of entries to the set output.
238-
#[unstable(feature = "debug_builders", reason = "method was just created")]
241+
#[stable(feature = "debug_builders", since = "1.2.0")]
239242
pub fn entries<D, I>(&mut self, entries: I) -> &mut DebugSet<'a, 'b>
240243
where D: fmt::Debug, I: IntoIterator<Item=D> {
241244
for entry in entries {
@@ -245,7 +248,7 @@ impl<'a, 'b: 'a> DebugSet<'a, 'b> {
245248
}
246249

247250
/// Finishes output and returns any error encountered.
248-
#[unstable(feature = "debug_builders", reason = "method was just created")]
251+
#[stable(feature = "debug_builders", since = "1.2.0")]
249252
pub fn finish(&mut self) -> fmt::Result {
250253
self.inner.finish();
251254
self.inner.result.and_then(|_| self.inner.fmt.write_str("}"))
@@ -256,6 +259,7 @@ impl<'a, 'b: 'a> DebugSet<'a, 'b> {
256259
///
257260
/// Constructed by the `Formatter::debug_list` method.
258261
#[must_use]
262+
#[stable(feature = "debug_builders", since = "1.2.0")]
259263
pub struct DebugList<'a, 'b: 'a> {
260264
inner: DebugInner<'a, 'b>,
261265
}
@@ -273,14 +277,14 @@ pub fn debug_list_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugList<'a,
273277

274278
impl<'a, 'b: 'a> DebugList<'a, 'b> {
275279
/// Adds a new entry to the list output.
276-
#[unstable(feature = "debug_builders", reason = "method was just created")]
280+
#[stable(feature = "debug_builders", since = "1.2.0")]
277281
pub fn entry(&mut self, entry: &fmt::Debug) -> &mut DebugList<'a, 'b> {
278282
self.inner.entry(entry);
279283
self
280284
}
281285

282286
/// Adds the contents of an iterator of entries to the list output.
283-
#[unstable(feature = "debug_builders", reason = "method was just created")]
287+
#[stable(feature = "debug_builders", since = "1.2.0")]
284288
pub fn entries<D, I>(&mut self, entries: I) -> &mut DebugList<'a, 'b>
285289
where D: fmt::Debug, I: IntoIterator<Item=D> {
286290
for entry in entries {
@@ -290,7 +294,7 @@ impl<'a, 'b: 'a> DebugList<'a, 'b> {
290294
}
291295

292296
/// Finishes output and returns any error encountered.
293-
#[unstable(feature = "debug_builders", reason = "method was just created")]
297+
#[stable(feature = "debug_builders", since = "1.2.0")]
294298
pub fn finish(&mut self) -> fmt::Result {
295299
self.inner.finish();
296300
self.inner.result.and_then(|_| self.inner.fmt.write_str("]"))
@@ -301,6 +305,7 @@ impl<'a, 'b: 'a> DebugList<'a, 'b> {
301305
///
302306
/// Constructed by the `Formatter::debug_map` method.
303307
#[must_use]
308+
#[stable(feature = "debug_builders", since = "1.2.0")]
304309
pub struct DebugMap<'a, 'b: 'a> {
305310
fmt: &'a mut fmt::Formatter<'b>,
306311
result: fmt::Result,
@@ -318,7 +323,7 @@ pub fn debug_map_new<'a, 'b>(fmt: &'a mut fmt::Formatter<'b>) -> DebugMap<'a, 'b
318323

319324
impl<'a, 'b: 'a> DebugMap<'a, 'b> {
320325
/// Adds a new entry to the map output.
321-
#[unstable(feature = "debug_builders", reason = "method was just created")]
326+
#[stable(feature = "debug_builders", since = "1.2.0")]
322327
pub fn entry(&mut self, key: &fmt::Debug, value: &fmt::Debug) -> &mut DebugMap<'a, 'b> {
323328
self.result = self.result.and_then(|_| {
324329
if self.is_pretty() {
@@ -336,7 +341,7 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
336341
}
337342

338343
/// Adds the contents of an iterator of entries to the map output.
339-
#[unstable(feature = "debug_builders", reason = "method was just created")]
344+
#[stable(feature = "debug_builders", since = "1.2.0")]
340345
pub fn entries<K, V, I>(&mut self, entries: I) -> &mut DebugMap<'a, 'b>
341346
where K: fmt::Debug, V: fmt::Debug, I: IntoIterator<Item=(K, V)> {
342347
for (k, v) in entries {
@@ -346,7 +351,7 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
346351
}
347352

348353
/// Finishes output and returns any error encountered.
349-
#[unstable(feature = "debug_builders", reason = "method was just created")]
354+
#[stable(feature = "debug_builders", since = "1.2.0")]
350355
pub fn finish(&mut self) -> fmt::Result {
351356
let prefix = if self.is_pretty() && self.has_fields { "\n" } else { "" };
352357
self.result.and_then(|_| write!(self.fmt, "{}}}", prefix))

trunk/src/libcore/fmt/mod.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,6 @@ impl<'a> Formatter<'a> {
719719
/// # Examples
720720
///
721721
/// ```rust
722-
/// # #![feature(debug_builders, core)]
723722
/// use std::fmt;
724723
///
725724
/// struct Foo {
@@ -739,7 +738,7 @@ impl<'a> Formatter<'a> {
739738
/// // prints "Foo { bar: 10, baz: "Hello World" }"
740739
/// println!("{:?}", Foo { bar: 10, baz: "Hello World".to_string() });
741740
/// ```
742-
#[unstable(feature = "debug_builders", reason = "method was just created")]
741+
#[stable(feature = "debug_builders", since = "1.2.0")]
743742
#[inline]
744743
pub fn debug_struct<'b>(&'b mut self, name: &str) -> DebugStruct<'b, 'a> {
745744
builders::debug_struct_new(self, name)
@@ -751,7 +750,6 @@ impl<'a> Formatter<'a> {
751750
/// # Examples
752751
///
753752
/// ```rust
754-
/// # #![feature(debug_builders, core)]
755753
/// use std::fmt;
756754
///
757755
/// struct Foo(i32, String);
@@ -768,7 +766,7 @@ impl<'a> Formatter<'a> {
768766
/// // prints "Foo(10, "Hello World")"
769767
/// println!("{:?}", Foo(10, "Hello World".to_string()));
770768
/// ```
771-
#[unstable(feature = "debug_builders", reason = "method was just created")]
769+
#[stable(feature = "debug_builders", since = "1.2.0")]
772770
#[inline]
773771
pub fn debug_tuple<'b>(&'b mut self, name: &str) -> DebugTuple<'b, 'a> {
774772
builders::debug_tuple_new(self, name)
@@ -780,7 +778,6 @@ impl<'a> Formatter<'a> {
780778
/// # Examples
781779
///
782780
/// ```rust
783-
/// # #![feature(debug_builders, core)]
784781
/// use std::fmt;
785782
///
786783
/// struct Foo(Vec<i32>);
@@ -794,7 +791,7 @@ impl<'a> Formatter<'a> {
794791
/// // prints "[10, 11]"
795792
/// println!("{:?}", Foo(vec![10, 11]));
796793
/// ```
797-
#[unstable(feature = "debug_builders", reason = "method was just created")]
794+
#[stable(feature = "debug_builders", since = "1.2.0")]
798795
#[inline]
799796
pub fn debug_list<'b>(&'b mut self) -> DebugList<'b, 'a> {
800797
builders::debug_list_new(self)
@@ -806,7 +803,6 @@ impl<'a> Formatter<'a> {
806803
/// # Examples
807804
///
808805
/// ```rust
809-
/// # #![feature(debug_builders, core)]
810806
/// use std::fmt;
811807
///
812808
/// struct Foo(Vec<i32>);
@@ -820,7 +816,7 @@ impl<'a> Formatter<'a> {
820816
/// // prints "{10, 11}"
821817
/// println!("{:?}", Foo(vec![10, 11]));
822818
/// ```
823-
#[unstable(feature = "debug_builders", reason = "method was just created")]
819+
#[stable(feature = "debug_builders", since = "1.2.0")]
824820
#[inline]
825821
pub fn debug_set<'b>(&'b mut self) -> DebugSet<'b, 'a> {
826822
builders::debug_set_new(self)
@@ -832,7 +828,6 @@ impl<'a> Formatter<'a> {
832828
/// # Examples
833829
///
834830
/// ```rust
835-
/// # #![feature(debug_builders, core)]
836831
/// use std::fmt;
837832
///
838833
/// struct Foo(Vec<(String, i32)>);
@@ -846,7 +841,7 @@ impl<'a> Formatter<'a> {
846841
/// // prints "{"A": 10, "B": 11}"
847842
/// println!("{:?}", Foo(vec![("A".to_string(), 10), ("B".to_string(), 11)]));
848843
/// ```
849-
#[unstable(feature = "debug_builders", reason = "method was just created")]
844+
#[stable(feature = "debug_builders", since = "1.2.0")]
850845
#[inline]
851846
pub fn debug_map<'b>(&'b mut self) -> DebugMap<'b, 'a> {
852847
builders::debug_map_new(self)

trunk/src/libcoretest/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#![feature(std_misc)]
2121
#![feature(libc)]
2222
#![feature(hash)]
23-
#![feature(debug_builders)]
2423
#![feature(unique)]
2524
#![feature(step_by)]
2625
#![feature(slice_patterns)]

trunk/src/librustc_trans/trans/callee.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ pub fn trans_call_inner<'a, 'blk, 'tcx, F>(bcx: Block<'blk, 'tcx>,
846846

847847
let mut llargs = Vec::new();
848848
let arg_tys = match args {
849-
ArgExprs(a) => a.iter().map(|x| common::expr_ty(bcx, &**x)).collect(),
849+
ArgExprs(a) => a.iter().map(|x| common::expr_ty_adjusted(bcx, &**x)).collect(),
850850
_ => panic!("expected arg exprs.")
851851
};
852852
bcx = trans_args(bcx,

0 commit comments

Comments
 (0)