Skip to content

Commit d168316

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 167897 b: refs/heads/master c: 5172b80 h: refs/heads/master i: 167895: 8a4fe98 v: v3
1 parent 6748557 commit d168316

File tree

508 files changed

+8879
-2546
lines changed

Some content is hidden

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

508 files changed

+8879
-2546
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 7e3d1157246a13a7830431ce0253368029c8ee3e
2+
refs/heads/master: 5172b8046ac6e23c6f106df79dd8c887516896b6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c89417130f042c58adc60012e7cddc4ef70b70b9
55
refs/heads/try: 5204084bd2e46af7cc6e0147430e44dd0d657bbb

trunk/mk/crates.mk

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@
5050
################################################################################
5151

5252
TARGET_CRATES := libc std flate arena term \
53-
serialize getopts collections test rand \
53+
serialize getopts collections test time rand \
5454
log regex graphviz core rbml alloc \
5555
unicode
5656
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
5757
rustc_trans rustc_back rustc_llvm
58-
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros
58+
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc regex_macros fmt_macros
5959
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
6060
TOOLS := compiletest rustdoc rustc
6161

@@ -75,11 +75,11 @@ DEPS_rustc_typeck := rustc syntax
7575
DEPS_rustc_borrowck := rustc log graphviz syntax
7676
DEPS_rustc_resolve := rustc log syntax
7777
DEPS_rustc := syntax flate arena serialize getopts rbml \
78-
log graphviz rustc_llvm rustc_back
78+
time log graphviz rustc_llvm rustc_back
7979
DEPS_rustc_llvm := native:rustllvm libc std
8080
DEPS_rustc_back := std syntax rustc_llvm flate log libc
8181
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
82-
test
82+
test time
8383
DEPS_flate := std native:miniz
8484
DEPS_arena := std
8585
DEPS_graphviz := std
@@ -90,10 +90,12 @@ DEPS_term := std log
9090
DEPS_getopts := std
9191
DEPS_collections := core alloc unicode
9292
DEPS_num := std
93-
DEPS_test := std getopts serialize rbml term regex native:rust_test_helpers
93+
DEPS_test := std getopts serialize rbml term time regex native:rust_test_helpers
94+
DEPS_time := std serialize
9495
DEPS_rand := core
9596
DEPS_log := std regex
9697
DEPS_regex := std
98+
DEPS_regex_macros = rustc syntax std regex
9799
DEPS_fmt_macros = std
98100

99101
TOOL_DEPS_compiletest := test getopts
@@ -122,8 +124,10 @@ DOC_CRATES := $(filter-out rustc, \
122124
$(filter-out rustc_driver, \
123125
$(filter-out log, \
124126
$(filter-out regex, \
127+
$(filter-out regex_macros, \
125128
$(filter-out getopts, \
126-
$(filter-out syntax, $(CRATES)))))))))))
129+
$(filter-out time, \
130+
$(filter-out syntax, $(CRATES)))))))))))))
127131
COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_resolve \
128132
rustc_typeck rustc_driver syntax
129133

trunk/mk/grammar.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $(BG)RustLexer.class: $(BG) $(SG)RustLexer.g4
3737
check-build-lexer-verifier: $(BG)verify
3838

3939
ifeq ($(NO_REBUILD),)
40-
VERIFY_DEPS := rustc-stage2-H-$(CFG_BUILD) $(LD)stamp.rustc
40+
VERIFY_DEPS := rustc-stage2-H-$(CFG_BUILD) $(LD)stamp.regex_macros $(LD)stamp.rustc
4141
else
4242
VERIFY_DEPS :=
4343
endif

trunk/mk/tests.mk

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,15 @@ TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
373373
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
374374
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4))
375375

376+
# The regex crate depends on the regex_macros crate during testing, but it
377+
# notably depend on the *host* regex_macros crate, not the target version.
378+
# Additionally, this is not a dependency in stage1, only in stage2.
379+
ifeq ($(4),regex)
380+
ifneq ($(1),1)
381+
TESTDEP_$(1)_$(2)_$(3)_$(4) += $$(TLIB$(1)_T_$(3)_H_$(3))/stamp.regex_macros
382+
endif
383+
endif
384+
376385
else
377386
TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
378387
endif
@@ -834,8 +843,27 @@ else
834843
CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
835844
endif
836845

