Skip to content

Commit 0f95d90

Browse files
committed
---
yaml --- r: 64047 b: refs/heads/snap-stage3 c: 149c976 h: refs/heads/master i: 64045: db6140f 64043: f8b1925 64039: 2e1d2ad 64031: cb4bed2 v: v3
1 parent 508f526 commit 0f95d90

File tree

31 files changed

+165
-97
lines changed

31 files changed

+165
-97
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: e9897cd08a069342c1aae67faa04b119968b44eb
4+
refs/heads/snap-stage3: 149c976aa0b6441b93f2e2140e10e0424d39ea17
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# The names of crates that must be tested
1717
TEST_TARGET_CRATES = std extra
18-
TEST_HOST_CRATES = syntax rustc rustdoc rust rustpkg
18+
TEST_HOST_CRATES = syntax rustc rustdoc rusti rust rustpkg
1919
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
2020

2121
# Markdown files under doc/ that should have their code extracted and run

branches/snap-stage3/mk/tools.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ $$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTPKG_$(4)): \
5050
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_EXTRALIB_$(4)) \
5151
$$(TLIB$(1)_T_$(4)_H_$(3))/$(CFG_LIBRUSTC_$(4))
5252
@$$(call E, compile_and_link: $$@)
53-
$$(STAGE$(1)_T_$(4)_H_$(3)) $$(WFLAGS_ST$(1)) -o $$@ $$< && touch $$@
53+
$$(STAGE$(1)_T_$(4)_H_$(3)) -o $$@ $$< && touch $$@
5454

5555
$$(TBIN$(1)_T_$(4)_H_$(3))/rustpkg$$(X_$(4)): \
5656
$$(DRIVER_CRATE) \

