Skip to content

Commit

Permalink
auto merge of #13326 : alexcrichton/rust/rollup, r=alexcrichton
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Apr 4, 2014
2 parents e5f1b9f + 6d43138 commit 4cf8d8c
Show file tree
Hide file tree
Showing 95 changed files with 259 additions and 196 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ documentation.

## Quick Start

1. Download a [binary insaller][installer] for your platform.
1. Download a [binary installer][installer] for your platform.
2. Read the [tutorial].
3. Enjoy!

Expand Down
3 changes: 2 additions & 1 deletion mk/dist.mk
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ dist-install-dir-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
dist-install-dir-$(1): PREPARE_CLEAN=true
dist-install-dir-$(1): prepare-base-dir-$(1)
dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
$$(Q)(cd $$(PREPARE_DEST_DIR)/ && find . -type f | sed 's/^\.\///') \
> tmp/dist/manifest-$(1).in
$$(Q)mv tmp/dist/manifest-$(1).in $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest.in
Expand All @@ -224,6 +224,7 @@ dist-install-dir-$(1): prepare-base-dir-$(1)
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)
$$(Q)cp -r doc $$(PREPARE_DEST_DIR)
$$(Q)$$(PREPARE_BIN_CMD) $$(S)src/etc/install.sh $$(PREPARE_DEST_DIR)

dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
Expand Down
12 changes: 6 additions & 6 deletions src/doc/guide-unsafe.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ asm!(assembly template
);
```

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

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

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

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

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

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

```
# #[feature(asm)];
# #![feature(asm)]
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
# fn main() { unsafe {
// Put the value 0x200 in eax
Expand Down
4 changes: 2 additions & 2 deletions src/doc/po/ja/rust.md.po
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Japanese translations for Rust package
# Copyright (C) 2013 The Rust Project Developers
# Copyright (C) 2013-2014 The Rust Project Developers
# This file is distributed under the same license as the Rust package.
# Automatically generated, 2013.
#
Expand Down Expand Up @@ -886,7 +886,7 @@ msgstr ""
#: src/doc/rust.md:2008
#, fuzzy
#| msgid "~~~~ use std::task::spawn;"
msgid "~~~~ {.ignore} #[warn(unstable)];"
msgid "~~~~ {.ignore} #![warn(unstable)]"
msgstr ""
"~~~~\n"
"use std::task::spawn;"
Expand Down
2 changes: 1 addition & 1 deletion src/etc/combine-tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def scrub(b):
#[crate_id=\"run_pass_stage2#0.1\"];
#[crate_id=\"run_pass_stage2#0.1\"];
#[feature(globs, macro_rules, struct_variant, managed_boxes)];
#[allow(warnings)];
#![allow(warnings)]
extern crate collections;
"""
)
Expand Down
1 change: 0 additions & 1 deletion src/libarena/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
#![allow(missing_doc)]
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap

extern crate collections;

Expand Down
2 changes: 0 additions & 2 deletions src/libcollections/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

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

#![allow(visible_private_types)] // NOTE: remove after a stage0 snap

extern crate rand;

#[cfg(test)] extern crate test;
Expand Down
5 changes: 5 additions & 0 deletions src/libcollections/priority_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ impl<T:Ord> PriorityQueue<T> {
/// Create an empty PriorityQueue
pub fn new() -> PriorityQueue<T> { PriorityQueue{data: ~[],} }

/// Create an empty PriorityQueue with capacity `capacity`
pub fn with_capacity(capacity: uint) -> PriorityQueue<T> {
PriorityQueue { data: slice::with_capacity(capacity) }
}

/// Create a PriorityQueue from a vector (heapify)
pub fn from_vec(xs: ~[T]) -> PriorityQueue<T> {
let mut q = PriorityQueue{data: xs,};
Expand Down
5 changes: 5 additions & 0 deletions src/libcollections/smallintmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ impl<V> SmallIntMap<V> {
/// Create an empty SmallIntMap
pub fn new() -> SmallIntMap<V> { SmallIntMap{v: ~[]} }

/// Create an empty SmallIntMap with capacity `capacity`
pub fn with_capacity(capacity: uint) -> SmallIntMap<V> {
SmallIntMap { v: slice::with_capacity(capacity) }
}

pub fn get<'a>(&'a self, key: &uint) -> &'a V {
self.find(key).expect("key not present")
}
Expand Down
40 changes: 27 additions & 13 deletions src/libcollections/trie.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,32 +293,46 @@ impl Mutable for TrieSet {
fn clear(&mut self) { self.map.clear() }
}

impl TrieSet {
/// Create an empty TrieSet
impl Set<uint> for TrieSet {
#[inline]
pub fn new() -> TrieSet {
TrieSet{map: TrieMap::new()}
fn contains(&self, value: &uint) -> bool {
self.map.contains_key(value)
}

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

/// Add a value to the set. Return true if the value was not already
/// present in the set.
#[inline]
pub fn insert(&mut self, value: uint) -> bool {
fn is_subset(&self, other: &TrieSet) -> bool {
self.iter().all(|v| other.contains(&v))
}

#[inline]
fn is_superset(&self, other: &TrieSet) -> bool {
other.is_subset(self)
}
}

impl MutableSet<uint> for TrieSet {
#[inline]
fn insert(&mut self, value: uint) -> bool {
self.map.insert(value, ())
}

/// Remove a value from the set. Return true if the value was
/// present in the set.
#[inline]
pub fn remove(&mut self, value: &uint) -> bool {
fn remove(&mut self, value: &uint) -> bool {
self.map.remove(value)
}
}

impl TrieSet {
/// Create an empty TrieSet
#[inline]
pub fn new() -> TrieSet {
TrieSet{map: TrieMap::new()}
}

/// Visit all values in reverse order
#[inline]
Expand Down
2 changes: 0 additions & 2 deletions src/libgetopts/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@
#![deny(missing_doc)]
#![deny(deprecated_owned_vector)]

#![allow(visible_private_types)] // NOTE: remove after a stage0 snap

#[cfg(test)] #[phase(syntax, link)] extern crate log;

use std::cmp::Eq;
Expand Down
4 changes: 2 additions & 2 deletions src/liblog/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
Expand All @@ -15,7 +15,7 @@ Utilities for program-wide and customizable logging
## Example
```
#[feature(phase)];
#![feature(phase)]
#[phase(syntax, link)] extern crate log;
fn main() {
Expand Down
12 changes: 6 additions & 6 deletions src/liblog/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/// # Example
///
/// ```
/// #[feature(phase)];
/// #![feature(phase)]
/// #[phase(syntax, link)] extern crate log;
///
/// # fn main() {
Expand All @@ -45,7 +45,7 @@ macro_rules! log(
/// # Example
///
/// ```
/// #[feature(phase)];
/// #![feature(phase)]
/// #[phase(syntax, link)] extern crate log;
///
/// # fn main() {
Expand All @@ -63,7 +63,7 @@ macro_rules! error(
/// # Example
///
/// ```
/// #[feature(phase)];
/// #![feature(phase)]
/// #[phase(syntax, link)] extern crate log;
///
/// # fn main() {
Expand All @@ -81,7 +81,7 @@ macro_rules! warn(
/// # Example
///
/// ```
/// #[feature(phase)];
/// #![feature(phase)]
/// #[phase(syntax, link)] extern crate log;
///
/// # fn main() {
Expand All @@ -101,7 +101,7 @@ macro_rules! info(
/// # Example
///
/// ```
/// #[feature(phase)];
/// #![feature(phase)]
/// #[phase(syntax, link)] extern crate log;
///
/// # fn main() {
Expand All @@ -118,7 +118,7 @@ macro_rules! debug(
/// # Example
///
/// ```
/// #[feature(phase)];
/// #![feature(phase)]
/// #[phase(syntax, link)] extern crate log;
///
/// # fn main() {
Expand Down
2 changes: 0 additions & 2 deletions src/libnative/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@
#![deny(unused_result, unused_must_use)]
#![allow(non_camel_case_types)]

#![allow(visible_private_types)] // NOTE: remove after a stage0 snap

// NB this crate explicitly does *not* allow glob imports, please seriously
// consider whether they're needed before adding that feature here (the
// answer is that you don't need them)
Expand Down
2 changes: 0 additions & 2 deletions src/librand/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ println!("{:?}", tuple_ptr)
html_root_url = "http://static.rust-lang.org/doc/master")]

#![feature(macro_rules, managed_boxes, phase)]

#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
#![deny(deprecated_owned_vector)]

#[cfg(test)]
Expand Down
18 changes: 7 additions & 11 deletions src/librustc/front/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -404,21 +404,17 @@ fn is_test_crate(krate: &ast::Crate) -> bool {
}

fn mk_test_descs(cx: &TestCtxt) -> @ast::Expr {
let mut descs = Vec::new();
debug!("building test vector from {} tests", cx.testfns.borrow().len());
for test in cx.testfns.borrow().iter() {
descs.push(mk_test_desc_and_fn_rec(cx, test));
}

let inner_expr = @ast::Expr {
id: ast::DUMMY_NODE_ID,
node: ast::ExprVec(descs, ast::MutImmutable),
span: DUMMY_SP,
};

@ast::Expr {
id: ast::DUMMY_NODE_ID,
node: ast::ExprVstore(inner_expr, ast::ExprVstoreSlice),
node: ast::ExprVstore(@ast::Expr {
id: ast::DUMMY_NODE_ID,
node: ast::ExprVec(cx.testfns.borrow().iter().map(|test| {
mk_test_desc_and_fn_rec(cx, test)
}).collect()),
span: DUMMY_SP,
}, ast::ExprVstoreSlice),
span: DUMMY_SP,
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/librustc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ This API is completely unstable and subject to change.
#![feature(macro_rules, globs, struct_variant, managed_boxes, quote,
default_type_params, phase)]

#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
#![allow(unrecognized_lint)] // NOTE: remove after a stage0 snap

extern crate flate;
extern crate arena;
extern crate syntax;
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/cfg/construct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ impl<'a> CFGBuilder<'a> {
self.add_node(expr.id, [])
}

ast::ExprVec(ref elems, _) => {
ast::ExprVec(ref elems) => {
self.straightline(expr, pred, elems.as_slice())
}

Expand Down Expand Up @@ -379,7 +379,7 @@ impl<'a> CFGBuilder<'a> {
self.straightline(expr, base_exit, field_exprs.as_slice())
}

ast::ExprRepeat(elem, count, _) => {
ast::ExprRepeat(elem, count) => {
self.straightline(expr, pred, [elem, count])
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/check_const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ fn check_expr(v: &mut CheckCrateVisitor, e: &Expr, is_const: bool) {
}
ExprVstore(_, ExprVstoreMutSlice) |
ExprVstore(_, ExprVstoreSlice) |
ExprVec(_, MutImmutable) |
ExprVec(_) |
ExprAddrOf(MutImmutable, _) |
ExprParen(..) |
ExprField(..) |
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/const_eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ impl<'a> ConstEvalVisitor<'a> {
join(self.classify(a), self.classify(b)),

ast::ExprTup(ref es) |
ast::ExprVec(ref es, ast::MutImmutable) =>
ast::ExprVec(ref es) =>
join_all(es.iter().map(|e| self.classify(*e))),

ast::ExprVstore(e, vstore) => {
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/dataflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -538,11 +538,11 @@ impl<'a, 'b, O:DataFlowOperator> PropagationContext<'a, 'b, O> {
self.walk_expr(l, in_out, loop_scopes);
}

ast::ExprVec(ref exprs, _) => {
ast::ExprVec(ref exprs) => {
self.walk_exprs(exprs.as_slice(), in_out, loop_scopes)
}

ast::ExprRepeat(l, r, _) => {
ast::ExprRepeat(l, r) => {
self.walk_expr(l, in_out, loop_scopes);
self.walk_expr(r, in_out, loop_scopes);
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ pub fn check_expr(cx: &mut Context, e: &Expr) {
let target_ty = ty::expr_ty(cx.tcx, e);
check_trait_cast(cx, source_ty, target_ty, source.span);
}
ExprRepeat(element, count_expr, _) => {
ExprRepeat(element, count_expr) => {
let count = ty::eval_repeat_count(cx.tcx, count_expr);
if count > 1 {
let element_ty = ty::expr_ty(cx.tcx, element);
Expand Down
Loading

0 comments on commit 4cf8d8c

Please sign in to comment.