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

+1-1
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

+2-1
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

+6-6
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

+2-2
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

+1-1
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

-1
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

-2
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

+5
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

+5
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

+27-13
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]

src/libgetopts/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@
8787
#![deny(missing_doc)]
8888
#![deny(deprecated_owned_vector)]
8989

90-
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
91-
9290
#[cfg(test)] #[phase(syntax, link)] extern crate log;
9391

9492
use std::cmp::Eq;

src/liblog/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -15,7 +15,7 @@ Utilities for program-wide and customizable logging
1515
## Example
1616
1717
```
18-
#[feature(phase)];
18+
#![feature(phase)]
1919
#[phase(syntax, link)] extern crate log;
2020
2121
fn main() {

src/liblog/macros.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/// # Example
2222
///
2323
/// ```
24-
/// #[feature(phase)];
24+
/// #![feature(phase)]
2525
/// #[phase(syntax, link)] extern crate log;
2626
///
2727
/// # fn main() {
@@ -45,7 +45,7 @@ macro_rules! log(
4545
/// # Example
4646
///
4747
/// ```
48-
/// #[feature(phase)];
48+
/// #![feature(phase)]
4949
/// #[phase(syntax, link)] extern crate log;
5050
///
5151
/// # fn main() {
@@ -63,7 +63,7 @@ macro_rules! error(
6363
/// # Example
6464
///
6565
/// ```
66-
/// #[feature(phase)];
66+
/// #![feature(phase)]
6767
/// #[phase(syntax, link)] extern crate log;
6868
///
6969
/// # fn main() {
@@ -81,7 +81,7 @@ macro_rules! warn(
8181
/// # Example
8282
///
8383
/// ```
84-
/// #[feature(phase)];
84+
/// #![feature(phase)]
8585
/// #[phase(syntax, link)] extern crate log;
8686
///
8787
/// # fn main() {
@@ -101,7 +101,7 @@ macro_rules! info(
101101
/// # Example
102102
///
103103
/// ```
104-
/// #[feature(phase)];
104+
/// #![feature(phase)]
105105
/// #[phase(syntax, link)] extern crate log;
106106
///
107107
/// # fn main() {
@@ -118,7 +118,7 @@ macro_rules! debug(
118118
/// # Example
119119
///
120120
/// ```
121-
/// #[feature(phase)];
121+
/// #![feature(phase)]
122122
/// #[phase(syntax, link)] extern crate log;
123123
///
124124
/// # fn main() {

src/libnative/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@
5151
#![deny(unused_result, unused_must_use)]
5252
#![allow(non_camel_case_types)]
5353

54-
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
55-
5654
// NB this crate explicitly does *not* allow glob imports, please seriously
5755
// consider whether they're needed before adding that feature here (the
5856
// answer is that you don't need them)

src/librand/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ println!("{:?}", tuple_ptr)
7171
html_root_url = "http://static.rust-lang.org/doc/master")]
7272

7373
#![feature(macro_rules, managed_boxes, phase)]
74-
75-
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
7674
#![deny(deprecated_owned_vector)]
7775

7876
#[cfg(test)]

src/librustc/front/test.rs

+7-11
Original file line numberDiff line numberDiff line change
@@ -404,21 +404,17 @@ fn is_test_crate(krate: &ast::Crate) -> bool {
404404
}
405405

406406
fn mk_test_descs(cx: &TestCtxt) -> @ast::Expr {
407-
let mut descs = Vec::new();
408407
debug!("building test vector from {} tests", cx.testfns.borrow().len());
409-
for test in cx.testfns.borrow().iter() {
410-
descs.push(mk_test_desc_and_fn_rec(cx, test));
411-
}
412-
413-
let inner_expr = @ast::Expr {
414-
id: ast::DUMMY_NODE_ID,
415-
node: ast::ExprVec(descs, ast::MutImmutable),
416-
span: DUMMY_SP,
417-
};
418408

419409
@ast::Expr {
420410
id: ast::DUMMY_NODE_ID,
421-
node: ast::ExprVstore(inner_expr, ast::ExprVstoreSlice),
411+
node: ast::ExprVstore(@ast::Expr {
412+
id: ast::DUMMY_NODE_ID,
413+
node: ast::ExprVec(cx.testfns.borrow().iter().map(|test| {
414+
mk_test_desc_and_fn_rec(cx, test)
415+
}).collect()),
416+
span: DUMMY_SP,
417+
}, ast::ExprVstoreSlice),
422418
span: DUMMY_SP,
423419
}
424420
}

src/librustc/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ This API is completely unstable and subject to change.
3131
#![feature(macro_rules, globs, struct_variant, managed_boxes, quote,
3232
default_type_params, phase)]
3333

34-
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
35-
#![allow(unrecognized_lint)] // NOTE: remove after a stage0 snap
36-
3734
extern crate flate;
3835
extern crate arena;
3936
extern crate syntax;

src/librustc/middle/cfg/construct.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ impl<'a> CFGBuilder<'a> {
347347
self.add_node(expr.id, [])
348348
}
349349

350-
ast::ExprVec(ref elems, _) => {
350+
ast::ExprVec(ref elems) => {
351351
self.straightline(expr, pred, elems.as_slice())
352352
}
353353

@@ -379,7 +379,7 @@ impl<'a> CFGBuilder<'a> {
379379
self.straightline(expr, base_exit, field_exprs.as_slice())
380380
}
381381

382-
ast::ExprRepeat(elem, count, _) => {
382+
ast::ExprRepeat(elem, count) => {
383383
self.straightline(expr, pred, [elem, count])
384384
}
385385

src/librustc/middle/check_const.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ fn check_expr(v: &mut CheckCrateVisitor, e: &Expr, is_const: bool) {
157157
}
158158
ExprVstore(_, ExprVstoreMutSlice) |
159159
ExprVstore(_, ExprVstoreSlice) |
160-
ExprVec(_, MutImmutable) |
160+
ExprVec(_) |
161161
ExprAddrOf(MutImmutable, _) |
162162
ExprParen(..) |
163163
ExprField(..) |

src/librustc/middle/const_eval.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl<'a> ConstEvalVisitor<'a> {
213213
join(self.classify(a), self.classify(b)),
214214

215215
ast::ExprTup(ref es) |
216-
ast::ExprVec(ref es, ast::MutImmutable) =>
216+
ast::ExprVec(ref es) =>
217217
join_all(es.iter().map(|e| self.classify(*e))),
218218

219219
ast::ExprVstore(e, vstore) => {

src/librustc/middle/dataflow.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -538,11 +538,11 @@ impl<'a, 'b, O:DataFlowOperator> PropagationContext<'a, 'b, O> {
538538
self.walk_expr(l, in_out, loop_scopes);
539539
}
540540

541-
ast::ExprVec(ref exprs, _) => {
541+
ast::ExprVec(ref exprs) => {
542542
self.walk_exprs(exprs.as_slice(), in_out, loop_scopes)
543543
}
544544

545-
ast::ExprRepeat(l, r, _) => {
545+
ast::ExprRepeat(l, r) => {
546546
self.walk_expr(l, in_out, loop_scopes);
547547
self.walk_expr(r, in_out, loop_scopes);
548548
}

src/librustc/middle/kind.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ pub fn check_expr(cx: &mut Context, e: &Expr) {
309309
let target_ty = ty::expr_ty(cx.tcx, e);
310310
check_trait_cast(cx, source_ty, target_ty, source.span);
311311
}
312-
ExprRepeat(element, count_expr, _) => {
312+
ExprRepeat(element, count_expr) => {
313313
let count = ty::eval_repeat_count(cx.tcx, count_expr);
314314
if count > 1 {
315315
let element_ty = ty::expr_ty(cx.tcx, element);

0 commit comments

Comments
 (0)