branches/snap-stage3/src/compiletest/common.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
use core::prelude::*;
12+
1113
#[deriving(Eq)]
1214
pub enum mode {
1315
mode_compile_fail,

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,21 @@
1111
#[crate_type = "bin"];
1212

1313
#[allow(non_camel_case_types)];
14-
#[allow(unrecognized_lint)]; // NOTE: remove after snapshot
15-
#[deny(warnings)];
1614

17-
extern mod extra;
15+
#[no_core]; // XXX: Remove after snapshot
16+
#[no_std];
1817

19-
use std::os;
18+
extern mod core(name = "std", vers = "0.7");
19+
extern mod extra(name = "extra", vers = "0.7");
20+
21+
use core::prelude::*;
22+
use core::*;
2023

2124
use extra::getopts;
2225
use extra::test;
2326

27+
use core::result::{Ok, Err};
28+
2429
use common::config;
2530
use common::mode_run_pass;
2631
use common::mode_run_fail;
@@ -37,6 +42,13 @@ pub mod runtest;
3742
pub mod common;
3843
pub mod errors;
3944

45+
mod std {
46+
pub use core::cmp;
47+
pub use core::str;
48+
pub use core::sys;
49+
pub use core::unstable;
50+
}
51+
4052
pub fn main() {
4153
let args = os::args();
4254
let config = parse_config(args);
@@ -86,8 +98,8 @@ pub fn parse_config(args: ~[~str]) -> config {
8698
run_ignored: getopts::opt_present(matches, "ignored"),
8799
filter:
88100
if !matches.free.is_empty() {
89-
Some(copy matches.free[0])
90-
} else { None },
101+
option::Some(copy matches.free[0])
102+
} else { option::None },
91103
logfile: getopts::opt_maybe_str(matches, "logfile").map(|s| Path(*s)),
92104
runtool: getopts::opt_maybe_str(matches, "runtool"),
93105
rustcflags: getopts::opt_maybe_str(matches, "rustcflags"),
@@ -136,8 +148,8 @@ pub fn log_config(config: &config) {
136148

137149
pub fn opt_str<'a>(maybestr: &'a Option<~str>) -> &'a str {
138150
match *maybestr {
139-
None => "(none)",
140-
Some(ref s) => {
151+
option::None => "(none)",
152+
option::Some(ref s) => {
141153
let s: &'a str = *s;
142154
s
143155
}
@@ -149,7 +161,7 @@ pub fn opt_str2(maybestr: Option<~str>) -> ~str {
149161
}
150162

151163
pub fn str_opt(maybestr: ~str) -> Option<~str> {
152-
if maybestr != ~"(none)" { Some(maybestr) } else { None }
164+
if maybestr != ~"(none)" { option::Some(maybestr) } else { option::None }
153165
}
154166

155167
pub fn str_mode(s: ~str) -> mode {
@@ -187,8 +199,8 @@ pub fn test_opts(config: &config) -> test::TestOpts {
187199
logfile: copy config.logfile,
188200
run_tests: true,
189201
run_benchmarks: false,
190-
save_results: None,
191-
compare_results: None
202+
save_results: option::None,
203+
compare_results: option::None
192204
}
193205
}
194206

@@ -256,7 +268,7 @@ pub fn make_test_name(config: &config, testfile: &Path) -> test::TestName {
256268
}
257269

258270
pub fn make_test_closure(config: &config, testfile: &Path) -> test::TestFn {
259-
use std::cell::Cell;
271+
use core::cell::Cell;
260272
let config = Cell::new(copy *config);
261273
let testfile = Cell::new(testfile.to_str());
262274
test::DynTestFn(|| { runtest::run(config.take(), testfile.take()) })

branches/snap-stage3/src/compiletest/errors.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::io;
11+
use core::prelude::*;
12+
13+
use core::io;
1214

1315
pub struct ExpectedError { line: uint, kind: ~str, msg: ~str }
1416

branches/snap-stage3/src/compiletest/header.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
use core::prelude::*;
12+
1113
use common::config;
1214
use common;
1315

14-
use std::io;
15-
use std::os;
16+
use core::io;
17+
use core::os;
1618

1719
pub struct TestProps {
1820
// Lines that should be expected, in order, on standard out

branches/snap-stage3/src/compiletest/procsrv.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::os;
12-
use std::run;
13-
use std::str;
11+
use core::prelude::*;
12+
13+
use core::os;
14+
use core::run;
15+
use core::str;
1416

1517
#[cfg(target_os = "win32")]
1618
fn target_env(lib_path: &str, prog: &str) -> ~[(~str,~str)] {

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
use core::prelude::*;
12+
1113
use common::mode_run_pass;
1214
use common::mode_run_fail;
1315
use common::mode_compile_fail;
@@ -20,10 +22,10 @@ use procsrv;
2022
use util;
2123
use util::logv;
2224

23-
use std::io;
24-
use std::os;
25-
use std::uint;
26-
use std::vec;
25+
use core::io;
26+
use core::os;
27+
use core::uint;
28+
use core::vec;
2729

2830
pub fn run(config: config, testfile: ~str) {
2931
if config.verbose {

branches/snap-stage3/src/compiletest/util.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
use core::prelude::*;
12+
1113
use common::config;
1214

13-
use std::io;
14-
use std::os::getenv;
15+
use core::io;
16+
use core::os::getenv;
1517

1618
pub fn make_new_path(path: &str) -> ~str {
1719

branches/snap-stage3/src/driver/driver.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[no_core];
12+
#[no_std];
13+
14+
extern mod core(name = "std", vers = "0.7");
15+
1116
#[cfg(rustpkg)]
1217
extern mod this(name = "rustpkg");
1318

branches/snap-stage3/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ syn region rustDeriving start="deriving(" end=")" contains=rustTrait
9595
" Number literals
9696
syn match rustNumber display "\<[0-9][0-9_]*\>"
9797
syn match rustNumber display "\<[0-9][0-9_]*\(u\|u8\|u16\|u32\|u64\)\>"
98-
syn match rustNumber display "\<[0-9][0-9_]*\(i\|i8\|i16\|i32\|i64\)\>"
98+
syn match rustNumber display "\<[0-9][0-9_]*\(i8\|i16\|i32\|i64\)\>"
9999

100100
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\>"
101101
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\(u\|u8\|u16\|u32\|u64\)\>"

branches/snap-stage3/src/libextra/json.rs

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -481,22 +481,30 @@ pub fn to_pretty_str(json: &Json) -> ~str {
481481
io::with_str_writer(|wr| to_pretty_writer(wr, json))
482482
}
483483

484+
static BUF_SIZE : uint = 64000;
485+
484486
#[allow(missing_doc)]
485487
pub struct Parser {
486488
priv rdr: @io::Reader,
489+
priv buf: ~[char],
490+
priv buf_idx: uint,
487491
priv ch: char,
488492
priv line: uint,
489493
priv col: uint,
490494
}
491495

492496
/// Decode a json value from an io::reader
493497
pub fn Parser(rdr: @io::Reader) -> Parser {
494-
Parser {
498+
let mut p = Parser {
495499
rdr: rdr,
496-
ch: rdr.read_char(),
500+
buf: rdr.read_chars(BUF_SIZE),
501+
buf_idx: 0,
502+
ch: 0 as char,
497503
line: 1,
498-
col: 1,
499-
}
504+
col: 0,
505+
};
506+
p.bump();
507+
p
500508
}
501509

502510
impl Parser {
@@ -521,13 +529,26 @@ impl Parser {
521529
fn eof(&self) -> bool { self.ch == -1 as char }
522530

523531
fn bump(&mut self) {
524-
self.ch = self.rdr.read_char();
532+
if self.eof() {
533+
return;
534+
}
535+
536+
self.col += 1u;
537+
538+
if self.buf_idx >= self.buf.len() {
539+
self.buf = self.rdr.read_chars(BUF_SIZE);
540+
if self.buf.len() == 0 {
541+
self.ch = -1 as char;
542+
return;
543+
}
544+
self.buf_idx = 0;
545+
}
546+
self.ch = self.buf[self.buf_idx];
547+
self.buf_idx += 1;
525548

526549
if self.ch == '\n' {
527550
self.line += 1u;
528551
self.col = 1u;
529-
} else {
530-
self.col += 1u;
531552
}
532553
}
533554

branches/snap-stage3/src/librustc/front/test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use front::config;
1717
use std::vec;
1818
use syntax::ast_util::*;
1919
use syntax::attr;
20-
use syntax::codemap::{dummy_sp, span, ExpnInfo, NameAndSpan};
20+
use syntax::codemap::{dummy_sp, span, ExpandedFrom, CallInfo, NameAndSpan};
2121
use syntax::codemap;
2222
use syntax::ext::base::ExtCtxt;
2323
use syntax::fold;
@@ -72,13 +72,13 @@ fn generate_test_harness(sess: session::Session,
7272
};
7373

7474
let ext_cx = cx.ext_cx;
75-
ext_cx.bt_push(ExpnInfo {
75+
ext_cx.bt_push(ExpandedFrom(CallInfo {
7676
call_site: dummy_sp(),
7777
callee: NameAndSpan {
7878
name: @"test",
7979
span: None
8080
}
81-
});
81+
}));
8282

8383
let precursor = @fold::AstFoldFns {
8484
fold_crate: fold::wrap(|a,b| fold_crate(cx, a, b) ),

branches/snap-stage3/src/librustc/middle/lint.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -966,6 +966,10 @@ fn lint_unused_mut() -> visit::vt<@mut Context> {
966966
visit_fn_decl(cx, &tm.decl);
967967
visit::visit_ty_method(tm, (cx, vt));
968968
},
969+
visit_struct_method: |sm, (cx, vt)| {
970+
visit_fn_decl(cx, &sm.decl);
971+
visit::visit_struct_method(sm, (cx, vt));
972+
},
969973
visit_trait_method: |tm, (cx, vt)| {
970974
match *tm {
971975
ast::required(ref tm) => visit_fn_decl(cx, &tm.decl),
@@ -1045,6 +1049,14 @@ fn lint_missing_doc() -> visit::vt<@mut Context> {
10451049
}
10461050

10471051
visit::mk_vt(@visit::Visitor {
1052+
visit_struct_method: |m, (cx, vt)| {
1053+
if m.vis == ast::public {
1054+
check_attrs(cx, m.attrs, m.span,
1055+
"missing documentation for a method");
1056+
}
1057+
visit::visit_struct_method(m, (cx, vt));
1058+
},
1059+
10481060
visit_ty_method: |m, (cx, vt)| {
10491061
// All ty_method objects are linted about because they're part of a
10501062
// trait (no visibility)

branches/snap-stage3/src/librusti/rusti.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,10 +667,8 @@ mod tests {
667667
fn f() {}
668668
f()
669669
");
670-
}
671670

672-
#[test]
673-
fn simultaneous_definition_and_expression() {
671+
debug!("simultaneous definitions + expressions are allowed");
674672
run_program("
675673
let a = 3; a as u8
676674
");

branches/snap-stage3/src/librustpkg/api.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@ use package_id::*;
1414
use package_source::*;
1515
use version::Version;
1616

17+
use std::option::*;
1718
use std::os;
1819
use std::hashmap::*;
20+
use std::path::*;
1921

2022
/// Convenience functions intended for calling from pkg.rs
2123

branches/snap-stage3/src/librustpkg/messages.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
use extra::term;
1212
use std::io;
13+
use std::result::*;
1314

1415
pub fn note(msg: &str) {
1516
pretty_message(msg, "note: ", term::color::GREEN, io::stdout())

branches/snap-stage3/src/librustpkg/package_source.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use target::*;
1212
use package_id::PkgId;
1313
use std::path::Path;
14+
use std::option::*;
1415
use std::{os, run, str};
1516
use context::*;
1617
use crate::Crate;

0 commit comments

Comments
 (0)