Skip to content

Commit 4e366b5

Browse files
committed
---
yaml --- r: 91898 b: refs/heads/auto c: 20233b9 h: refs/heads/master v: v3
1 parent 1efaf0d commit 4e366b5

File tree

32 files changed

+89
-209
lines changed

32 files changed

+89
-209
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: e632c440f88b3e252bf8c0942fc7be21d9e946d3
16+
refs/heads/auto: 20233b984855fa72adc07761a6c657ea191c1eb9
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/mk/docs.mk

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,10 @@ RUSTDOC = $(HBIN2_H_$(CFG_BUILD))/rustdoc$(X_$(CFG_BUILD))
215215
# $(1) - The crate name (std/extra)
216216
# $(2) - The crate file
217217
# $(3) - The relevant host build triple (to depend on libstd)
218-
#
219-
# Passes --cfg stage2 to rustdoc because it uses the stage2 librustc.
220218
define libdoc
221219
doc/$(1)/index.html: $$(RUSTDOC) $$(TLIB2_T_$(3)_H_$(3))/$(CFG_STDLIB_$(3))
222220
@$$(call E, rustdoc: $$@)
223-
$(Q)$(RUSTDOC) --cfg stage2 $(2)
221+
$(Q)$(RUSTDOC) $(2)
224222

225223
DOCS += doc/$(1)/index.html
226224
endef

