Skip to content

Commit 8778c7b

Browse files
committed
---
yaml --- r: 93868 b: refs/heads/try c: 679a2c0 h: refs/heads/master v: v3
1 parent be193b6 commit 8778c7b

File tree

6 files changed

+29
-18
lines changed

6 files changed

+29
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 07e21c3c8c49918e3909dded55813abbad240c4e
5+
refs/heads/try: 679a2c042fb2541f55f1192ca97672907b258337
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/mk/docs.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,12 @@ 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.
218220
define libdoc
219221
doc/$(1)/index.html: $$(RUSTDOC) $$(TLIB2_T_$(3)_H_$(3))/$(CFG_STDLIB_$(3))
220222
@$$(call E, rustdoc: $$@)
221-
$(Q)$(RUSTDOC) $(2)
223+
$(Q)$(RUSTDOC) --cfg stage2 $(2)
222224

223225
DOCS += doc/$(1)/index.html
224226
endef

branches/try/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/try/src/librustdoc/core.rs

Lines changed: 6 additions & 4 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>) -> (DocContext, CrateAnalysis) {
40+
libs: HashSet<Path>, cfgs: ~[~str]) -> (DocContext, CrateAnalysis) {
4141
use syntax::codemap::dummy_spanned;
4242
use rustc::driver::driver::{file_input, build_configuration,
4343
phase_1_parse_input,
@@ -66,7 +66,9 @@ fn get_ast_and_resolve(cpath: &Path,
6666
span_diagnostic_handler);
6767

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

7173
let mut crate = phase_1_parse_input(sess, cfg.clone(), &input);
7274
crate = phase_2_configure_and_expand(sess, cfg, crate);
@@ -79,8 +81,8 @@ fn get_ast_and_resolve(cpath: &Path,
7981
CrateAnalysis { exported_items: exported_items });
8082
}
8183

82-
pub fn run_core (libs: HashSet<Path>, path: &Path) -> (clean::Crate, CrateAnalysis) {
83-
let (ctxt, analysis) = get_ast_and_resolve(path, libs);
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);
8486
let ctxt = @ctxt;
8587
debug!("defmap:");
8688
for (k, v) in ctxt.tycx.def_map.iter() {

branches/try/src/librustdoc/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ 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", ""),
99100
optmulti("", "plugin-path", "directory to load plugins from", "DIR"),
100101
optmulti("", "passes", "space separated list of passes to also run, a \
101102
value of `list` will print available passes",
@@ -194,11 +195,12 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
194195

195196
// First, parse the crate and extract all relevant information.
196197
let libs = Cell::new(matches.opt_strs("L").map(|s| Path::new(s.as_slice())));
198+
let cfgs = Cell::new(matches.opt_strs("cfg"));
197199
let cr = Cell::new(Path::new(cratefile));
198200
info!("starting to run rustc");
199201
let (crate, analysis) = do std::task::try {
200202
let cr = cr.take();
201-
core::run_core(libs.take().move_iter().collect(), &cr)
203+
core::run_core(libs.take().move_iter().collect(), cfgs.take(), &cr)
202204
}.unwrap();
203205
info!("finished with rustc");
204206
local_data::set(analysiskey, analysis);

branches/try/src/librustuv/stream.rs

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,27 @@ 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+
7286
// Send off the read request, but don't block until we're sure that the
7387
// read request is queued.
7488
match unsafe {
7589
uvll::uv_read_start(self.handle, alloc_cb, read_cb)
7690
} {
7791
0 => {
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-
}
92+
wait_until_woken_after(&mut rcx.task, || {});
8893
match rcx.result {
8994
n if n < 0 => Err(UvError(n as c_int)),
9095
n => Ok(n as uint),

0 commit comments

Comments
 (0)