846+
# (Issues #13732, #13983, #14000) The doc for the regex crate includes
847+
# uses of the `regex!` macro from the regex_macros crate. There is
848+
# normally a dependence injected that makes the target's regex depend
849+
# upon the host's regex_macros (see #13845), but that dependency
850+
# injection is currently skipped for stage1 as a special case.
851+
#
852+
# Therefore, as a further special case, this conditional skips
853+
# attempting to run the doc tests for the regex crate atop stage1,
854+
# (since there is no regex_macros crate for the stage1 rustc to load).
855+
#
856+
# (Another approach for solving this would be to inject the desired
857+
# dependence for stage1 as well, by setting things up to generate a
858+
# regex_macros crate that was compatible with the stage1 rustc and
859+
# thus re-enable our ability to run this test.)
860+
ifeq (stage$(1)-crate-$(4),stage1-crate-regex)
861+
check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$(4)-exec:
862+
@$$(call E, skipping doc-crate-$(4) as it uses macros and cannot run at stage$(1))
863+
else
837864
check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$(4)-exec: \
838865
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4))
866+
endif
839867

840868
ifeq ($(2),$$(CFG_BUILD))
841869
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)): $$(CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4))

trunk/src/compiletest/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::fmt;
1313
use std::str::FromStr;
1414
use regex::Regex;
1515

16-
#[derive(Clone, PartialEq)]
16+
#[deriving(Clone, PartialEq)]
1717
pub enum Mode {
1818
CompileFail,
1919
RunFail,
@@ -59,7 +59,7 @@ impl fmt::Show for Mode {
5959
}
6060
}
6161