branches/auto/src/libextra/base64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ mod test {
260260
261261
#[test]
262262
fn test_to_base64_line_break() {
263-
assert!(![0u8, ..1000].to_base64(Config {line_length: None, ..STANDARD})
263+
assert!(![0u8, 1000].to_base64(Config {line_length: None, ..STANDARD})
264264
.contains("\r\n"));
265265
assert_eq!("foobar".as_bytes().to_base64(Config {line_length: Some(4),
266266
..STANDARD}),

branches/auto/src/libextra/serialize.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Core encoding and decoding interfaces.
2020

2121
use std::at_vec;
2222
use std::hashmap::{HashMap, HashSet};
23-
use std::rc::Rc;
2423
use std::trie::{TrieMap, TrieSet};
2524
use std::vec;
2625
use ringbuf::RingBuf;
@@ -406,20 +405,6 @@ impl<S:Encoder,T:Encodable<S>> Encodable<S> for @T {
406405
}
407406
}
408407

409-
impl<S:Encoder,T:Encodable<S> + Freeze> Encodable<S> for Rc<T> {
410-
#[inline]
411-
fn encode(&self, s: &mut S) {
412-
self.borrow().encode(s)
413-
}
414-
}
415-
416-
impl<D:Decoder,T:Decodable<D> + Freeze> Decodable<D> for Rc<T> {
417-
#[inline]
418-
fn decode(d: &mut D) -> Rc<T> {
419-
Rc::new(Decodable::decode(d))
420-
}
421-
}
422-
423408
impl<D:Decoder,T:Decodable<D> + 'static> Decodable<D> for @T {
424409
fn decode(d: &mut D) -> @T {
425410
@Decodable::decode(d)

branches/auto/src/librustc/middle/borrowck/check_loans.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<'self> Visitor<()> for CheckLoanCtxt<'self> {
5151
fn visit_block(&mut self, b:&ast::Block, _:()) {
5252
check_loans_in_block(self, b);
5353
}
54-
fn visit_pat(&mut self, p:&ast::Pat, _:()) {
54+
fn visit_pat(&mut self, p:@ast::Pat, _:()) {
5555
check_loans_in_pat(self, p);
5656
}
5757
fn visit_fn(&mut self, fk:&visit::fn_kind, fd:&ast::fn_decl,
@@ -847,7 +847,7 @@ fn check_loans_in_expr<'a>(this: &mut CheckLoanCtxt<'a>,
847847
}
848848

849849
fn check_loans_in_pat<'a>(this: &mut CheckLoanCtxt<'a>,
850-
pat: &ast::Pat)
850+
pat: @ast::Pat)
851851
{
852852
this.check_for_conflicting_loans(pat.id);
853853
this.check_move_out_from_id(pat.id, pat.span);

branches/auto/src/librustc/middle/borrowck/gather_loans/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl<'self> visit::Visitor<()> for GatherLoanCtxt<'self> {
8787
fn visit_stmt(&mut self, s:@Stmt, _:()) {
8888
add_stmt_to_map(self, s);
8989
}
90-
fn visit_pat(&mut self, p:&Pat, _:()) {
90+
fn visit_pat(&mut self, p:@Pat, _:()) {
9191
add_pat_to_id_range(self, p);
9292
}
9393
fn visit_local(&mut self, l:@Local, _:()) {
@@ -119,7 +119,7 @@ pub fn gather_loans(bccx: &BorrowckCtxt,
119119
}
120120

121121
fn add_pat_to_id_range(this: &mut GatherLoanCtxt,
122-
p: &ast::Pat) {
122+
p: @ast::Pat) {
123123
// NB: This visitor function just adds the pat ids into the id
124124
// range. We gather loans that occur in patterns using the
125125
// `gather_pat()` method below. Eventually these two should be

branches/auto/src/librustc/middle/check_const.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl Visitor<bool> for CheckCrateVisitor {
3333
fn visit_item(&mut self, i:@item, env:bool) {
3434
check_item(self, self.sess, self.ast_map, self.def_map, i, env);
3535
}
36-
fn visit_pat(&mut self, p:&Pat, env:bool) {
36+
fn visit_pat(&mut self, p:@Pat, env:bool) {
3737
check_pat(self, p, env);
3838
}
3939
fn visit_expr(&mut self, ex:@Expr, env:bool) {
@@ -81,7 +81,7 @@ pub fn check_item(v: &mut CheckCrateVisitor,
8181
}
8282
}
8383

84-
pub fn check_pat(v: &mut CheckCrateVisitor, p: &Pat, _is_const: bool) {
84+
pub fn check_pat(v: &mut CheckCrateVisitor, p: @Pat, _is_const: bool) {
8585
fn is_str(e: @Expr) -> bool {
8686
match e.node {
8787
ExprVstore(

branches/auto/src/librustc/middle/lint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ fn check_unsafe_block(cx: &Context, e: &ast::Expr) {
900900
}
901901
}
902902

903-
fn check_unused_mut_pat(cx: &Context, p: &ast::Pat) {
903+
fn check_unused_mut_pat(cx: &Context, p: @ast::Pat) {
904904
match p.node {
905905
ast::PatIdent(ast::BindByValue(ast::MutMutable),
906906
ref path, _) if pat_util::pat_is_binding(cx.tcx.def_map, p)=> {
@@ -1119,7 +1119,7 @@ impl<'self> Visitor<()> for Context<'self> {
11191119
}
11201120
}
11211121

1122-
fn visit_pat(&mut self, p: &ast::Pat, _: ()) {
1122+
fn visit_pat(&mut self, p: @ast::Pat, _: ()) {
11231123
check_pat_non_uppercase_statics(self, p);
11241124
check_unused_mut_pat(self, p);
11251125

branches/auto/src/librustc/middle/moves.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,8 @@ impl VisitContext {
459459
}
460460

461461
ExprMatch(discr, ref arms) => {
462+
// We must do this first so that `arms_have_by_move_bindings`
463+
// below knows which bindings are moves.
462464
for arm in arms.iter() {
463465
self.consume_arm(arm);
464466
}
@@ -655,6 +657,27 @@ impl VisitContext {
655657
self.consume_expr(arg_expr)
656658
}
657659

660+
pub fn arms_have_by_move_bindings(&mut self,
661+
moves_map: MovesMap,
662+
arms: &[Arm])
663+
-> Option<@Pat> {
664+
let mut ret = None;
665+
for arm in arms.iter() {
666+
for &pat in arm.pats.iter() {
667+
let cont = do ast_util::walk_pat(pat) |p| {
668+
if moves_map.contains(&p.id) {
669+
ret = Some(p);
670+
false
671+
} else {
672+
true
673+
}
674+
};
675+
if !cont { return ret }
676+
}
677+
}
678+
ret
679+
}
680+
658681
pub fn compute_captures(&mut self, fn_expr_id: NodeId) -> @[CaptureVar] {
659682
debug!("compute_capture_vars(fn_expr_id={:?})", fn_expr_id);
660683
let _indenter = indenter();

branches/auto/src/librustc/middle/pat_util.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub type PatIdMap = HashMap<Ident, NodeId>;
2020

2121
// This is used because same-named variables in alternative patterns need to
2222
// use the NodeId of their namesake in the first pattern.
23-
pub fn pat_id_map(dm: resolve::DefMap, pat: &Pat) -> PatIdMap {
23+
pub fn pat_id_map(dm: resolve::DefMap, pat: @Pat) -> PatIdMap {
2424
let mut map = HashMap::new();
2525
do pat_bindings(dm, pat) |_bm, p_id, _s, n| {
2626
map.insert(path_to_ident(n), p_id);
@@ -52,7 +52,7 @@ pub fn pat_is_const(dm: resolve::DefMap, pat: &Pat) -> bool {
5252
}
5353
}
5454

55-
pub fn pat_is_binding(dm: resolve::DefMap, pat: &Pat) -> bool {
55+
pub fn pat_is_binding(dm: resolve::DefMap, pat: @Pat) -> bool {
5656
match pat.node {
5757
PatIdent(*) => {
5858
!pat_is_variant_or_struct(dm, pat) &&
@@ -62,7 +62,7 @@ pub fn pat_is_binding(dm: resolve::DefMap, pat: &Pat) -> bool {
6262
}
6363
}
6464

65-
pub fn pat_is_binding_or_wild(dm: resolve::DefMap, pat: &Pat) -> bool {
65+
pub fn pat_is_binding_or_wild(dm: resolve::DefMap, pat: @Pat) -> bool {
6666
match pat.node {
6767
PatIdent(*) => pat_is_binding(dm, pat),
6868
PatWild | PatWildMulti => true,
@@ -73,7 +73,7 @@ pub fn pat_is_binding_or_wild(dm: resolve::DefMap, pat: &Pat) -> bool {
7373
/// Call `it` on every "binding" in a pattern, e.g., on `a` in
7474
/// `match foo() { Some(a) => (), None => () }`
7575
pub fn pat_bindings(dm: resolve::DefMap,
76-
pat: &Pat,
76+
pat: @Pat,
7777
it: |BindingMode, NodeId, Span, &Path|) {
7878
do walk_pat(pat) |p| {
7979
match p.node {
@@ -86,15 +86,15 @@ pub fn pat_bindings(dm: resolve::DefMap,
8686
};
8787
}
8888

89-
pub fn pat_binding_ids(dm: resolve::DefMap, pat: &Pat) -> ~[NodeId] {
89+
pub fn pat_binding_ids(dm: resolve::DefMap, pat: @Pat) -> ~[NodeId] {
9090
let mut found = ~[];
9191
pat_bindings(dm, pat, |_bm, b_id, _sp, _pt| found.push(b_id) );
9292
return found;
9393
}
9494

9595
/// Checks if the pattern contains any patterns that bind something to
9696
/// an ident, e.g. `foo`, or `Foo(foo)` or `foo @ Bar(*)`.
97-
pub fn pat_contains_bindings(dm: resolve::DefMap, pat: &Pat) -> bool {
97+
pub fn pat_contains_bindings(dm: resolve::DefMap, pat: @Pat) -> bool {
9898
let mut contains_bindings = false;
9999
do walk_pat(pat) |p| {
100100
if pat_is_binding(dm, p) {

branches/auto/src/librustc/middle/privacy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ impl<'self> Visitor<()> for PrivacyVisitor<'self> {
739739
}
740740
}
741741

742-
fn visit_pat(&mut self, pattern: &ast::Pat, _: ()) {
742+
fn visit_pat(&mut self, pattern: @ast::Pat, _: ()) {
743743
match pattern.node {
744744
ast::PatStruct(_, ref fields, _) => {
745745
match ty::get(ty::pat_ty(self.tcx, pattern)).sty {

branches/auto/src/librustc/middle/region.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ fn resolve_arm(visitor: &mut RegionResolutionVisitor,
340340
}
341341

342342
fn resolve_pat(visitor: &mut RegionResolutionVisitor,
343-
pat: &ast::Pat,
343+
pat: @ast::Pat,
344344
cx: Context) {
345345
assert_eq!(cx.var_parent, cx.parent);
346346
parent_to_expr(visitor, cx, pat.id, pat.span);
@@ -480,7 +480,7 @@ impl Visitor<Context> for RegionResolutionVisitor {
480480
fn visit_arm(&mut self, a:&Arm, cx:Context) {
481481
resolve_arm(self, a, cx);
482482
}
483-
fn visit_pat(&mut self, p:&Pat, cx:Context) {
483+
fn visit_pat(&mut self, p:@Pat, cx:Context) {
484484
resolve_pat(self, p, cx);
485485
}
486486
fn visit_stmt(&mut self, s:@Stmt, cx:Context) {

branches/auto/src/librustc/middle/typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ impl Visitor<()> for GatherLocalsVisitor {
375375

376376
}
377377
// Add pattern bindings.
378-
fn visit_pat(&mut self, p:&ast::Pat, _:()) {
378+
fn visit_pat(&mut self, p:@ast::Pat, _:()) {
379379
match p.node {
380380
ast::PatIdent(_, ref path, _)
381381
if pat_util::pat_is_binding(self.fcx.ccx.tcx.def_map, p) => {

branches/auto/src/librustc/middle/typeck/check/writeback.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ fn visit_block(b: &ast::Block, wbcx: &mut WbCtxt) {
278278
visit::walk_block(wbcx, b, ());
279279
}
280280

281-
fn visit_pat(p: &ast::Pat, wbcx: &mut WbCtxt) {
281+
fn visit_pat(p: @ast::Pat, wbcx: &mut WbCtxt) {
282282
if !wbcx.success {
283283
return;
284284
}
@@ -323,7 +323,7 @@ impl Visitor<()> for WbCtxt {
323323
fn visit_stmt(&mut self, s:@ast::Stmt, _:()) { visit_stmt(s, self); }
324324
fn visit_expr(&mut self, ex:@ast::Expr, _:()) { visit_expr(ex, self); }
325325
fn visit_block(&mut self, b:&ast::Block, _:()) { visit_block(b, self); }
326-
fn visit_pat(&mut self, p:&ast::Pat, _:()) { visit_pat(p, self); }
326+
fn visit_pat(&mut self, p:@ast::Pat, _:()) { visit_pat(p, self); }
327327
fn visit_local(&mut self, l:@ast::Local, _:()) { visit_local(l, self); }
328328
}
329329

branches/auto/src/librustdoc/core.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pub struct CrateAnalysis {
3737

3838
/// Parses, resolves, and typechecks the given crate
3939
fn get_ast_and_resolve(cpath: &Path,
40-
libs: HashSet<Path>, cfgs: ~[~str]) -> (DocContext, CrateAnalysis) {
40+
libs: HashSet<Path>) -> (DocContext, CrateAnalysis) {
4141
use syntax::codemap::dummy_spanned;
4242
use rustc::driver::driver::{file_input, build_configuration,
4343
phase_1_parse_input,
@@ -66,9 +66,7 @@ fn get_ast_and_resolve(cpath: &Path,
6666
span_diagnostic_handler);
6767

6868
let mut cfg = build_configuration(sess);
69-
for cfg_ in cfgs.move_iter() {
70-
cfg.push(@dummy_spanned(ast::MetaWord(cfg_.to_managed())));
71-
}
69+
cfg.push(@dummy_spanned(ast::MetaWord(@"stage2")));
7270

7371
let mut crate = phase_1_parse_input(sess, cfg.clone(), &input);
7472
crate = phase_2_configure_and_expand(sess, cfg, crate);
@@ -81,8 +79,8 @@ fn get_ast_and_resolve(cpath: &Path,
8179
CrateAnalysis { exported_items: exported_items });
8280
}
8381

84-
pub fn run_core (libs: HashSet<Path>, cfgs: ~[~str], path: &Path) -> (clean::Crate, CrateAnalysis) {
85-
let (ctxt, analysis) = get_ast_and_resolve(path, libs, cfgs);
82+
pub fn run_core (libs: HashSet<Path>, path: &Path) -> (clean::Crate, CrateAnalysis) {
83+
let (ctxt, analysis) = get_ast_and_resolve(path, libs);
8684
let ctxt = @ctxt;
8785
debug!("defmap:");
8886
for (k, v) in ctxt.tycx.def_map.iter() {

branches/auto/src/librustdoc/lib.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ pub fn opts() -> ~[groups::OptGroup] {
9696
optopt("o", "output", "where to place the output", "PATH"),
9797
optmulti("L", "library-path", "directory to add to crate search path",
9898
"DIR"),
99-
optmulti("", "cfg", "pass a --cfg to rustc", ""),
10099
optmulti("", "plugin-path", "directory to load plugins from", "DIR"),
101100
optmulti("", "passes", "space separated list of passes to also run, a \
102101
value of `list` will print available passes",
@@ -195,12 +194,11 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
195194

196195
// First, parse the crate and extract all relevant information.
197196
let libs = Cell::new(matches.opt_strs("L").map(|s| Path::new(s.as_slice())));
198-
let cfgs = Cell::new(matches.opt_strs("cfg"));
199197
let cr = Cell::new(Path::new(cratefile));
200198
info!("starting to run rustc");
201199
let (crate, analysis) = do std::task::try {
202200
let cr = cr.take();
203-
core::run_core(libs.take().move_iter().collect(), cfgs.take(), &cr)
201+
core::run_core(libs.take().move_iter().collect(), &cr)
204202
}.unwrap();
205203
info!("finished with rustc");
206204
local_data::set(analysiskey, analysis);

branches/auto/src/librustuv/stream.rs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -69,27 +69,22 @@ impl StreamWatcher {
6969
// uv_read_stop function
7070
let _f = ForbidUnwind::new("stream read");
7171

72-
let mut rcx = ReadContext {
73-
buf: Some(slice_to_uv_buf(buf)),
74-
result: 0,
75-
task: None,
76-
};
77-
// When reading a TTY stream on windows, libuv will invoke alloc_cb
78-
// immediately as part of the call to alloc_cb. What this means is that
79-
// we must be ready for this to happen (by setting the data in the uv
80-
// handle). In theory this otherwise doesn't need to happen until after
81-
// the read is succesfully started.
82-
unsafe {
83-
uvll::set_data_for_uv_handle(self.handle, &rcx)
84-
}
85-
8672
// Send off the read request, but don't block until we're sure that the
8773
// read request is queued.
8874
match unsafe {
8975
uvll::uv_read_start(self.handle, alloc_cb, read_cb)
9076
} {
9177
0 => {
92-
wait_until_woken_after(&mut rcx.task, || {});
78+
let mut rcx = ReadContext {
79+
buf: Some(slice_to_uv_buf(buf)),
80+
result: 0,
81+
task: None,
82+
};
83+
do wait_until_woken_after(&mut rcx.task) {
84+
unsafe {
85+
uvll::set_data_for_uv_handle(self.handle, &rcx)
86+
}
87+
}
9388
match rcx.result {
9489
n if n < 0 => Err(UvError(n as c_int)),
9590
n => Ok(n as uint),

branches/auto/src/libstd/hashmap.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
//! The tables use a keyed hash with new random keys generated for each container, so the ordering
1414
//! of a set of keys in a hash table is randomized.
1515
16+
#[mutable_doc];
17+
1618
use container::{Container, Mutable, Map, MutableMap, Set, MutableSet};
1719
use clone::Clone;
1820
use cmp::{Eq, Equiv};

branches/auto/src/libstd/io/net/ip.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl ToStr for IpAddr {
4141
}
4242

4343
Ipv6Addr(a, b, c, d, e, f, g, h) =>
44-
format!("{}:{}:{}:{}:{}:{}:{}:{}", a, b, c, d, e, f, g, h)
44+
format!("{:x}:{:x}:{:x}:{:x}:{:x}:{:x}:{:x}:{:x}", a, b, c, d, e, f, g, h)
4545
}
4646
}
4747
}
@@ -449,6 +449,7 @@ mod test {
449449
fn ipv6_addr_to_str() {
450450
let a1 = Ipv6Addr(0, 0, 0, 0, 0, 0xffff, 0xc000, 0x280);
451451
assert!(a1.to_str() == ~"::ffff:192.0.2.128" || a1.to_str() == ~"::FFFF:192.0.2.128");
452+
assert_eq!(Ipv6Addr(8, 9, 10, 11, 12, 13, 14, 15).to_str(), ~"8:9:a:b:c:d:e:f");
452453
}
453454

454455
}

0 commit comments

Comments
 (0)