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
This commit is contained in:
commit
4cf8d8ce69
|
@ -5,7 +5,7 @@ documentation.
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
1. Download a [binary insaller][installer] for your platform.
|
1. Download a [binary installer][installer] for your platform.
|
||||||
2. Read the [tutorial].
|
2. Read the [tutorial].
|
||||||
3. Enjoy!
|
3. Enjoy!
|
||||||
|
|
||||||
|
|
|
@ -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_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
|
||||||
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
|
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
|
||||||
dist-install-dir-$(1): PREPARE_CLEAN=true
|
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/^\.\///') \
|
$$(Q)(cd $$(PREPARE_DEST_DIR)/ && find . -type f | sed 's/^\.\///') \
|
||||||
> tmp/dist/manifest-$(1).in
|
> tmp/dist/manifest-$(1).in
|
||||||
$$(Q)mv tmp/dist/manifest-$(1).in $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest.in
|
$$(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)
|
||||||
$$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)
|
$$(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)LICENSE-MIT $$(PREPARE_DEST_DIR)
|
||||||
$$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(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)
|
$$(Q)$$(PREPARE_BIN_CMD) $$(S)src/etc/install.sh $$(PREPARE_DEST_DIR)
|
||||||
|
|
||||||
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
|
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
|
||||||
|
|
|
@ -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.
|
crate to allow) and of course requires an `unsafe` block.
|
||||||
|
|
||||||
> **Note**: the examples here are given in x86/x86-64 assembly, but all
|
> **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
|
||||||
literal string (i.e `""`)
|
literal string (i.e `""`)
|
||||||
|
|
||||||
```
|
```
|
||||||
#[feature(asm)];
|
#![feature(asm)]
|
||||||
|
|
||||||
#[cfg(target_arch = "x86")]
|
#[cfg(target_arch = "x86")]
|
||||||
#[cfg(target_arch = "x86_64")]
|
#[cfg(target_arch = "x86_64")]
|
||||||
|
@ -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:
|
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")]
|
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
|
||||||
# fn main() { unsafe {
|
# fn main() { unsafe {
|
||||||
asm!("xor %eax, %eax"
|
asm!("xor %eax, %eax"
|
||||||
|
@ -348,7 +348,7 @@ asm!("xor %eax, %eax"
|
||||||
Whitespace also doesn't matter:
|
Whitespace also doesn't matter:
|
||||||
|
|
||||||
```
|
```
|
||||||
# #[feature(asm)];
|
# #![feature(asm)]
|
||||||
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
|
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
|
||||||
# fn main() { unsafe {
|
# fn main() { unsafe {
|
||||||
asm!("xor %eax, %eax" ::: "eax");
|
asm!("xor %eax, %eax" ::: "eax");
|
||||||
|
@ -362,7 +362,7 @@ Input and output operands follow the same format: `:
|
||||||
expressions must be mutable lvalues:
|
expressions must be mutable lvalues:
|
||||||
|
|
||||||
```
|
```
|
||||||
# #[feature(asm)];
|
# #![feature(asm)]
|
||||||
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
|
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
|
||||||
fn add(a: int, b: int) -> int {
|
fn add(a: int, b: int) -> int {
|
||||||
let mut c = 0;
|
let mut c = 0;
|
||||||
|
@ -390,7 +390,7 @@ compiler not to assume any values loaded into those registers will
|
||||||
stay valid.
|
stay valid.
|
||||||
|
|
||||||
```
|
```
|
||||||
# #[feature(asm)];
|
# #![feature(asm)]
|
||||||
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
|
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
|
||||||
# fn main() { unsafe {
|
# fn main() { unsafe {
|
||||||
// Put the value 0x200 in eax
|
// Put the value 0x200 in eax
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# Japanese translations for Rust package
|
# 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.
|
# This file is distributed under the same license as the Rust package.
|
||||||
# Automatically generated, 2013.
|
# Automatically generated, 2013.
|
||||||
#
|
#
|
||||||
|
@ -886,7 +886,7 @@ msgstr ""
|
||||||
#: src/doc/rust.md:2008
|
#: src/doc/rust.md:2008
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
#| msgid "~~~~ use std::task::spawn;"
|
#| msgid "~~~~ use std::task::spawn;"
|
||||||
msgid "~~~~ {.ignore} #[warn(unstable)];"
|
msgid "~~~~ {.ignore} #![warn(unstable)]"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"~~~~\n"
|
"~~~~\n"
|
||||||
"use std::task::spawn;"
|
"use std::task::spawn;"
|
||||||
|
|
|
@ -54,7 +54,7 @@ c.write(
|
||||||
#[crate_id=\"run_pass_stage2#0.1\"];
|
#[crate_id=\"run_pass_stage2#0.1\"];
|
||||||
#[crate_id=\"run_pass_stage2#0.1\"];
|
#[crate_id=\"run_pass_stage2#0.1\"];
|
||||||
#[feature(globs, macro_rules, struct_variant, managed_boxes)];
|
#[feature(globs, macro_rules, struct_variant, managed_boxes)];
|
||||||
#[allow(warnings)];
|
#![allow(warnings)]
|
||||||
extern crate collections;
|
extern crate collections;
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
|
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
|
||||||
html_root_url = "http://static.rust-lang.org/doc/master")]
|
html_root_url = "http://static.rust-lang.org/doc/master")]
|
||||||
#![allow(missing_doc)]
|
#![allow(missing_doc)]
|
||||||
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
|
|
||||||
|
|
||||||
extern crate collections;
|
extern crate collections;
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,6 @@
|
||||||
|
|
||||||
#![feature(macro_rules, managed_boxes, default_type_params, phase)]
|
#![feature(macro_rules, managed_boxes, default_type_params, phase)]
|
||||||
|
|
||||||
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
|
|
||||||
|
|
||||||
extern crate rand;
|
extern crate rand;
|
||||||
|
|
||||||
#[cfg(test)] extern crate test;
|
#[cfg(test)] extern crate test;
|
||||||
|
|
|
@ -117,6 +117,11 @@ impl<T:Ord> PriorityQueue<T> {
|
||||||
/// Create an empty PriorityQueue
|
/// Create an empty PriorityQueue
|
||||||
pub fn new() -> PriorityQueue<T> { PriorityQueue{data: ~[],} }
|
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)
|
/// Create a PriorityQueue from a vector (heapify)
|
||||||
pub fn from_vec(xs: ~[T]) -> PriorityQueue<T> {
|
pub fn from_vec(xs: ~[T]) -> PriorityQueue<T> {
|
||||||
let mut q = PriorityQueue{data: xs,};
|
let mut q = PriorityQueue{data: xs,};
|
||||||
|
|
|
@ -112,6 +112,11 @@ impl<V> SmallIntMap<V> {
|
||||||
/// Create an empty SmallIntMap
|
/// Create an empty SmallIntMap
|
||||||
pub fn new() -> SmallIntMap<V> { SmallIntMap{v: ~[]} }
|
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 {
|
pub fn get<'a>(&'a self, key: &uint) -> &'a V {
|
||||||
self.find(key).expect("key not present")
|
self.find(key).expect("key not present")
|
||||||
}
|
}
|
||||||
|
|
|
@ -293,6 +293,40 @@ impl Mutable for TrieSet {
|
||||||
fn clear(&mut self) { self.map.clear() }
|
fn clear(&mut self) { self.map.clear() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Set<uint> for TrieSet {
|
||||||
|
#[inline]
|
||||||
|
fn contains(&self, value: &uint) -> bool {
|
||||||
|
self.map.contains_key(value)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn is_disjoint(&self, other: &TrieSet) -> bool {
|
||||||
|
self.iter().all(|v| !other.contains(&v))
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
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, ())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
fn remove(&mut self, value: &uint) -> bool {
|
||||||
|
self.map.remove(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl TrieSet {
|
impl TrieSet {
|
||||||
/// Create an empty TrieSet
|
/// Create an empty TrieSet
|
||||||
#[inline]
|
#[inline]
|
||||||
|
@ -300,26 +334,6 @@ impl TrieSet {
|
||||||
TrieSet{map: TrieMap::new()}
|
TrieSet{map: TrieMap::new()}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return true if the set contains a value
|
|
||||||
#[inline]
|
|
||||||
pub fn contains(&self, value: &uint) -> bool {
|
|
||||||
self.map.contains_key(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 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 {
|
|
||||||
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 {
|
|
||||||
self.map.remove(value)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Visit all values in reverse order
|
/// Visit all values in reverse order
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn each_reverse(&self, f: |&uint| -> bool) -> bool {
|
pub fn each_reverse(&self, f: |&uint| -> bool) -> bool {
|
||||||
|
|
|
@ -87,8 +87,6 @@
|
||||||
#![deny(missing_doc)]
|
#![deny(missing_doc)]
|
||||||
#![deny(deprecated_owned_vector)]
|
#![deny(deprecated_owned_vector)]
|
||||||
|
|
||||||
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
|
|
||||||
|
|
||||||
#[cfg(test)] #[phase(syntax, link)] extern crate log;
|
#[cfg(test)] #[phase(syntax, link)] extern crate log;
|
||||||
|
|
||||||
use std::cmp::Eq;
|
use std::cmp::Eq;
|
||||||
|
|
|
@ -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
|
// file at the top-level directory of this distribution and at
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
//
|
//
|
||||||
|
@ -15,7 +15,7 @@ Utilities for program-wide and customizable logging
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
```
|
```
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
#[phase(syntax, link)] extern crate log;
|
#[phase(syntax, link)] extern crate log;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #[feature(phase)];
|
/// #![feature(phase)]
|
||||||
/// #[phase(syntax, link)] extern crate log;
|
/// #[phase(syntax, link)] extern crate log;
|
||||||
///
|
///
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
|
@ -45,7 +45,7 @@ macro_rules! log(
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #[feature(phase)];
|
/// #![feature(phase)]
|
||||||
/// #[phase(syntax, link)] extern crate log;
|
/// #[phase(syntax, link)] extern crate log;
|
||||||
///
|
///
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
|
@ -63,7 +63,7 @@ macro_rules! error(
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #[feature(phase)];
|
/// #![feature(phase)]
|
||||||
/// #[phase(syntax, link)] extern crate log;
|
/// #[phase(syntax, link)] extern crate log;
|
||||||
///
|
///
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
|
@ -81,7 +81,7 @@ macro_rules! warn(
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #[feature(phase)];
|
/// #![feature(phase)]
|
||||||
/// #[phase(syntax, link)] extern crate log;
|
/// #[phase(syntax, link)] extern crate log;
|
||||||
///
|
///
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
|
@ -101,7 +101,7 @@ macro_rules! info(
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #[feature(phase)];
|
/// #![feature(phase)]
|
||||||
/// #[phase(syntax, link)] extern crate log;
|
/// #[phase(syntax, link)] extern crate log;
|
||||||
///
|
///
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
|
@ -118,7 +118,7 @@ macro_rules! debug(
|
||||||
/// # Example
|
/// # Example
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
/// #[feature(phase)];
|
/// #![feature(phase)]
|
||||||
/// #[phase(syntax, link)] extern crate log;
|
/// #[phase(syntax, link)] extern crate log;
|
||||||
///
|
///
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
|
|
|
@ -51,8 +51,6 @@
|
||||||
#![deny(unused_result, unused_must_use)]
|
#![deny(unused_result, unused_must_use)]
|
||||||
#![allow(non_camel_case_types)]
|
#![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
|
// NB this crate explicitly does *not* allow glob imports, please seriously
|
||||||
// consider whether they're needed before adding that feature here (the
|
// consider whether they're needed before adding that feature here (the
|
||||||
// answer is that you don't need them)
|
// answer is that you don't need them)
|
||||||
|
|
|
@ -71,8 +71,6 @@ println!("{:?}", tuple_ptr)
|
||||||
html_root_url = "http://static.rust-lang.org/doc/master")]
|
html_root_url = "http://static.rust-lang.org/doc/master")]
|
||||||
|
|
||||||
#![feature(macro_rules, managed_boxes, phase)]
|
#![feature(macro_rules, managed_boxes, phase)]
|
||||||
|
|
||||||
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
|
|
||||||
#![deny(deprecated_owned_vector)]
|
#![deny(deprecated_owned_vector)]
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
|
@ -404,21 +404,17 @@ fn is_test_crate(krate: &ast::Crate) -> bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mk_test_descs(cx: &TestCtxt) -> @ast::Expr {
|
fn mk_test_descs(cx: &TestCtxt) -> @ast::Expr {
|
||||||
let mut descs = Vec::new();
|
|
||||||
debug!("building test vector from {} tests", cx.testfns.borrow().len());
|
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 {
|
@ast::Expr {
|
||||||
id: ast::DUMMY_NODE_ID,
|
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,
|
span: DUMMY_SP,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,9 +31,6 @@ This API is completely unstable and subject to change.
|
||||||
#![feature(macro_rules, globs, struct_variant, managed_boxes, quote,
|
#![feature(macro_rules, globs, struct_variant, managed_boxes, quote,
|
||||||
default_type_params, phase)]
|
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 flate;
|
||||||
extern crate arena;
|
extern crate arena;
|
||||||
extern crate syntax;
|
extern crate syntax;
|
||||||
|
|
|
@ -347,7 +347,7 @@ impl<'a> CFGBuilder<'a> {
|
||||||
self.add_node(expr.id, [])
|
self.add_node(expr.id, [])
|
||||||
}
|
}
|
||||||
|
|
||||||
ast::ExprVec(ref elems, _) => {
|
ast::ExprVec(ref elems) => {
|
||||||
self.straightline(expr, pred, elems.as_slice())
|
self.straightline(expr, pred, elems.as_slice())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -379,7 +379,7 @@ impl<'a> CFGBuilder<'a> {
|
||||||
self.straightline(expr, base_exit, field_exprs.as_slice())
|
self.straightline(expr, base_exit, field_exprs.as_slice())
|
||||||
}
|
}
|
||||||
|
|
||||||
ast::ExprRepeat(elem, count, _) => {
|
ast::ExprRepeat(elem, count) => {
|
||||||
self.straightline(expr, pred, [elem, count])
|
self.straightline(expr, pred, [elem, count])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,7 @@ fn check_expr(v: &mut CheckCrateVisitor, e: &Expr, is_const: bool) {
|
||||||
}
|
}
|
||||||
ExprVstore(_, ExprVstoreMutSlice) |
|
ExprVstore(_, ExprVstoreMutSlice) |
|
||||||
ExprVstore(_, ExprVstoreSlice) |
|
ExprVstore(_, ExprVstoreSlice) |
|
||||||
ExprVec(_, MutImmutable) |
|
ExprVec(_) |
|
||||||
ExprAddrOf(MutImmutable, _) |
|
ExprAddrOf(MutImmutable, _) |
|
||||||
ExprParen(..) |
|
ExprParen(..) |
|
||||||
ExprField(..) |
|
ExprField(..) |
|
||||||
|
|
|
@ -213,7 +213,7 @@ impl<'a> ConstEvalVisitor<'a> {
|
||||||
join(self.classify(a), self.classify(b)),
|
join(self.classify(a), self.classify(b)),
|
||||||
|
|
||||||
ast::ExprTup(ref es) |
|
ast::ExprTup(ref es) |
|
||||||
ast::ExprVec(ref es, ast::MutImmutable) =>
|
ast::ExprVec(ref es) =>
|
||||||
join_all(es.iter().map(|e| self.classify(*e))),
|
join_all(es.iter().map(|e| self.classify(*e))),
|
||||||
|
|
||||||
ast::ExprVstore(e, vstore) => {
|
ast::ExprVstore(e, vstore) => {
|
||||||
|
|
|
@ -538,11 +538,11 @@ impl<'a, 'b, O:DataFlowOperator> PropagationContext<'a, 'b, O> {
|
||||||
self.walk_expr(l, in_out, loop_scopes);
|
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)
|
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(l, in_out, loop_scopes);
|
||||||
self.walk_expr(r, in_out, loop_scopes);
|
self.walk_expr(r, in_out, loop_scopes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -309,7 +309,7 @@ pub fn check_expr(cx: &mut Context, e: &Expr) {
|
||||||
let target_ty = ty::expr_ty(cx.tcx, e);
|
let target_ty = ty::expr_ty(cx.tcx, e);
|
||||||
check_trait_cast(cx, source_ty, target_ty, source.span);
|
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);
|
let count = ty::eval_repeat_count(cx.tcx, count_expr);
|
||||||
if count > 1 {
|
if count > 1 {
|
||||||
let element_ty = ty::expr_ty(cx.tcx, element);
|
let element_ty = ty::expr_ty(cx.tcx, element);
|
||||||
|
|
|
@ -1109,11 +1109,11 @@ impl<'a> Liveness<'a> {
|
||||||
self.propagate_through_expr(expr, succ)
|
self.propagate_through_expr(expr, succ)
|
||||||
}
|
}
|
||||||
|
|
||||||
ExprVec(ref exprs, _) => {
|
ExprVec(ref exprs) => {
|
||||||
self.propagate_through_exprs(exprs.as_slice(), succ)
|
self.propagate_through_exprs(exprs.as_slice(), succ)
|
||||||
}
|
}
|
||||||
|
|
||||||
ExprRepeat(element, count, _) => {
|
ExprRepeat(element, count) => {
|
||||||
let succ = self.propagate_through_expr(count, succ);
|
let succ = self.propagate_through_expr(count, succ);
|
||||||
self.propagate_through_expr(element, succ)
|
self.propagate_through_expr(element, succ)
|
||||||
}
|
}
|
||||||
|
|
|
@ -473,7 +473,7 @@ impl<'a> VisitContext<'a> {
|
||||||
self.use_expr(base, expr_mode);
|
self.use_expr(base, expr_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
ExprVec(ref exprs, _) => {
|
ExprVec(ref exprs) => {
|
||||||
self.consume_exprs(exprs.as_slice());
|
self.consume_exprs(exprs.as_slice());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -539,7 +539,7 @@ impl<'a> VisitContext<'a> {
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
ExprRepeat(base, count, _) => {
|
ExprRepeat(base, count) => {
|
||||||
self.consume_expr(base);
|
self.consume_expr(base);
|
||||||
self.consume_expr(count);
|
self.consume_expr(count);
|
||||||
}
|
}
|
||||||
|
|
|
@ -724,7 +724,7 @@ fn resolve_local(visitor: &mut RegionResolutionVisitor,
|
||||||
visitor.region_maps.record_rvalue_scope(subexpr.id, blk_id);
|
visitor.region_maps.record_rvalue_scope(subexpr.id, blk_id);
|
||||||
record_rvalue_scope_if_borrow_expr(visitor, subexpr, blk_id);
|
record_rvalue_scope_if_borrow_expr(visitor, subexpr, blk_id);
|
||||||
}
|
}
|
||||||
ast::ExprVec(ref subexprs, _) |
|
ast::ExprVec(ref subexprs) |
|
||||||
ast::ExprTup(ref subexprs) => {
|
ast::ExprTup(ref subexprs) => {
|
||||||
for &subexpr in subexprs.iter() {
|
for &subexpr in subexprs.iter() {
|
||||||
record_rvalue_scope_if_borrow_expr(
|
record_rvalue_scope_if_borrow_expr(
|
||||||
|
|
|
@ -557,7 +557,7 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr,
|
||||||
inlineable.iter().fold(true, |a, &b| a && b))
|
inlineable.iter().fold(true, |a, &b| a && b))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
ast::ExprVec(ref es, ast::MutImmutable) => {
|
ast::ExprVec(ref es) => {
|
||||||
let (v, _, inlineable) = const_vec(cx,
|
let (v, _, inlineable) = const_vec(cx,
|
||||||
e,
|
e,
|
||||||
es.as_slice(),
|
es.as_slice(),
|
||||||
|
@ -573,7 +573,7 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr,
|
||||||
_ => { cx.sess().span_bug(e.span, "bad const-slice lit") }
|
_ => { cx.sess().span_bug(e.span, "bad const-slice lit") }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ast::ExprVec(ref es, ast::MutImmutable) => {
|
ast::ExprVec(ref es) => {
|
||||||
let (cv, llunitty, _) = const_vec(cx,
|
let (cv, llunitty, _) = const_vec(cx,
|
||||||
e,
|
e,
|
||||||
es.as_slice(),
|
es.as_slice(),
|
||||||
|
@ -592,7 +592,7 @@ fn const_expr_unadjusted(cx: &CrateContext, e: &ast::Expr,
|
||||||
_ => cx.sess().span_bug(e.span, "bad const-slice expr")
|
_ => cx.sess().span_bug(e.span, "bad const-slice expr")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ast::ExprRepeat(elem, count, _) => {
|
ast::ExprRepeat(elem, count) => {
|
||||||
let vec_ty = ty::expr_ty(cx.tcx(), e);
|
let vec_ty = ty::expr_ty(cx.tcx(), e);
|
||||||
let unit_ty = ty::sequence_element_type(cx.tcx(), vec_ty);
|
let unit_ty = ty::sequence_element_type(cx.tcx(), vec_ty);
|
||||||
let llunitty = type_of::type_of(cx, unit_ty);
|
let llunitty = type_of::type_of(cx, unit_ty);
|
||||||
|
|
|
@ -2619,7 +2619,7 @@ fn populate_scope_map(cx: &CrateContext,
|
||||||
walk_expr(cx, rhs, scope_stack, scope_map);
|
walk_expr(cx, rhs, scope_stack, scope_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
ast::ExprVec(ref init_expressions, _) |
|
ast::ExprVec(ref init_expressions) |
|
||||||
ast::ExprTup(ref init_expressions) => {
|
ast::ExprTup(ref init_expressions) => {
|
||||||
for ie in init_expressions.iter() {
|
for ie in init_expressions.iter() {
|
||||||
walk_expr(cx, *ie, scope_stack, scope_map);
|
walk_expr(cx, *ie, scope_stack, scope_map);
|
||||||
|
@ -2627,7 +2627,7 @@ fn populate_scope_map(cx: &CrateContext,
|
||||||
}
|
}
|
||||||
|
|
||||||
ast::ExprAssign(sub_exp1, sub_exp2) |
|
ast::ExprAssign(sub_exp1, sub_exp2) |
|
||||||
ast::ExprRepeat(sub_exp1, sub_exp2, _) => {
|
ast::ExprRepeat(sub_exp1, sub_exp2) => {
|
||||||
walk_expr(cx, sub_exp1, scope_stack, scope_map);
|
walk_expr(cx, sub_exp1, scope_stack, scope_map);
|
||||||
walk_expr(cx, sub_exp2, scope_stack, scope_map);
|
walk_expr(cx, sub_exp2, scope_stack, scope_map);
|
||||||
}
|
}
|
||||||
|
|
|
@ -392,7 +392,7 @@ pub fn write_content<'a>(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ast::ExprVec(ref elements, _) => {
|
ast::ExprVec(ref elements) => {
|
||||||
match dest {
|
match dest {
|
||||||
Ignore => {
|
Ignore => {
|
||||||
for element in elements.iter() {
|
for element in elements.iter() {
|
||||||
|
@ -418,7 +418,7 @@ pub fn write_content<'a>(
|
||||||
}
|
}
|
||||||
return bcx;
|
return bcx;
|
||||||
}
|
}
|
||||||
ast::ExprRepeat(element, count_expr, _) => {
|
ast::ExprRepeat(element, count_expr) => {
|
||||||
match dest {
|
match dest {
|
||||||
Ignore => {
|
Ignore => {
|
||||||
return expr::trans_into(bcx, element, Ignore);
|
return expr::trans_into(bcx, element, Ignore);
|
||||||
|
@ -486,8 +486,8 @@ pub fn elements_required(bcx: &Block, content_expr: &ast::Expr) -> uint {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
ast::ExprVec(ref es, _) => es.len(),
|
ast::ExprVec(ref es) => es.len(),
|
||||||
ast::ExprRepeat(_, count_expr, _) => {
|
ast::ExprRepeat(_, count_expr) => {
|
||||||
ty::eval_repeat_count(bcx.tcx(), count_expr)
|
ty::eval_repeat_count(bcx.tcx(), count_expr)
|
||||||
}
|
}
|
||||||
_ => bcx.tcx().sess.span_bug(content_expr.span,
|
_ => bcx.tcx().sess.span_bug(content_expr.span,
|
||||||
|
|
|
@ -2482,13 +2482,13 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
|
||||||
let tt = ast_expr_vstore_to_vstore(fcx, ev, vst);
|
let tt = ast_expr_vstore_to_vstore(fcx, ev, vst);
|
||||||
ty::mk_str(tcx, tt)
|
ty::mk_str(tcx, tt)
|
||||||
}
|
}
|
||||||
ast::ExprVec(ref args, mutbl) => {
|
ast::ExprVec(ref args) => {
|
||||||
let tt = ast_expr_vstore_to_vstore(fcx, ev, vst);
|
let tt = ast_expr_vstore_to_vstore(fcx, ev, vst);
|
||||||
let mut any_error = false;
|
let mut any_error = false;
|
||||||
let mut any_bot = false;
|
let mut any_bot = false;
|
||||||
let mutability = match vst {
|
let mutability = match vst {
|
||||||
ast::ExprVstoreMutSlice => ast::MutMutable,
|
ast::ExprVstoreMutSlice => ast::MutMutable,
|
||||||
_ => mutbl,
|
_ => ast::MutImmutable,
|
||||||
};
|
};
|
||||||
let t: ty::t = fcx.infcx().next_ty_var();
|
let t: ty::t = fcx.infcx().next_ty_var();
|
||||||
for e in args.iter() {
|
for e in args.iter() {
|
||||||
|
@ -2509,13 +2509,13 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
|
||||||
ty::mk_vec(tcx, ty::mt {ty: t, mutbl: mutability}, tt)
|
ty::mk_vec(tcx, ty::mt {ty: t, mutbl: mutability}, tt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ast::ExprRepeat(element, count_expr, mutbl) => {
|
ast::ExprRepeat(element, count_expr) => {
|
||||||
check_expr_with_hint(fcx, count_expr, ty::mk_uint());
|
check_expr_with_hint(fcx, count_expr, ty::mk_uint());
|
||||||
let _ = ty::eval_repeat_count(fcx, count_expr);
|
let _ = ty::eval_repeat_count(fcx, count_expr);
|
||||||
let tt = ast_expr_vstore_to_vstore(fcx, ev, vst);
|
let tt = ast_expr_vstore_to_vstore(fcx, ev, vst);
|
||||||
let mutability = match vst {
|
let mutability = match vst {
|
||||||
ast::ExprVstoreMutSlice => ast::MutMutable,
|
ast::ExprVstoreMutSlice => ast::MutMutable,
|
||||||
_ => mutbl,
|
_ => ast::MutImmutable,
|
||||||
};
|
};
|
||||||
let t: ty::t = fcx.infcx().next_ty_var();
|
let t: ty::t = fcx.infcx().next_ty_var();
|
||||||
check_expr_has_type(fcx, element, t);
|
check_expr_has_type(fcx, element, t);
|
||||||
|
@ -3017,16 +3017,16 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
|
||||||
fcx.write_ty(id, t_1);
|
fcx.write_ty(id, t_1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ast::ExprVec(ref args, mutbl) => {
|
ast::ExprVec(ref args) => {
|
||||||
let t: ty::t = fcx.infcx().next_ty_var();
|
let t: ty::t = fcx.infcx().next_ty_var();
|
||||||
for e in args.iter() {
|
for e in args.iter() {
|
||||||
check_expr_has_type(fcx, *e, t);
|
check_expr_has_type(fcx, *e, t);
|
||||||
}
|
}
|
||||||
let typ = ty::mk_vec(tcx, ty::mt {ty: t, mutbl: mutbl},
|
let typ = ty::mk_vec(tcx, ty::mt {ty: t, mutbl: ast::MutImmutable},
|
||||||
ty::vstore_fixed(args.len()));
|
ty::vstore_fixed(args.len()));
|
||||||
fcx.write_ty(id, typ);
|
fcx.write_ty(id, typ);
|
||||||
}
|
}
|
||||||
ast::ExprRepeat(element, count_expr, mutbl) => {
|
ast::ExprRepeat(element, count_expr) => {
|
||||||
check_expr_with_hint(fcx, count_expr, ty::mk_uint());
|
check_expr_with_hint(fcx, count_expr, ty::mk_uint());
|
||||||
let count = ty::eval_repeat_count(fcx, count_expr);
|
let count = ty::eval_repeat_count(fcx, count_expr);
|
||||||
let t: ty::t = fcx.infcx().next_ty_var();
|
let t: ty::t = fcx.infcx().next_ty_var();
|
||||||
|
@ -3039,7 +3039,7 @@ fn check_expr_with_unifier(fcx: &FnCtxt,
|
||||||
fcx.write_bot(id);
|
fcx.write_bot(id);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let t = ty::mk_vec(tcx, ty::mt {ty: t, mutbl: mutbl},
|
let t = ty::mk_vec(tcx, ty::mt {ty: t, mutbl: ast::MutImmutable},
|
||||||
ty::vstore_fixed(count));
|
ty::vstore_fixed(count));
|
||||||
fcx.write_ty(id, t);
|
fcx.write_ty(id, t);
|
||||||
}
|
}
|
||||||
|
@ -3864,7 +3864,7 @@ pub fn ast_expr_vstore_to_vstore(fcx: &FnCtxt,
|
||||||
// string literals and *empty slices* live in static memory
|
// string literals and *empty slices* live in static memory
|
||||||
ty::vstore_slice(ty::ReStatic)
|
ty::vstore_slice(ty::ReStatic)
|
||||||
}
|
}
|
||||||
ast::ExprVec(ref elements, _) if elements.len() == 0 => {
|
ast::ExprVec(ref elements) if elements.len() == 0 => {
|
||||||
// string literals and *empty slices* live in static memory
|
// string literals and *empty slices* live in static memory
|
||||||
ty::vstore_slice(ty::ReStatic)
|
ty::vstore_slice(ty::ReStatic)
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,9 +57,7 @@
|
||||||
// Don't link to std. We are std.
|
// Don't link to std. We are std.
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
|
||||||
// #![deny(missing_doc)] // NOTE: uncomment after a stage0 snap
|
#![deny(missing_doc)]
|
||||||
#![allow(missing_doc)] // NOTE: remove after a stage0 snap
|
|
||||||
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
|
|
||||||
#![allow(unknown_features)] // NOTE: remove after a stage0 snap
|
#![allow(unknown_features)] // NOTE: remove after a stage0 snap
|
||||||
|
|
||||||
// When testing libstd, bring in libuv as the I/O backend so tests can print
|
// When testing libstd, bring in libuv as the I/O backend so tests can print
|
||||||
|
|
|
@ -15,7 +15,7 @@ use cmp::{Ord, Eq, Ordering, TotalEq, TotalOrd};
|
||||||
use container::{Container, Mutable};
|
use container::{Container, Mutable};
|
||||||
use default::Default;
|
use default::Default;
|
||||||
use fmt;
|
use fmt;
|
||||||
use iter::{DoubleEndedIterator, FromIterator, Extendable, Iterator};
|
use iter::{DoubleEndedIterator, FromIterator, Extendable, Iterator, range};
|
||||||
use libc::{free, c_void};
|
use libc::{free, c_void};
|
||||||
use mem::{size_of, move_val_init};
|
use mem::{size_of, move_val_init};
|
||||||
use mem;
|
use mem;
|
||||||
|
@ -1135,6 +1135,56 @@ impl<T> Vec<T> {
|
||||||
pub fn as_mut_ptr(&mut self) -> *mut T {
|
pub fn as_mut_ptr(&mut self) -> *mut T {
|
||||||
self.as_mut_slice().as_mut_ptr()
|
self.as_mut_slice().as_mut_ptr()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Retains only the elements specified by the predicate.
|
||||||
|
///
|
||||||
|
/// In other words, remove all elements `e` such that `f(&e)` returns false.
|
||||||
|
/// This method operates in place and preserves the order the retained elements.
|
||||||
|
///
|
||||||
|
/// # Example
|
||||||
|
///
|
||||||
|
/// ```rust
|
||||||
|
/// let mut vec = vec!(1i, 2, 3, 4);
|
||||||
|
/// vec.retain(|x| x%2 == 0);
|
||||||
|
/// assert_eq!(vec, vec!(2, 4));
|
||||||
|
/// ```
|
||||||
|
pub fn retain(&mut self, f: |&T| -> bool) {
|
||||||
|
let len = self.len();
|
||||||
|
let mut del = 0u;
|
||||||
|
{
|
||||||
|
let v = self.as_mut_slice();
|
||||||
|
|
||||||
|
for i in range(0u, len) {
|
||||||
|
if !f(&v[i]) {
|
||||||
|
del += 1;
|
||||||
|
} else if del > 0 {
|
||||||
|
v.swap(i-del, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if del > 0 {
|
||||||
|
self.truncate(len - del);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Expands a vector in place, initializing the new elements to the result of a function.
|
||||||
|
///
|
||||||
|
/// The vector is grown by `n` elements. The i-th new element are initialized to the value
|
||||||
|
/// returned by `f(i)` where `i` is in the range [0, n).
|
||||||
|
///
|
||||||
|
/// # Example
|
||||||
|
///
|
||||||
|
/// ```rust
|
||||||
|
/// let mut vec = vec!(0u, 1);
|
||||||
|
/// vec.grow_fn(3, |i| i);
|
||||||
|
/// assert_eq!(vec, vec!(0, 1, 0, 1, 2));
|
||||||
|
/// ```
|
||||||
|
pub fn grow_fn(&mut self, n: uint, f: |uint| -> T) {
|
||||||
|
self.reserve_additional(n);
|
||||||
|
for i in range(0u, n) {
|
||||||
|
self.push(f(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T:TotalOrd> Vec<T> {
|
impl<T:TotalOrd> Vec<T> {
|
||||||
|
@ -1523,4 +1573,17 @@ mod tests {
|
||||||
v.clone_from(&three);
|
v.clone_from(&three);
|
||||||
assert_eq!(v, three)
|
assert_eq!(v, three)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn test_grow_fn() {
|
||||||
|
let mut v = Vec::from_slice([0u, 1]);
|
||||||
|
v.grow_fn(3, |i| i);
|
||||||
|
assert!(v == Vec::from_slice([0u, 1, 0, 1, 2]));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_retain() {
|
||||||
|
let mut vec = Vec::from_slice([1u, 2, 3, 4]);
|
||||||
|
vec.retain(|x| x%2 == 0);
|
||||||
|
assert!(vec == Vec::from_slice([2u, 4]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,9 +22,7 @@
|
||||||
#![feature(phase)]
|
#![feature(phase)]
|
||||||
#![deny(deprecated_owned_vector)]
|
#![deny(deprecated_owned_vector)]
|
||||||
|
|
||||||
// #![deny(missing_doc)] // NOTE: uncomment after a stage0 snap
|
#![deny(missing_doc)]
|
||||||
#![allow(missing_doc)] // NOTE: remove after a stage0 snap
|
|
||||||
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[phase(syntax, link)] extern crate log;
|
#[phase(syntax, link)] extern crate log;
|
||||||
|
|
|
@ -493,7 +493,7 @@ pub enum Expr_ {
|
||||||
ExprVstore(@Expr, ExprVstore),
|
ExprVstore(@Expr, ExprVstore),
|
||||||
// First expr is the place; second expr is the value.
|
// First expr is the place; second expr is the value.
|
||||||
ExprBox(@Expr, @Expr),
|
ExprBox(@Expr, @Expr),
|
||||||
ExprVec(Vec<@Expr>, Mutability),
|
ExprVec(Vec<@Expr>),
|
||||||
ExprCall(@Expr, Vec<@Expr>),
|
ExprCall(@Expr, Vec<@Expr>),
|
||||||
ExprMethodCall(Ident, Vec<P<Ty>>, Vec<@Expr>),
|
ExprMethodCall(Ident, Vec<P<Ty>>, Vec<@Expr>),
|
||||||
ExprTup(Vec<@Expr>),
|
ExprTup(Vec<@Expr>),
|
||||||
|
@ -536,7 +536,7 @@ pub enum Expr_ {
|
||||||
ExprStruct(Path, Vec<Field> , Option<@Expr> /* base */),
|
ExprStruct(Path, Vec<Field> , Option<@Expr> /* base */),
|
||||||
|
|
||||||
// A vector literal constructed from one repeated element.
|
// A vector literal constructed from one repeated element.
|
||||||
ExprRepeat(@Expr /* element */, @Expr /* count */, Mutability),
|
ExprRepeat(@Expr /* element */, @Expr /* count */),
|
||||||
|
|
||||||
// No-op: used solely so we can pretty-print faithfully
|
// No-op: used solely so we can pretty-print faithfully
|
||||||
ExprParen(@Expr)
|
ExprParen(@Expr)
|
||||||
|
|
|
@ -579,7 +579,7 @@ impl<'a> AstBuilder for ExtCtxt<'a> {
|
||||||
self.expr(sp, ast::ExprVstore(expr, vst))
|
self.expr(sp, ast::ExprVstore(expr, vst))
|
||||||
}
|
}
|
||||||
fn expr_vec(&self, sp: Span, exprs: Vec<@ast::Expr> ) -> @ast::Expr {
|
fn expr_vec(&self, sp: Span, exprs: Vec<@ast::Expr> ) -> @ast::Expr {
|
||||||
self.expr(sp, ast::ExprVec(exprs, ast::MutImmutable))
|
self.expr(sp, ast::ExprVec(exprs))
|
||||||
}
|
}
|
||||||
fn expr_vec_ng(&self, sp: Span) -> @ast::Expr {
|
fn expr_vec_ng(&self, sp: Span) -> @ast::Expr {
|
||||||
self.expr_call_global(sp,
|
self.expr_call_global(sp,
|
||||||
|
|
|
@ -740,11 +740,11 @@ pub fn noop_fold_expr<T: Folder>(e: @Expr, folder: &mut T) -> @Expr {
|
||||||
ExprBox(p, e) => {
|
ExprBox(p, e) => {
|
||||||
ExprBox(folder.fold_expr(p), folder.fold_expr(e))
|
ExprBox(folder.fold_expr(p), folder.fold_expr(e))
|
||||||
}
|
}
|
||||||
ExprVec(ref exprs, mutt) => {
|
ExprVec(ref exprs) => {
|
||||||
ExprVec(exprs.iter().map(|&x| folder.fold_expr(x)).collect(), mutt)
|
ExprVec(exprs.iter().map(|&x| folder.fold_expr(x)).collect())
|
||||||
}
|
}
|
||||||
ExprRepeat(expr, count, mutt) => {
|
ExprRepeat(expr, count) => {
|
||||||
ExprRepeat(folder.fold_expr(expr), folder.fold_expr(count), mutt)
|
ExprRepeat(folder.fold_expr(expr), folder.fold_expr(count))
|
||||||
}
|
}
|
||||||
ExprTup(ref elts) => ExprTup(elts.iter().map(|x| folder.fold_expr(*x)).collect()),
|
ExprTup(ref elts) => ExprTup(elts.iter().map(|x| folder.fold_expr(*x)).collect()),
|
||||||
ExprCall(f, ref args) => {
|
ExprCall(f, ref args) => {
|
||||||
|
|
|
@ -30,8 +30,6 @@ This API is completely unstable and subject to change.
|
||||||
quote)]
|
quote)]
|
||||||
#![allow(deprecated)]
|
#![allow(deprecated)]
|
||||||
|
|
||||||
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
|
|
||||||
|
|
||||||
extern crate serialize;
|
extern crate serialize;
|
||||||
extern crate term;
|
extern crate term;
|
||||||
extern crate collections;
|
extern crate collections;
|
||||||
|
|
|
@ -1819,12 +1819,11 @@ impl<'a> Parser<'a> {
|
||||||
return self.parse_block_expr(lo, UnsafeBlock(ast::UserProvided));
|
return self.parse_block_expr(lo, UnsafeBlock(ast::UserProvided));
|
||||||
} else if self.token == token::LBRACKET {
|
} else if self.token == token::LBRACKET {
|
||||||
self.bump();
|
self.bump();
|
||||||
let mutbl = MutImmutable;
|
|
||||||
|
|
||||||
if self.token == token::RBRACKET {
|
if self.token == token::RBRACKET {
|
||||||
// Empty vector.
|
// Empty vector.
|
||||||
self.bump();
|
self.bump();
|
||||||
ex = ExprVec(Vec::new(), mutbl);
|
ex = ExprVec(Vec::new());
|
||||||
} else {
|
} else {
|
||||||
// Nonempty vector.
|
// Nonempty vector.
|
||||||
let first_expr = self.parse_expr();
|
let first_expr = self.parse_expr();
|
||||||
|
@ -1835,7 +1834,7 @@ impl<'a> Parser<'a> {
|
||||||
self.bump();
|
self.bump();
|
||||||
let count = self.parse_expr();
|
let count = self.parse_expr();
|
||||||
self.expect(&token::RBRACKET);
|
self.expect(&token::RBRACKET);
|
||||||
ex = ExprRepeat(first_expr, count, mutbl);
|
ex = ExprRepeat(first_expr, count);
|
||||||
} else if self.token == token::COMMA {
|
} else if self.token == token::COMMA {
|
||||||
// Vector with two or more elements.
|
// Vector with two or more elements.
|
||||||
self.bump();
|
self.bump();
|
||||||
|
@ -1846,11 +1845,11 @@ impl<'a> Parser<'a> {
|
||||||
);
|
);
|
||||||
let mut exprs = vec!(first_expr);
|
let mut exprs = vec!(first_expr);
|
||||||
exprs.push_all_move(remaining_exprs);
|
exprs.push_all_move(remaining_exprs);
|
||||||
ex = ExprVec(exprs, mutbl);
|
ex = ExprVec(exprs);
|
||||||
} else {
|
} else {
|
||||||
// Vector with one element.
|
// Vector with one element.
|
||||||
self.expect(&token::RBRACKET);
|
self.expect(&token::RBRACKET);
|
||||||
ex = ExprVec(vec!(first_expr), mutbl);
|
ex = ExprVec(vec!(first_expr));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hi = self.last_span.hi;
|
hi = self.last_span.hi;
|
||||||
|
|
|
@ -915,9 +915,6 @@ impl<'a> State<'a> {
|
||||||
match attr.node.style {
|
match attr.node.style {
|
||||||
ast::AttrInner => {
|
ast::AttrInner => {
|
||||||
try!(self.print_attribute(attr));
|
try!(self.print_attribute(attr));
|
||||||
if !attr.node.is_sugared_doc {
|
|
||||||
try!(word(&mut self.s, ";"));
|
|
||||||
}
|
|
||||||
count += 1;
|
count += 1;
|
||||||
}
|
}
|
||||||
_ => {/* fallthrough */ }
|
_ => {/* fallthrough */ }
|
||||||
|
@ -935,7 +932,10 @@ impl<'a> State<'a> {
|
||||||
if attr.node.is_sugared_doc {
|
if attr.node.is_sugared_doc {
|
||||||
word(&mut self.s, attr.value_str().unwrap().get())
|
word(&mut self.s, attr.value_str().unwrap().get())
|
||||||
} else {
|
} else {
|
||||||
try!(word(&mut self.s, "#["));
|
match attr.node.style {
|
||||||
|
ast::AttrInner => try!(word(&mut self.s, "#![")),
|
||||||
|
ast::AttrOuter => try!(word(&mut self.s, "#[")),
|
||||||
|
}
|
||||||
try!(self.print_meta_item(attr.meta()));
|
try!(self.print_meta_item(attr.meta()));
|
||||||
word(&mut self.s, "]")
|
word(&mut self.s, "]")
|
||||||
}
|
}
|
||||||
|
@ -1110,25 +1110,17 @@ impl<'a> State<'a> {
|
||||||
try!(self.word_space(")"));
|
try!(self.word_space(")"));
|
||||||
try!(self.print_expr(e));
|
try!(self.print_expr(e));
|
||||||
}
|
}
|
||||||
ast::ExprVec(ref exprs, mutbl) => {
|
ast::ExprVec(ref exprs) => {
|
||||||
try!(self.ibox(indent_unit));
|
try!(self.ibox(indent_unit));
|
||||||
try!(word(&mut self.s, "["));
|
try!(word(&mut self.s, "["));
|
||||||
if mutbl == ast::MutMutable {
|
|
||||||
try!(word(&mut self.s, "mut"));
|
|
||||||
if exprs.len() > 0u { try!(self.nbsp()); }
|
|
||||||
}
|
|
||||||
try!(self.commasep_exprs(Inconsistent, exprs.as_slice()));
|
try!(self.commasep_exprs(Inconsistent, exprs.as_slice()));
|
||||||
try!(word(&mut self.s, "]"));
|
try!(word(&mut self.s, "]"));
|
||||||
try!(self.end());
|
try!(self.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
ast::ExprRepeat(element, count, mutbl) => {
|
ast::ExprRepeat(element, count) => {
|
||||||
try!(self.ibox(indent_unit));
|
try!(self.ibox(indent_unit));
|
||||||
try!(word(&mut self.s, "["));
|
try!(word(&mut self.s, "["));
|
||||||
if mutbl == ast::MutMutable {
|
|
||||||
try!(word(&mut self.s, "mut"));
|
|
||||||
try!(self.nbsp());
|
|
||||||
}
|
|
||||||
try!(self.print_expr(element));
|
try!(self.print_expr(element));
|
||||||
try!(word(&mut self.s, ","));
|
try!(word(&mut self.s, ","));
|
||||||
try!(word(&mut self.s, ".."));
|
try!(word(&mut self.s, ".."));
|
||||||
|
|
|
@ -635,10 +635,10 @@ pub fn walk_expr<E: Clone, V: Visitor<E>>(visitor: &mut V, expression: &Expr, en
|
||||||
visitor.visit_expr(place, env.clone());
|
visitor.visit_expr(place, env.clone());
|
||||||
visitor.visit_expr(subexpression, env.clone())
|
visitor.visit_expr(subexpression, env.clone())
|
||||||
}
|
}
|
||||||
ExprVec(ref subexpressions, _) => {
|
ExprVec(ref subexpressions) => {
|
||||||
walk_exprs(visitor, subexpressions.as_slice(), env.clone())
|
walk_exprs(visitor, subexpressions.as_slice(), env.clone())
|
||||||
}
|
}
|
||||||
ExprRepeat(element, count, _) => {
|
ExprRepeat(element, count) => {
|
||||||
visitor.visit_expr(element, env.clone());
|
visitor.visit_expr(element, env.clone());
|
||||||
visitor.visit_expr(count, env.clone())
|
visitor.visit_expr(count, env.clone())
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,9 +21,7 @@
|
||||||
|
|
||||||
#![feature(macro_rules)]
|
#![feature(macro_rules)]
|
||||||
|
|
||||||
// #![deny(missing_doc)] // NOTE: uncomment after a stage0 snap
|
#![deny(missing_doc)]
|
||||||
#![allow(missing_doc)] // NOTE: remove after a stage0 snap
|
|
||||||
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
|
|
||||||
|
|
||||||
extern crate collections;
|
extern crate collections;
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
S 2014-04-03 e7fe207
|
||||||
|
freebsd-x86_64 6d40f547d13896ab9d9dd4a4fdf2e72be553b01b
|
||||||
|
linux-i386 875a8f6956f7d703f7206db91ca2a9b67c244cf8
|
||||||
|
linux-x86_64 4d90df12231d1c9f51b5ae6e75546ccddcf0534b
|
||||||
|
macos-i386 e5486efa1356abca8f8d5cac9aa6135c9626ab51
|
||||||
|
macos-x86_64 8341419e4295d780f72950cfe2187195d0d03e83
|
||||||
|
winnt-i386 60c2fb349ac8a7ad30c9ba2518a61e669debb7bf
|
||||||
|
|
||||||
S 2014-03-28 b8601a3
|
S 2014-03-28 b8601a3
|
||||||
freebsd-x86_64 c6b0651b2a90697754920ad381c13f9b7942ab47
|
freebsd-x86_64 c6b0651b2a90697754920ad381c13f9b7942ab47
|
||||||
linux-i386 3bef5684fd0582fbd4ddebd4514182d4f72924f7
|
linux-i386 3bef5684fd0582fbd4ddebd4514182d4f72924f7
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#[crate_type = "lib"];
|
#![crate_type = "lib"]
|
||||||
|
|
||||||
pub struct Fish {
|
pub struct Fish {
|
||||||
pub x: int
|
pub x: int
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
// file at the top-level directory of this distribution and at
|
// file at the top-level directory of this distribution and at
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
//
|
//
|
||||||
|
@ -9,7 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#[allow(unused_imports)];
|
#[allow(unused_imports)];
|
||||||
#[feature(globs)];
|
#![feature(globs)]
|
||||||
|
|
||||||
extern crate issue_2316_a;
|
extern crate issue_2316_a;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
// file at the top-level directory of this distribution and at
|
// file at the top-level directory of this distribution and at
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
//
|
//
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
#[phase(syntax, link)] extern crate log;
|
#[phase(syntax, link)] extern crate log;
|
||||||
|
|
||||||
pub fn foo<T>() {
|
pub fn foo<T>() {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
// file at the top-level directory of this distribution and at
|
// file at the top-level directory of this distribution and at
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
//
|
//
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// error-pattern: unresolved name
|
// error-pattern: unresolved name
|
||||||
|
|
||||||
#[feature(globs)];
|
#![feature(globs)]
|
||||||
|
|
||||||
use module_of_many_things::*;
|
use module_of_many_things::*;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
// file at the top-level directory of this distribution and at
|
// file at the top-level directory of this distribution and at
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
//
|
//
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// error-pattern: unresolved
|
// error-pattern: unresolved
|
||||||
|
|
||||||
#[feature(globs)];
|
#![feature(globs)]
|
||||||
|
|
||||||
mod circ1 {
|
mod circ1 {
|
||||||
pub use circ2::f2;
|
pub use circ2::f2;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
// file at the top-level directory of this distribution and at
|
// file at the top-level directory of this distribution and at
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
//
|
//
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#[feature(globs)];
|
#![feature(globs)]
|
||||||
|
|
||||||
// error-pattern:declaration of `None` shadows
|
// error-pattern:declaration of `None` shadows
|
||||||
use std::option::*;
|
use std::option::*;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// ignore-test Can't use syntax crate here
|
// ignore-test Can't use syntax crate here
|
||||||
|
|
||||||
#[feature(quote)];
|
#![feature(quote)]
|
||||||
|
|
||||||
extern crate syntax;
|
extern crate syntax;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// ignore-test Can't use syntax crate here
|
// ignore-test Can't use syntax crate here
|
||||||
|
|
||||||
#[feature(quote)];
|
#![feature(quote)]
|
||||||
|
|
||||||
extern crate syntax;
|
extern crate syntax;
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
|
|
||||||
// debugger:continue
|
// debugger:continue
|
||||||
|
|
||||||
#[allow(experimental)];
|
#![allow(experimental)]
|
||||||
#[allow(unused_variable)];
|
#[allow(unused_variable)];
|
||||||
|
|
||||||
use std::unstable::simd::{i8x16, i16x8,i32x4,i64x2,u8x16,u16x8,u32x4,u64x2,f32x4,f64x2};
|
use std::unstable::simd::{i8x16, i16x8,i32x4,i64x2,u8x16,u16x8,u32x4,u64x2,f32x4,f64x2};
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
// accidentally carried over to each inner function
|
// accidentally carried over to each inner function
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
#[inner_attr];
|
#![inner_attr]
|
||||||
#[outer_attr]
|
#[outer_attr]
|
||||||
fn f() { }
|
fn f() { }
|
||||||
|
|
||||||
|
|
|
@ -57,5 +57,5 @@ fn f() { }
|
||||||
fn g() { }
|
fn g() { }
|
||||||
|
|
||||||
fn h() {
|
fn h() {
|
||||||
#[doc = "as do inner ones"];
|
#![doc = "as do inner ones"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// ignore-fast #[feature] doesn't work with check-fast
|
// ignore-fast #[feature] doesn't work with check-fast
|
||||||
// pp-exact
|
// pp-exact
|
||||||
|
|
||||||
#[feature(asm)];
|
#![feature(asm)]
|
||||||
|
|
||||||
#[cfg = r#"just parse this"#]
|
#[cfg = r#"just parse this"#]
|
||||||
extern crate blah = r##"blah"##;
|
extern crate blah = r##"blah"##;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
// file at the top-level directory of this distribution and at
|
// file at the top-level directory of this distribution and at
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
//
|
//
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
// Issue #7580
|
// Issue #7580
|
||||||
|
|
||||||
// error-pattern:fail works
|
// error-pattern:fail works
|
||||||
#[feature(globs)];
|
#![feature(globs)]
|
||||||
|
|
||||||
use std::*;
|
use std::*;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
// file at the top-level directory of this distribution and at
|
// file at the top-level directory of this distribution and at
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
//
|
//
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// error-pattern:whatever
|
// error-pattern:whatever
|
||||||
|
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
#[phase(syntax, link)] extern crate log;
|
#[phase(syntax, link)] extern crate log;
|
||||||
use std::os;
|
use std::os;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
// file at the top-level directory of this distribution and at
|
// file at the top-level directory of this distribution and at
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
//
|
//
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// error-pattern:whatever
|
// error-pattern:whatever
|
||||||
|
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
#[phase(syntax, link)] extern crate log;
|
#[phase(syntax, link)] extern crate log;
|
||||||
use std::os;
|
use std::os;
|
||||||
use std::task;
|
use std::task;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
// file at the top-level directory of this distribution and at
|
// file at the top-level directory of this distribution and at
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
//
|
//
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// error-pattern:whatever
|
// error-pattern:whatever
|
||||||
|
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
#[phase(syntax, link)] extern crate log;
|
#[phase(syntax, link)] extern crate log;
|
||||||
use std::os;
|
use std::os;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
// ignore-android
|
// ignore-android
|
||||||
// ignore-cross-compile #12102
|
// ignore-cross-compile #12102
|
||||||
|
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
|
|
||||||
#[phase(syntax)]
|
#[phase(syntax)]
|
||||||
extern crate macro_crate_outlive_expansion_phase;
|
extern crate macro_crate_outlive_expansion_phase;
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
// ignore-android
|
// ignore-android
|
||||||
// ignore-cross-compile #12102
|
// ignore-cross-compile #12102
|
||||||
|
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
|
|
||||||
#[phase(syntax)]
|
#[phase(syntax)]
|
||||||
extern crate macro_crate_test;
|
extern crate macro_crate_test;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
// can't run host binaries, and force-host to make this test build as the host
|
// can't run host binaries, and force-host to make this test build as the host
|
||||||
// arch.
|
// arch.
|
||||||
|
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
|
|
||||||
#[phase(syntax, link)]
|
#[phase(syntax, link)]
|
||||||
extern crate macro_crate_test;
|
extern crate macro_crate_test;
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// ignore-pretty
|
// ignore-pretty
|
||||||
// ignore-test
|
// ignore-test
|
||||||
|
|
||||||
#[feature(quote)];
|
#![feature(quote)]
|
||||||
|
|
||||||
extern crate syntax;
|
extern crate syntax;
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// ignore-test
|
// ignore-test
|
||||||
|
|
||||||
#[feature(quote)];
|
#![feature(quote)]
|
||||||
#[feature(managed_boxes)];
|
#[feature(managed_boxes)];
|
||||||
|
|
||||||
extern crate syntax;
|
extern crate syntax;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// ignore-fast
|
// ignore-fast
|
||||||
// ignore-android
|
// ignore-android
|
||||||
#[feature(quote)];
|
#![feature(quote)]
|
||||||
#[deny(unused_variable)];
|
#[deny(unused_variable)];
|
||||||
|
|
||||||
extern crate syntax;
|
extern crate syntax;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// ignore-pretty
|
// ignore-pretty
|
||||||
// ignore-cross-compile
|
// ignore-cross-compile
|
||||||
|
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
|
|
||||||
#[phase(syntax)]
|
#[phase(syntax)]
|
||||||
extern crate fourcc;
|
extern crate fourcc;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// ignore-cross-compile #12102
|
// ignore-cross-compile #12102
|
||||||
// ignore-fast
|
// ignore-fast
|
||||||
|
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
#[phase(syntax)]
|
#[phase(syntax)]
|
||||||
extern crate hexfloat;
|
extern crate hexfloat;
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// ignore-fast #[feature] doesn't work with check-fast
|
// ignore-fast #[feature] doesn't work with check-fast
|
||||||
#[feature(asm)];
|
#![feature(asm)]
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
unsafe { asm!(concat!("", "")) };
|
unsafe { asm!(concat!("", "")) };
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// ignore-fast #[feature] doesn't work with check-fast
|
// ignore-fast #[feature] doesn't work with check-fast
|
||||||
#[feature(asm)];
|
#![feature(asm)]
|
||||||
|
|
||||||
#[cfg(target_arch = "x86")]
|
#[cfg(target_arch = "x86")]
|
||||||
#[cfg(target_arch = "x86_64")]
|
#[cfg(target_arch = "x86_64")]
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// ignore-fast #[feature] doesn't work with check-fast
|
// ignore-fast #[feature] doesn't work with check-fast
|
||||||
#[feature(asm)];
|
#![feature(asm)]
|
||||||
|
|
||||||
#[cfg(target_arch = "x86")]
|
#[cfg(target_arch = "x86")]
|
||||||
#[cfg(target_arch = "x86_64")]
|
#[cfg(target_arch = "x86_64")]
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// ignore-android (FIXME #11419)
|
// ignore-android (FIXME #11419)
|
||||||
// exec-env:RUST_LOG=info
|
// exec-env:RUST_LOG=info
|
||||||
|
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
|
|
||||||
#[phase(syntax, link)]
|
#[phase(syntax, link)]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// compile-flags: --cfg ndebug
|
// compile-flags: --cfg ndebug
|
||||||
// exec-env:RUST_LOG=conditional-debug-macro-off=4
|
// exec-env:RUST_LOG=conditional-debug-macro-off=4
|
||||||
|
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
#[phase(syntax, link)]
|
#[phase(syntax, link)]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
// Modified to not use export since it's going away. --pcw
|
// Modified to not use export since it's going away. --pcw
|
||||||
|
|
||||||
#[feature(globs)];
|
#![feature(globs)]
|
||||||
|
|
||||||
mod foo {
|
mod foo {
|
||||||
use foo::bar::*;
|
use foo::bar::*;
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// ignore-fast: check-fast screws up repr paths
|
// ignore-fast: check-fast screws up repr paths
|
||||||
|
|
||||||
#[feature(macro_rules)];
|
#[feature(macro_rules)];
|
||||||
#[deny(warnings)];
|
#![deny(warnings)]
|
||||||
#[allow(unused_must_use)];
|
#[allow(unused_must_use)];
|
||||||
#[allow(deprecated_owned_vector)];
|
#[allow(deprecated_owned_vector)];
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#[feature(globs)];
|
#![feature(globs)]
|
||||||
|
|
||||||
use module_of_many_things::*;
|
use module_of_many_things::*;
|
||||||
use dug::too::greedily::and::too::deep::*;
|
use dug::too::greedily::and::too::deep::*;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#[feature(globs)];
|
#![feature(globs)]
|
||||||
#[allow(dead_assignment)];
|
#[allow(dead_assignment)];
|
||||||
|
|
||||||
use std::mem::*;
|
use std::mem::*;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
// file at the top-level directory of this distribution and at
|
// file at the top-level directory of this distribution and at
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
//
|
//
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#[feature(globs)];
|
#![feature(globs)]
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
use std::mem::replace;
|
use std::mem::replace;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#[feature(globs)];
|
#![feature(globs)]
|
||||||
|
|
||||||
mod rusti {
|
mod rusti {
|
||||||
extern "rust-intrinsic" {
|
extern "rust-intrinsic" {
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// ignore-fast
|
// ignore-fast
|
||||||
// aux-build:issue-2526.rs
|
// aux-build:issue-2526.rs
|
||||||
|
|
||||||
#[feature(globs)];
|
#![feature(globs)]
|
||||||
#[allow(unused_imports)];
|
#[allow(unused_imports)];
|
||||||
|
|
||||||
extern crate issue_2526;
|
extern crate issue_2526;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
// file at the top-level directory of this distribution and at
|
// file at the top-level directory of this distribution and at
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
//
|
//
|
||||||
|
@ -160,7 +160,7 @@ mod test_foreign_items {
|
||||||
use std::libc;
|
use std::libc;
|
||||||
|
|
||||||
extern {
|
extern {
|
||||||
#[attr];
|
#![attr]
|
||||||
|
|
||||||
#[attr]
|
#[attr]
|
||||||
fn rust_get_test_int() -> libc::intptr_t;
|
fn rust_get_test_int() -> libc::intptr_t;
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
// ignore-macos
|
// ignore-macos
|
||||||
// aux-build:linkage1.rs
|
// aux-build:linkage1.rs
|
||||||
|
|
||||||
#[feature(linkage)];
|
#![feature(linkage)]
|
||||||
|
|
||||||
extern crate other = "linkage1";
|
extern crate other = "linkage1";
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
// compile-flags:--cfg ndebug
|
// compile-flags:--cfg ndebug
|
||||||
// exec-env:RUST_LOG=logging-enabled-debug=debug
|
// exec-env:RUST_LOG=logging-enabled-debug=debug
|
||||||
|
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
#[phase(syntax, link)]
|
#[phase(syntax, link)]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// ignore-fast
|
// ignore-fast
|
||||||
// exec-env:RUST_LOG=logging-enabled=info
|
// exec-env:RUST_LOG=logging-enabled=info
|
||||||
|
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
#[phase(syntax, link)]
|
#[phase(syntax, link)]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
// aux-build:macro_crate_def_only.rs
|
// aux-build:macro_crate_def_only.rs
|
||||||
// ignore-fast
|
// ignore-fast
|
||||||
|
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
|
|
||||||
#[phase(syntax)]
|
#[phase(syntax)]
|
||||||
extern crate macro_crate_def_only;
|
extern crate macro_crate_def_only;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
//ignore-stage1
|
//ignore-stage1
|
||||||
//ignore-fast
|
//ignore-fast
|
||||||
|
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
|
|
||||||
#[phase(syntax)]
|
#[phase(syntax)]
|
||||||
extern crate macro_export_inner_module;
|
extern crate macro_export_inner_module;
|
||||||
|
|
|
@ -22,12 +22,12 @@ trait frobable {
|
||||||
impl frobable for int {
|
impl frobable for int {
|
||||||
#[frob_attr1]
|
#[frob_attr1]
|
||||||
fn frob(&self) {
|
fn frob(&self) {
|
||||||
#[frob_attr2];
|
#![frob_attr2]
|
||||||
}
|
}
|
||||||
|
|
||||||
#[defrob_attr1]
|
#[defrob_attr1]
|
||||||
fn defrob(&self) {
|
fn defrob(&self) {
|
||||||
#[defrob_attr2];
|
#![defrob_attr2]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// ignore-fast
|
// ignore-fast
|
||||||
|
|
||||||
#[feature(asm)];
|
#![feature(asm)]
|
||||||
|
|
||||||
use std::io::Process;
|
use std::io::Process;
|
||||||
use std::os;
|
use std::os;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// ignore-fast
|
// ignore-fast
|
||||||
|
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
|
|
||||||
#[phase(syntax)]
|
#[phase(syntax)]
|
||||||
use std::mem;
|
use std::mem;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// Check we do the correct privacy checks when we import a name and there is an
|
// Check we do the correct privacy checks when we import a name and there is an
|
||||||
// item with that name in both the value and type namespaces.
|
// item with that name in both the value and type namespaces.
|
||||||
|
|
||||||
#[feature(globs)];
|
#![feature(globs)]
|
||||||
#[allow(dead_code)];
|
#[allow(dead_code)];
|
||||||
#[allow(unused_imports)];
|
#[allow(unused_imports)];
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#[feature(globs)];
|
#![feature(globs)]
|
||||||
|
|
||||||
// FIXME #3654
|
// FIXME #3654
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
// Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
// file at the top-level directory of this distribution and at
|
// file at the top-level directory of this distribution and at
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
//
|
//
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#[allow(experimental)];
|
#![allow(experimental)]
|
||||||
|
|
||||||
use std::unstable::simd::{i32x4, f32x4, u32x4};
|
use std::unstable::simd::{i32x4, f32x4, u32x4};
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// ignore-fast
|
// ignore-fast
|
||||||
|
|
||||||
#[feature(simd)];
|
#![feature(simd)]
|
||||||
|
|
||||||
use std::ops;
|
use std::ops;
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
|
|
||||||
// ignore-fast
|
// ignore-fast
|
||||||
|
|
||||||
#[allow(experimental)];
|
#![allow(experimental)]
|
||||||
#[feature(simd)];
|
#![feature(simd)]
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let _o = None::<std::unstable::simd::i32x4>;
|
let _o = None::<std::unstable::simd::i32x4>;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// ignore-fast feature doesn't work
|
// ignore-fast feature doesn't work
|
||||||
|
|
||||||
#[feature(simd)];
|
#![feature(simd)]
|
||||||
|
|
||||||
#[simd]
|
#[simd]
|
||||||
struct RGBA {
|
struct RGBA {
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
#[feature(globs)];
|
#![feature(globs)]
|
||||||
|
|
||||||
use alder::*;
|
use alder::*;
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// ignore-android needs extra network permissions
|
// ignore-android needs extra network permissions
|
||||||
// exec-env:RUST_LOG=debug
|
// exec-env:RUST_LOG=debug
|
||||||
|
|
||||||
#[feature(phase)];
|
#![feature(phase)]
|
||||||
#[phase(syntax, link)]
|
#[phase(syntax, link)]
|
||||||
extern crate log;
|
extern crate log;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
|
||||||
// file at the top-level directory of this distribution and at
|
// file at the top-level directory of this distribution and at
|
||||||
// http://rust-lang.org/COPYRIGHT.
|
// http://rust-lang.org/COPYRIGHT.
|
||||||
//
|
//
|
||||||
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
// compile-flags:-D ctypes
|
// compile-flags:-D ctypes
|
||||||
|
|
||||||
#[allow(ctypes)];
|
#![allow(ctypes)]
|
||||||
|
|
||||||
mod libc {
|
mod libc {
|
||||||
extern {
|
extern {
|
||||||
|
|
Loading…
Reference in New Issue