62-
#[derive(Clone)]
62+
#[deriving(Clone)]
6363
pub struct Config {
6464
// The library paths required for running the compiler
6565
pub compile_lib_path: String,

trunk/src/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extern crate regex;
2222
use std::os;
2323
use std::io;
2424
use std::io::fs;
25-
use std::str::FromStr;
25+
use std::str::{FromStr, from_str};
2626
use std::thunk::Thunk;
2727
use getopts::{optopt, optflag, reqopt};
2828
use common::Config;

trunk/src/compiletest/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub struct ExpectedError {
3030
pub static EXPECTED_PATTERN : &'static str =
3131
r"//~(?P<follow>\|)?(?P<adjusts>\^*)\s*(?P<kind>\S*)\s*(?P<msg>.*)";
3232

33-
#[derive(PartialEq, Show)]
33+
#[deriving(PartialEq, Show)]
3434
enum WhichLine { ThisLine, FollowPrevious(uint), AdjustBackward(uint) }
3535

3636
// Load any test directives embedded in the file

trunk/src/doc/reference.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,19 +1478,19 @@ Constants should in general be preferred over statics, unless large amounts of
14781478
data are being stored, or single-address and mutability properties are required.
14791479

14801480
```
1481-
use std::sync::atomic::{AtomicUint, Ordering, ATOMIC_UINT_INIT};;
1481+
use std::sync::atomic;
14821482
14831483
// Note that ATOMIC_UINT_INIT is a *const*, but it may be used to initialize a
14841484
// static. This static can be modified, so it is not placed in read-only memory.
1485-
static COUNTER: AtomicUint = ATOMIC_UINT_INIT;
1485+
static COUNTER: atomic::AtomicUint = atomic::ATOMIC_UINT_INIT;
14861486
14871487
// This table is a candidate to be placed in read-only memory.
14881488
static TABLE: &'static [uint] = &[1, 2, 3, /* ... */];
14891489
14901490
for slot in TABLE.iter() {
14911491
println!("{}", slot);
14921492
}
1493-
COUNTER.fetch_add(1, Ordering::SeqCst);
1493+
COUNTER.fetch_add(1, atomic::SeqCst);
14941494
```
14951495

14961496
#### Mutable statics

trunk/src/grammar/verify.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,14 @@ extern crate regex;
1919
#[phase(link, plugin)]
2020
extern crate log;
2121

22+
#[phase(plugin)] extern crate regex_macros;
23+
2224
use std::collections::HashMap;
2325
use std::io::File;
24-
use regex::Regex;
2526

2627
use syntax::parse;
2728
use syntax::parse::lexer;
28-
use rustc::session::{self, config};
29+
use rustc::session::{mod, config};
2930

3031
use syntax::ast;
3132
use syntax::ast::Name;
@@ -167,9 +168,9 @@ fn count(lit: &str) -> uint {
167168
}
168169

169170
fn parse_antlr_token(s: &str, tokens: &HashMap<String, token::Token>) -> TokenAndSpan {
170-
let re = Regex::new(
171+
let re = regex!(
171172
r"\[@(?P<seq>\d+),(?P<start>\d+):(?P<end>\d+)='(?P<content>.+?)',<(?P<toknum>-?\d+)>,\d+:\d+]"
172-
).unwrap();
173+
);
173174

174175
let m = re.captures(s).expect(format!("The regex didn't match {}", s).as_slice());
175176
let start = m.name("start").unwrap_or("");

trunk/src/liballoc/arc.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ use core::atomic;
7171
use core::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};
7272
use core::borrow::BorrowFrom;
7373
use core::clone::Clone;
74-
use core::fmt::{self, Show};
74+
use core::fmt::{mod, Show};
7575
use core::cmp::{Eq, Ord, PartialEq, PartialOrd, Ordering};
7676
use core::default::Default;
7777
use core::kinds::{Sync, Send};
@@ -81,7 +81,7 @@ use core::nonzero::NonZero;
8181
use core::ops::{Drop, Deref};
8282
use core::option::Option;
8383
use core::option::Option::{Some, None};
84-
use core::ptr::{self, PtrExt};
84+
use core::ptr::{mod, PtrExt};
8585
use heap::deallocate;
8686

8787
/// An atomically reference counted wrapper for shared state.
@@ -600,9 +600,11 @@ mod tests {
600600
use std::ops::Drop;
601601
use std::option::Option;
602602
use std::option::Option::{Some, None};
603+
use std::str::Str;
603604
use std::sync::atomic;
604605
use std::sync::atomic::Ordering::{Acquire, SeqCst};
605-
use std::thread::Thread;
606+
use std::task;
607+
use std::kinds::Send;
606608
use std::vec::Vec;
607609
use super::{Arc, Weak, weak_count, strong_count};
608610
use std::sync::Mutex;
@@ -629,7 +631,7 @@ mod tests {
629631

630632
let (tx, rx) = channel();
631633

632-
let _t = Thread::spawn(move || {
634+
task::spawn(move || {
633635
let arc_v: Arc<Vec<int>> = rx.recv().unwrap();
634636
assert_eq!((*arc_v)[3], 4);
635637
});
@@ -798,6 +800,6 @@ mod tests {
798800
}
799801

800802
// Make sure deriving works with Arc<T>
801-
#[derive(Eq, Ord, PartialEq, PartialOrd, Clone, Show, Default)]
803+
#[deriving(Eq, Ord, PartialEq, PartialOrd, Clone, Show, Default)]
802804
struct Foo { inner: Arc<int> }
803805
}

trunk/src/liballoc/boxed.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
1313
#![stable]
1414

15-
use core::any::{Any, AnyRefExt};
15+
use core::any::Any;
1616
use core::clone::Clone;
1717
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
1818
use core::default::Default;
1919
use core::fmt;
20-
use core::hash::{self, Hash};
20+
use core::hash::{mod, Hash};
2121
use core::kinds::Sized;
2222
use core::mem;
2323
use core::option::Option;

trunk/src/liballoc/lib.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ extern crate libc;
7777
#[cfg(test)] #[phase(plugin, link)] extern crate std;
7878
#[cfg(test)] #[phase(plugin, link)] extern crate log;
7979

80+
// The deprecated name of the boxed module
81+
82+
#[deprecated = "use boxed instead"]
83+
#[cfg(not(test))]
84+
pub use boxed as owned;
85+
8086
// Heaps provided for low-level allocation strategies
8187

8288
pub mod heap;

trunk/src/liballoc/rc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ use core::clone::Clone;
147147
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
148148
use core::default::Default;
149149
use core::fmt;
150-
use core::hash::{self, Hash};
150+
use core::hash::{mod, Hash};
151151
use core::kinds::marker;
152152
use core::mem::{transmute, min_align_of, size_of, forget};
153153
use core::nonzero::NonZero;
154154
use core::ops::{Deref, Drop};
155155
use core::option::Option;
156156
use core::option::Option::{Some, None};
157-
use core::ptr::{self, PtrExt};
157+
use core::ptr::{mod, PtrExt};
158158
use core::result::Result;
159159
use core::result::Result::{Ok, Err};
160160

@@ -264,7 +264,7 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool {
264264
/// # Example
265265
///
266266
/// ```
267-
/// use std::rc::{self, Rc};
267+
/// use std::rc::{mod, Rc};
268268
///
269269
/// let x = Rc::new(3u);
270270
/// assert_eq!(rc::try_unwrap(x), Ok(3u));
@@ -298,7 +298,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
298298
/// # Example
299299
///
300300
/// ```
301-
/// use std::rc::{self, Rc};
301+
/// use std::rc::{mod, Rc};
302302
///
303303
/// let mut x = Rc::new(3u);
304304
/// *rc::get_mut(&mut x).unwrap() = 4u;

trunk/src/libarena/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use std::rt::heap::{allocate, deallocate};
4646
// The way arena uses arrays is really deeply awful. The arrays are
4747
// allocated, and have capacities reserved, but the fill for the array
4848
// will always stay at 0.
49-
#[derive(Clone, PartialEq)]
49+
#[deriving(Clone, PartialEq)]
5050
struct Chunk {
5151
data: Rc<RefCell<Vec<u8>>>,
5252
fill: Cell<uint>,

trunk/src/libcollections/bench.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ pub fn find_rand_n<M, T, I, F>(n: uint,
6868
{
6969
// setup
7070
let mut rng = rand::weak_rng();
71-
let mut keys = range(0, n).map(|_| rng.gen::<uint>() % n)
72-
.collect::<Vec<_>>();
71+
let mut keys = Vec::from_fn(n, |_| rng.gen::<uint>() % n);
7372

7473
for k in keys.iter() {
7574
insert(map, *k);

trunk/src/libcollections/binary_heap.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
//! use std::collections::BinaryHeap;
3131
//! use std::uint;
3232
//!
33-
//! #[derive(Copy, Eq, PartialEq)]
33+
//! #[deriving(Copy, Eq, PartialEq)]
3434
//! struct State {
3535
//! cost: uint,
3636
//! position: uint,
@@ -157,12 +157,12 @@ use core::mem::{zeroed, replace, swap};
157157
use core::ptr;
158158

159159
use slice;
160-
use vec::{self, Vec};
160+
use vec::{mod, Vec};
161161

162162
/// A priority queue implemented with a binary heap.
163163
///
164164
/// This will be a max-heap.
165-
#[derive(Clone)]
165+
#[deriving(Clone)]
166166
#[stable]
167167
pub struct BinaryHeap<T> {
168168
data: Vec<T>,
@@ -565,7 +565,7 @@ pub struct Iter <'a, T: 'a> {
565565
iter: slice::Iter<'a, T>,
566566
}
567567

568-
// FIXME(#19839) Remove in favor of `#[derive(Clone)]`
568+
// FIXME(#19839) Remove in favor of `#[deriving(Clone)]`
569569
impl<'a, T> Clone for Iter<'a, T> {
570570
fn clone(&self) -> Iter<'a, T> {
571571
Iter { iter: self.iter.clone() }

0 commit comments

Comments
 (0)