Skip to content

Commit 4cf8d8c

Browse files
committed
auto merge of #13326 : alexcrichton/rust/rollup, r=alexcrichton
Closes #13313 (Fix typo in README.md) Closes #13311 (Fix inner attribute syntax from `#[foo];` to `#![foo]`) Closes #13309 (Add stdlib docs to the Linux binary tarball.) Closes #13308 (syntax: remove obsolete mutability from ExprVec and ExprRepeat.) Closes #13306 (TrieSet should impl Set/MutableSet; add with_capacity to PriorityQueue/SmallIntMap) Closes #13303 (Register new snapshots) Closes #13274 (Added grow_fn and retain to Vec) *Issues Closed* Closes #13249
2 parents e5f1b9f + 6d43138 commit 4cf8d8c

File tree

95 files changed

+259
-196
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+259
-196
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ documentation.
55

66
## Quick Start
77

8-
1. Download a [binary insaller][installer] for your platform.
8+
1. Download a [binary installer][installer] for your platform.
99
2. Read the [tutorial].
1010
3. Enjoy!
1111

mk/dist.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ dist-install-dir-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
215215
dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
216216
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
217217
dist-install-dir-$(1): PREPARE_CLEAN=true
218-
dist-install-dir-$(1): prepare-base-dir-$(1)
218+
dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
219219
$$(Q)(cd $$(PREPARE_DEST_DIR)/ && find . -type f | sed 's/^\.\///') \
220220
> tmp/dist/manifest-$(1).in
221221
$$(Q)mv tmp/dist/manifest-$(1).in $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest.in
@@ -224,6 +224,7 @@ dist-install-dir-$(1): prepare-base-dir-$(1)
224224
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)
225225
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)
226226
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)
227+
$$(Q)cp -r doc $$(PREPARE_DEST_DIR)
227228
$$(Q)$$(PREPARE_BIN_CMD) $$(S)src/etc/install.sh $$(PREPARE_DEST_DIR)
228229

229230
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)

src/doc/guide-unsafe.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ asm!(assembly template
294294
);
295295
```
296296

297-
Any use of `asm` is feature gated (requires `#[feature(asm)];` on the
297+
Any use of `asm` is feature gated (requires `#![feature(asm)]` on the
298298
crate to allow) and of course requires an `unsafe` block.
299299

300300
> **Note**: the examples here are given in x86/x86-64 assembly, but all
@@ -306,7 +306,7 @@ The `assembly template` is the only required parameter and must be a
306306
literal string (i.e `""`)
307307

308308
```
309-
#[feature(asm)];
309+
#![feature(asm)]
310310
311311
#[cfg(target_arch = "x86")]
312312
#[cfg(target_arch = "x86_64")]
@@ -334,7 +334,7 @@ Output operands, input operands, clobbers and options are all optional
334334
but you must add the right number of `:` if you skip them:
335335

336336
```
337-
# #[feature(asm)];
337+
# #![feature(asm)]
338338
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
339339
# fn main() { unsafe {
340340
asm!("xor %eax, %eax"
@@ -348,7 +348,7 @@ asm!("xor %eax, %eax"
348348
Whitespace also doesn't matter:
349349

350350
```
351-
# #[feature(asm)];
351+
# #![feature(asm)]
352352
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
353353
# fn main() { unsafe {
354354
asm!("xor %eax, %eax" ::: "eax");
@@ -362,7 +362,7 @@ Input and output operands follow the same format: `:
362362
expressions must be mutable lvalues:
363363

364364
```
365-
# #[feature(asm)];
365+
# #![feature(asm)]
366366
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
367367
fn add(a: int, b: int) -> int {
368368
let mut c = 0;
@@ -390,7 +390,7 @@ compiler not to assume any values loaded into those registers will
390390
stay valid.
391391

392392
```
393-
# #[feature(asm)];
393+
# #![feature(asm)]
394394
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
395395
# fn main() { unsafe {
396396
// Put the value 0x200 in eax

src/doc/po/ja/rust.md.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Japanese translations for Rust package
2-
# Copyright (C) 2013 The Rust Project Developers
2+
# Copyright (C) 2013-2014 The Rust Project Developers
33
# This file is distributed under the same license as the Rust package.
44
# Automatically generated, 2013.
55
#
@@ -886,7 +886,7 @@ msgstr ""
886886
#: src/doc/rust.md:2008
887887
#, fuzzy
888888
#| msgid "~~~~ use std::task::spawn;"
889-
msgid "~~~~ {.ignore} #[warn(unstable)];"
889+
msgid "~~~~ {.ignore} #![warn(unstable)]"
890890
msgstr ""
891891
"~~~~\n"
892892
"use std::task::spawn;"

src/etc/combine-tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def scrub(b):
5454
#[crate_id=\"run_pass_stage2#0.1\"];
5555
#[crate_id=\"run_pass_stage2#0.1\"];
5656
#[feature(globs, macro_rules, struct_variant, managed_boxes)];
57-
#[allow(warnings)];
57+
#![allow(warnings)]
5858
extern crate collections;
5959
"""
6060
)

src/libarena/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2424
html_root_url = "http://static.rust-lang.org/doc/master")]
2525
#![allow(missing_doc)]
26-
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
2726

2827
extern crate collections;
2928

src/libcollections/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
#![feature(macro_rules, managed_boxes, default_type_params, phase)]
2424

25-
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
26-
2725
extern crate rand;
2826

2927
#[cfg(test)] extern crate test;

src/libcollections/priority_queue.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ impl<T:Ord> PriorityQueue<T> {
117117
/// Create an empty PriorityQueue
118118
pub fn new() -> PriorityQueue<T> { PriorityQueue{data: ~[],} }
119119

120+
/// Create an empty PriorityQueue with capacity `capacity`
121+
pub fn with_capacity(capacity: uint) -> PriorityQueue<T> {
122+
PriorityQueue { data: slice::with_capacity(capacity) }
123+
}
124+
120125
/// Create a PriorityQueue from a vector (heapify)
121126
pub fn from_vec(xs: ~[T]) -> PriorityQueue<T> {
122127
let mut q = PriorityQueue{data: xs,};

src/libcollections/smallintmap.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ impl<V> SmallIntMap<V> {
112112
/// Create an empty SmallIntMap
113113
pub fn new() -> SmallIntMap<V> { SmallIntMap{v: ~[]} }
114114

115+
/// Create an empty SmallIntMap with capacity `capacity`
116+
pub fn with_capacity(capacity: uint) -> SmallIntMap<V> {
117+
SmallIntMap { v: slice::with_capacity(capacity) }
118+
}
119+
115120
pub fn get<'a>(&'a self, key: &uint) -> &'a V {
116121
self.find(key).expect("key not present")
117122
}

src/libcollections/trie.rs

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -293,32 +293,46 @@ impl Mutable for TrieSet {
293293
fn clear(&mut self) { self.map.clear() }
294294
}
295295

296-
impl TrieSet {
297-
/// Create an empty TrieSet
296+
impl Set<uint> for TrieSet {
298297
#[inline]
299-
pub fn new() -> TrieSet {
300-
TrieSet{map: TrieMap::new()}
298+
fn contains(&self, value: &uint) -> bool {
299+
self.map.contains_key(value)
301300
}
302301

303-
/// Return true if the set contains a value
304302
#[inline]
305-
pub fn contains(&self, value: &uint) -> bool {
306-
self.map.contains_key(value)
303+
fn is_disjoint(&self, other: &TrieSet) -> bool {
304+
self.iter().all(|v| !other.contains(&v))
307305
}
308306

309-
/// Add a value to the set. Return true if the value was not already
310-
/// present in the set.
311307
#[inline]
312-
pub fn insert(&mut self, value: uint) -> bool {
308+
fn is_subset(&self, other: &TrieSet) -> bool {
309+
self.iter().all(|v| other.contains(&v))
310+
}
311+
312+
#[inline]
313+
fn is_superset(&self, other: &TrieSet) -> bool {
314+
other.is_subset(self)
315+
}
316+
}
317+
318+
impl MutableSet<uint> for TrieSet {
319+
#[inline]
320+
fn insert(&mut self, value: uint) -> bool {
313321
self.map.insert(value, ())
314322
}
315323

316-
/// Remove a value from the set. Return true if the value was
317-
/// present in the set.
318324
#[inline]
319-
pub fn remove(&mut self, value: &uint) -> bool {
325+
fn remove(&mut self, value: &uint) -> bool {
320326
self.map.remove(value)
321327
}
328+
}
329+
330+
impl TrieSet {
331+
/// Create an empty TrieSet
332+
#[inline]
333+
pub fn new() -> TrieSet {
334+
TrieSet{map: TrieMap::new()}
335+
}
322336

323337
/// Visit all values in reverse order
324338
#[inline]

0 commit comments

Comments
 (0)