Clean-up tests after debug!/std-macros change.
The entire testsuite is converted to using info! rather than debug! because some depend on the code within the debug! being trans'd.
This commit is contained in:
parent
b48e37e8ee
commit
e4f7561bcd
218 changed files with 640 additions and 613 deletions
|
@ -140,7 +140,8 @@ fn should_prune_unconfigured_items() {
|
||||||
let source = ~"#[cfg(shut_up_and_leave_me_alone)]fn a() { }";
|
let source = ~"#[cfg(shut_up_and_leave_me_alone)]fn a() { }";
|
||||||
do from_str(source) |srv| {
|
do from_str(source) |srv| {
|
||||||
do exec(srv) |ctxt| {
|
do exec(srv) |ctxt| {
|
||||||
assert!(ctxt.ast.node.module.items.is_empty());
|
// one item: the __std_macros secret module
|
||||||
|
assert_eq!(ctxt.ast.node.module.items.len(), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -255,7 +255,8 @@ mod test {
|
||||||
#[test]
|
#[test]
|
||||||
fn should_should_extract_mod_attributes() {
|
fn should_should_extract_mod_attributes() {
|
||||||
let doc = mk_doc(~"#[doc = \"test\"] mod a { }");
|
let doc = mk_doc(~"#[doc = \"test\"] mod a { }");
|
||||||
assert!(doc.cratemod().mods()[0].desc() == Some(~"test"));
|
// hidden __std_macros module at the start.
|
||||||
|
assert!(doc.cratemod().mods()[1].desc() == Some(~"test"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -190,7 +190,8 @@ mod test {
|
||||||
#[test]
|
#[test]
|
||||||
fn should_promote_desc() {
|
fn should_promote_desc() {
|
||||||
let doc = mk_doc(~"#[doc = \"desc\"] mod m { }");
|
let doc = mk_doc(~"#[doc = \"desc\"] mod m { }");
|
||||||
assert_eq!(doc.cratemod().mods()[0].brief(), Some(~"desc"));
|
// hidden __std_macros module at the start.
|
||||||
|
assert_eq!(doc.cratemod().mods()[1].brief(), Some(~"desc"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -172,6 +172,7 @@ mod test {
|
||||||
use extract;
|
use extract;
|
||||||
use markdown_index_pass::run;
|
use markdown_index_pass::run;
|
||||||
use path_pass;
|
use path_pass;
|
||||||
|
use prune_hidden_pass;
|
||||||
use super::pandoc_header_id;
|
use super::pandoc_header_id;
|
||||||
|
|
||||||
fn mk_doc(output_style: config::OutputStyle, source: ~str)
|
fn mk_doc(output_style: config::OutputStyle, source: ~str)
|
||||||
|
@ -183,8 +184,10 @@ mod test {
|
||||||
};
|
};
|
||||||
let doc = extract::from_srv(srv.clone(), ~"");
|
let doc = extract::from_srv(srv.clone(), ~"");
|
||||||
let doc = (attr_pass::mk_pass().f)(srv.clone(), doc);
|
let doc = (attr_pass::mk_pass().f)(srv.clone(), doc);
|
||||||
|
let doc = (prune_hidden_pass::mk_pass().f)(srv.clone(), doc);
|
||||||
let doc = (desc_to_brief_pass::mk_pass().f)(srv.clone(), doc);
|
let doc = (desc_to_brief_pass::mk_pass().f)(srv.clone(), doc);
|
||||||
let doc = (path_pass::mk_pass().f)(srv.clone(), doc);
|
let doc = (path_pass::mk_pass().f)(srv.clone(), doc);
|
||||||
|
|
||||||
run(srv.clone(), doc, config)
|
run(srv.clone(), doc, config)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -240,13 +243,13 @@ mod test {
|
||||||
config::DocPerMod,
|
config::DocPerMod,
|
||||||
~"mod a { } fn b() { }"
|
~"mod a { } fn b() { }"
|
||||||
);
|
);
|
||||||
assert!(doc.cratemod().index.get().entries[0] == doc::IndexEntry {
|
assert_eq!(doc.cratemod().index.get().entries[0], doc::IndexEntry {
|
||||||
kind: ~"Module",
|
kind: ~"Module",
|
||||||
name: ~"a",
|
name: ~"a",
|
||||||
brief: None,
|
brief: None,
|
||||||
link: ~"a.html"
|
link: ~"a.html"
|
||||||
});
|
});
|
||||||
assert!(doc.cratemod().index.get().entries[1] == doc::IndexEntry {
|
assert_eq!(doc.cratemod().index.get().entries[1], doc::IndexEntry {
|
||||||
kind: ~"Function",
|
kind: ~"Function",
|
||||||
name: ~"b",
|
name: ~"b",
|
||||||
brief: None,
|
brief: None,
|
||||||
|
@ -260,8 +263,7 @@ mod test {
|
||||||
config::DocPerMod,
|
config::DocPerMod,
|
||||||
~"#[doc = \"test\"] mod a { }"
|
~"#[doc = \"test\"] mod a { }"
|
||||||
);
|
);
|
||||||
assert!(doc.cratemod().index.get().entries[0].brief
|
assert_eq!(doc.cratemod().index.get().entries[0].brief, Some(~"test"));
|
||||||
== Some(~"test"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -270,12 +272,13 @@ mod test {
|
||||||
config::DocPerCrate,
|
config::DocPerCrate,
|
||||||
~"extern { fn b(); }"
|
~"extern { fn b(); }"
|
||||||
);
|
);
|
||||||
assert!(doc.cratemod().nmods()[0].index.get().entries[0]
|
// hidden __std_macros module at the start.
|
||||||
== doc::IndexEntry {
|
assert_eq!(doc.cratemod().nmods()[0].index.get().entries[0],
|
||||||
kind: ~"Function",
|
doc::IndexEntry {
|
||||||
name: ~"b",
|
kind: ~"Function",
|
||||||
brief: None,
|
name: ~"b",
|
||||||
link: ~"#function-b"
|
brief: None,
|
||||||
});
|
link: ~"#function-b"
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -529,6 +529,7 @@ mod test {
|
||||||
use markdown_writer;
|
use markdown_writer;
|
||||||
use path_pass;
|
use path_pass;
|
||||||
use page_pass;
|
use page_pass;
|
||||||
|
use prune_hidden_pass;
|
||||||
use sectionalize_pass;
|
use sectionalize_pass;
|
||||||
use trim_pass;
|
use trim_pass;
|
||||||
use tystr_pass;
|
use tystr_pass;
|
||||||
|
@ -557,6 +558,8 @@ mod test {
|
||||||
debug!("doc (path): %?", doc);
|
debug!("doc (path): %?", doc);
|
||||||
let doc = (attr_pass::mk_pass().f)(srv.clone(), doc);
|
let doc = (attr_pass::mk_pass().f)(srv.clone(), doc);
|
||||||
debug!("doc (attr): %?", doc);
|
debug!("doc (attr): %?", doc);
|
||||||
|
let doc = (prune_hidden_pass::mk_pass().f)(srv.clone(), doc);
|
||||||
|
debug!("doc (prune_hidden): %?", doc);
|
||||||
let doc = (desc_to_brief_pass::mk_pass().f)(srv.clone(), doc);
|
let doc = (desc_to_brief_pass::mk_pass().f)(srv.clone(), doc);
|
||||||
debug!("doc (desc_to_brief): %?", doc);
|
debug!("doc (desc_to_brief): %?", doc);
|
||||||
let doc = (unindent_pass::mk_pass().f)(srv.clone(), doc);
|
let doc = (unindent_pass::mk_pass().f)(srv.clone(), doc);
|
||||||
|
|
|
@ -277,7 +277,8 @@ mod test {
|
||||||
.. config::default_config(&Path("input/test.rc"))
|
.. config::default_config(&Path("input/test.rc"))
|
||||||
};
|
};
|
||||||
let doc = mk_doc(~"", ~"mod a { mod b { } }");
|
let doc = mk_doc(~"", ~"mod a { mod b { } }");
|
||||||
let modb = copy doc.cratemod().mods()[0].mods()[0];
|
// hidden __std_macros module at the start.
|
||||||
|
let modb = copy doc.cratemod().mods()[1].mods()[0];
|
||||||
let page = doc::ItemPage(doc::ModTag(modb));
|
let page = doc::ItemPage(doc::ModTag(modb));
|
||||||
let filename = make_local_filename(&config, page);
|
let filename = make_local_filename(&config, page);
|
||||||
assert_eq!(filename, Path("output/dir/a_b.html"));
|
assert_eq!(filename, Path("output/dir/a_b.html"));
|
||||||
|
|
|
@ -152,8 +152,10 @@ fn fold_nmod(
|
||||||
mod test {
|
mod test {
|
||||||
use astsrv;
|
use astsrv;
|
||||||
use config;
|
use config;
|
||||||
|
use attr_pass;
|
||||||
use doc;
|
use doc;
|
||||||
use extract;
|
use extract;
|
||||||
|
use prune_hidden_pass;
|
||||||
use page_pass::run;
|
use page_pass::run;
|
||||||
|
|
||||||
fn mk_doc_(
|
fn mk_doc_(
|
||||||
|
@ -162,6 +164,8 @@ mod test {
|
||||||
) -> doc::Doc {
|
) -> doc::Doc {
|
||||||
do astsrv::from_str(copy source) |srv| {
|
do astsrv::from_str(copy source) |srv| {
|
||||||
let doc = extract::from_srv(srv.clone(), ~"");
|
let doc = extract::from_srv(srv.clone(), ~"");
|
||||||
|
let doc = (attr_pass::mk_pass().f)(srv.clone(), doc);
|
||||||
|
let doc = (prune_hidden_pass::mk_pass().f)(srv.clone(), doc);
|
||||||
run(srv.clone(), doc, output_style)
|
run(srv.clone(), doc, output_style)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -182,6 +186,7 @@ mod test {
|
||||||
#[test]
|
#[test]
|
||||||
fn should_make_a_page_for_every_mod() {
|
fn should_make_a_page_for_every_mod() {
|
||||||
let doc = mk_doc(~"mod a { }");
|
let doc = mk_doc(~"mod a { }");
|
||||||
|
// hidden __std_macros module at the start.
|
||||||
assert_eq!(doc.pages.mods()[0].name(), ~"a");
|
assert_eq!(doc.pages.mods()[0].name(), ~"a");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -97,10 +97,11 @@ fn should_record_mod_paths() {
|
||||||
do astsrv::from_str(source) |srv| {
|
do astsrv::from_str(source) |srv| {
|
||||||
let doc = extract::from_srv(srv.clone(), ~"");
|
let doc = extract::from_srv(srv.clone(), ~"");
|
||||||
let doc = run(srv.clone(), doc);
|
let doc = run(srv.clone(), doc);
|
||||||
assert!(doc.cratemod().mods()[0].mods()[0].mods()[0].path()
|
// hidden __std_macros module at the start.
|
||||||
== ~[~"a", ~"b"]);
|
assert_eq!(doc.cratemod().mods()[1].mods()[0].mods()[0].path(),
|
||||||
assert!(doc.cratemod().mods()[0].mods()[1].mods()[0].path()
|
~[~"a", ~"b"]);
|
||||||
== ~[~"a", ~"d"]);
|
assert_eq!(doc.cratemod().mods()[1].mods()[1].mods()[0].path(),
|
||||||
|
~[~"a", ~"d"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -110,6 +111,7 @@ fn should_record_fn_paths() {
|
||||||
do astsrv::from_str(source) |srv| {
|
do astsrv::from_str(source) |srv| {
|
||||||
let doc = extract::from_srv(srv.clone(), ~"");
|
let doc = extract::from_srv(srv.clone(), ~"");
|
||||||
let doc = run(srv.clone(), doc);
|
let doc = run(srv.clone(), doc);
|
||||||
assert_eq!(doc.cratemod().mods()[0].fns()[0].path(), ~[~"a"]);
|
// hidden __std_macros module at the start.
|
||||||
|
assert_eq!(doc.cratemod().mods()[1].fns()[0].path(), ~[~"a"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,12 +166,14 @@ mod test {
|
||||||
use attr_pass;
|
use attr_pass;
|
||||||
use doc;
|
use doc;
|
||||||
use extract;
|
use extract;
|
||||||
|
use prune_hidden_pass;
|
||||||
use sectionalize_pass::run;
|
use sectionalize_pass::run;
|
||||||
|
|
||||||
fn mk_doc(source: ~str) -> doc::Doc {
|
fn mk_doc(source: ~str) -> doc::Doc {
|
||||||
do astsrv::from_str(copy source) |srv| {
|
do astsrv::from_str(copy source) |srv| {
|
||||||
let doc = extract::from_srv(srv.clone(), ~"");
|
let doc = extract::from_srv(srv.clone(), ~"");
|
||||||
let doc = (attr_pass::mk_pass().f)(srv.clone(), doc);
|
let doc = (attr_pass::mk_pass().f)(srv.clone(), doc);
|
||||||
|
let doc = (prune_hidden_pass::mk_pass().f)(srv.clone(), doc);
|
||||||
run(srv.clone(), doc)
|
run(srv.clone(), doc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,8 @@ fn test() {
|
||||||
do astsrv::from_str(source) |srv| {
|
do astsrv::from_str(source) |srv| {
|
||||||
let doc = extract::from_srv(srv.clone(), ~"");
|
let doc = extract::from_srv(srv.clone(), ~"");
|
||||||
let doc = (mk_pass().f)(srv.clone(), doc);
|
let doc = (mk_pass().f)(srv.clone(), doc);
|
||||||
assert_eq!(doc.cratemod().items[0].name(), ~"y");
|
// hidden __std_macros module at the start.
|
||||||
assert_eq!(doc.cratemod().items[1].name(), ~"z");
|
assert_eq!(doc.cratemod().items[1].name(), ~"y");
|
||||||
|
assert_eq!(doc.cratemod().items[2].name(), ~"z");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,7 @@ fn test() {
|
||||||
do astsrv::from_str(source) |srv| {
|
do astsrv::from_str(source) |srv| {
|
||||||
let doc = extract::from_srv(srv.clone(), ~"");
|
let doc = extract::from_srv(srv.clone(), ~"");
|
||||||
let doc = (mk_pass().f)(srv.clone(), doc);
|
let doc = (mk_pass().f)(srv.clone(), doc);
|
||||||
|
// hidden __std_macros module at the start.
|
||||||
assert_eq!(doc.cratemod().items[0].name(), ~"iconst");
|
assert_eq!(doc.cratemod().items[0].name(), ~"iconst");
|
||||||
assert_eq!(doc.cratemod().items[1].name(), ~"itype");
|
assert_eq!(doc.cratemod().items[1].name(), ~"itype");
|
||||||
assert_eq!(doc.cratemod().items[2].name(), ~"ienum");
|
assert_eq!(doc.cratemod().items[2].name(), ~"ienum");
|
||||||
|
@ -60,6 +61,7 @@ fn test() {
|
||||||
assert_eq!(doc.cratemod().items[4].name(), ~"itrait");
|
assert_eq!(doc.cratemod().items[4].name(), ~"itrait");
|
||||||
assert_eq!(doc.cratemod().items[5].name(), ~"__extensions__");
|
assert_eq!(doc.cratemod().items[5].name(), ~"__extensions__");
|
||||||
assert_eq!(doc.cratemod().items[6].name(), ~"ifn");
|
assert_eq!(doc.cratemod().items[6].name(), ~"ifn");
|
||||||
assert_eq!(doc.cratemod().items[7].name(), ~"imod");
|
// hidden __std_macros module fits here.
|
||||||
|
assert_eq!(doc.cratemod().items[8].name(), ~"imod");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,10 +67,11 @@ fn test() {
|
||||||
do astsrv::from_str(source) |srv| {
|
do astsrv::from_str(source) |srv| {
|
||||||
let doc = extract::from_srv(srv.clone(), ~"");
|
let doc = extract::from_srv(srv.clone(), ~"");
|
||||||
let doc = (mk_pass(~"", name_lteq).f)(srv.clone(), doc);
|
let doc = (mk_pass(~"", name_lteq).f)(srv.clone(), doc);
|
||||||
assert_eq!(doc.cratemod().mods()[0].name(), ~"w");
|
// hidden __std_macros module at the start.
|
||||||
assert_eq!(doc.cratemod().mods()[1].items[0].name(), ~"x");
|
assert_eq!(doc.cratemod().mods()[1].name(), ~"w");
|
||||||
assert_eq!(doc.cratemod().mods()[1].items[1].name(), ~"y");
|
assert_eq!(doc.cratemod().mods()[2].items[0].name(), ~"x");
|
||||||
assert_eq!(doc.cratemod().mods()[1].name(), ~"z");
|
assert_eq!(doc.cratemod().mods()[2].items[1].name(), ~"y");
|
||||||
|
assert_eq!(doc.cratemod().mods()[2].name(), ~"z");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,10 +85,11 @@ fn should_be_stable() {
|
||||||
do astsrv::from_str(source) |srv| {
|
do astsrv::from_str(source) |srv| {
|
||||||
let doc = extract::from_srv(srv.clone(), ~"");
|
let doc = extract::from_srv(srv.clone(), ~"");
|
||||||
let doc = (mk_pass(~"", always_eq).f)(srv.clone(), doc);
|
let doc = (mk_pass(~"", always_eq).f)(srv.clone(), doc);
|
||||||
assert_eq!(doc.cratemod().mods()[0].items[0].name(), ~"b");
|
// hidden __std_macros module at the start.
|
||||||
assert_eq!(doc.cratemod().mods()[1].items[0].name(), ~"d");
|
assert_eq!(doc.cratemod().mods()[1].items[0].name(), ~"b");
|
||||||
|
assert_eq!(doc.cratemod().mods()[2].items[0].name(), ~"d");
|
||||||
let doc = (mk_pass(~"", always_eq).f)(srv.clone(), doc);
|
let doc = (mk_pass(~"", always_eq).f)(srv.clone(), doc);
|
||||||
assert_eq!(doc.cratemod().mods()[0].items[0].name(), ~"b");
|
assert_eq!(doc.cratemod().mods()[1].items[0].name(), ~"b");
|
||||||
assert_eq!(doc.cratemod().mods()[1].items[0].name(), ~"d");
|
assert_eq!(doc.cratemod().mods()[2].items[0].name(), ~"d");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,12 +28,14 @@ mod test {
|
||||||
use attr_pass;
|
use attr_pass;
|
||||||
use doc;
|
use doc;
|
||||||
use extract;
|
use extract;
|
||||||
|
use prune_hidden_pass;
|
||||||
use trim_pass::mk_pass;
|
use trim_pass::mk_pass;
|
||||||
|
|
||||||
fn mk_doc(source: ~str) -> doc::Doc {
|
fn mk_doc(source: ~str) -> doc::Doc {
|
||||||
do astsrv::from_str(copy source) |srv| {
|
do astsrv::from_str(copy source) |srv| {
|
||||||
let doc = extract::from_srv(srv.clone(), ~"");
|
let doc = extract::from_srv(srv.clone(), ~"");
|
||||||
let doc = (attr_pass::mk_pass().f)(srv.clone(), doc);
|
let doc = (attr_pass::mk_pass().f)(srv.clone(), doc);
|
||||||
|
let doc = (prune_hidden_pass::mk_pass().f)(srv.clone(), doc);
|
||||||
(mk_pass().f)(srv.clone(), doc)
|
(mk_pass().f)(srv.clone(), doc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -453,8 +453,9 @@ pub fn new_span(cx: @ExtCtxt, sp: span) -> span {
|
||||||
|
|
||||||
pub fn std_macros() -> @str {
|
pub fn std_macros() -> @str {
|
||||||
return
|
return
|
||||||
@"pub mod __std_macros {
|
@"mod __std_macros {
|
||||||
#[macro_escape];
|
#[macro_escape];
|
||||||
|
#[doc(hidden)];
|
||||||
|
|
||||||
macro_rules! ignore (($($x:tt)*) => (()))
|
macro_rules! ignore (($($x:tt)*) => (()))
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ pub mod rustrt {
|
||||||
|
|
||||||
pub fn fact(n: uint) -> uint {
|
pub fn fact(n: uint) -> uint {
|
||||||
unsafe {
|
unsafe {
|
||||||
debug!("n = %?", n);
|
info!("n = %?", n);
|
||||||
rustrt::rust_dbg_call(cb, n)
|
rustrt::rust_dbg_call(cb, n)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,6 @@ fn main() {
|
||||||
|
|
||||||
for uint::range(0u, n) |i| {
|
for uint::range(0u, n) |i| {
|
||||||
let x = uint::to_str(i);
|
let x = uint::to_str(i);
|
||||||
debug!(x);
|
info!(x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,6 +110,6 @@ fn main() {
|
||||||
copy args
|
copy args
|
||||||
};
|
};
|
||||||
|
|
||||||
debug!("%?", args);
|
info!("%?", args);
|
||||||
run(args);
|
run(args);
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,6 +106,6 @@ fn main() {
|
||||||
copy args
|
copy args
|
||||||
};
|
};
|
||||||
|
|
||||||
debug!("%?", args);
|
info!("%?", args);
|
||||||
run(args);
|
run(args);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,7 @@ fn roundtrip(id: int, n_tasks: int, p: &Port<int>, ch: &Chan<int>) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
token => {
|
token => {
|
||||||
debug!("thread: %d got token: %d", id, token);
|
info!("thread: %d got token: %d", id, token);
|
||||||
ch.send(token - 1);
|
ch.send(token - 1);
|
||||||
if token <= n_tasks {
|
if token <= n_tasks {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -33,11 +33,11 @@ fn main() {
|
||||||
|
|
||||||
fn run(repeat: int, depth: int) {
|
fn run(repeat: int, depth: int) {
|
||||||
for (repeat as uint).times {
|
for (repeat as uint).times {
|
||||||
debug!("starting %.4f", precise_time_s());
|
info!("starting %.4f", precise_time_s());
|
||||||
do task::try {
|
do task::try {
|
||||||
recurse_or_fail(depth, None)
|
recurse_or_fail(depth, None)
|
||||||
};
|
};
|
||||||
debug!("stopping %.4f", precise_time_s());
|
info!("stopping %.4f", precise_time_s());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ fn r(l: @nillist) -> r {
|
||||||
|
|
||||||
fn recurse_or_fail(depth: int, st: Option<State>) {
|
fn recurse_or_fail(depth: int, st: Option<State>) {
|
||||||
if depth == 0 {
|
if depth == 0 {
|
||||||
debug!("unwinding %.4f", precise_time_s());
|
info!("unwinding %.4f", precise_time_s());
|
||||||
fail!();
|
fail!();
|
||||||
} else {
|
} else {
|
||||||
let depth = depth - 1;
|
let depth = depth - 1;
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
fn test() {
|
fn test() {
|
||||||
let v: int;
|
let v: int;
|
||||||
v = 1; //~ NOTE prior assignment occurs here
|
v = 1; //~ NOTE prior assignment occurs here
|
||||||
debug!("v=%d", v);
|
info!("v=%d", v);
|
||||||
v = 2; //~ ERROR re-assignment of immutable variable
|
v = 2; //~ ERROR re-assignment of immutable variable
|
||||||
debug!("v=%d", v);
|
info!("v=%d", v);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -27,5 +27,5 @@ fn cat(in_x : uint, in_y : int) -> cat {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let nyan : cat = cat(52u, 99);
|
let nyan : cat = cat(52u, 99);
|
||||||
nyan.speak = || debug!("meow"); //~ ERROR attempted to take value of method
|
nyan.speak = || info!("meow"); //~ ERROR attempted to take value of method
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,5 +10,5 @@
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
#[attr] //~ ERROR expected item after attributes
|
#[attr] //~ ERROR expected item after attributes
|
||||||
debug!("hi");
|
info!("hi");
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,11 +21,11 @@ fn main() {
|
||||||
let a: clam = clam{x: @1, y: @2};
|
let a: clam = clam{x: @1, y: @2};
|
||||||
let b: clam = clam{x: @10, y: @20};
|
let b: clam = clam{x: @10, y: @20};
|
||||||
let z: int = a.x + b.y; //~ ERROR binary operation + cannot be applied to type `@int`
|
let z: int = a.x + b.y; //~ ERROR binary operation + cannot be applied to type `@int`
|
||||||
debug!(z);
|
info!(z);
|
||||||
assert_eq!(z, 21);
|
assert_eq!(z, 21);
|
||||||
let forty: fish = fish{a: @40};
|
let forty: fish = fish{a: @40};
|
||||||
let two: fish = fish{a: @2};
|
let two: fish = fish{a: @2};
|
||||||
let answer: int = forty.a + two.a; //~ ERROR binary operation + cannot be applied to type `@int`
|
let answer: int = forty.a + two.a; //~ ERROR binary operation + cannot be applied to type `@int`
|
||||||
debug!(answer);
|
info!(answer);
|
||||||
assert_eq!(answer, 42);
|
assert_eq!(answer, 42);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,4 +11,4 @@
|
||||||
// error-pattern:expected `~str` but found `int`
|
// error-pattern:expected `~str` but found `int`
|
||||||
|
|
||||||
static i: ~str = 10i;
|
static i: ~str = 10i;
|
||||||
fn main() { debug!(i); }
|
fn main() { info!(i); }
|
||||||
|
|
|
@ -17,6 +17,6 @@ fn compute1() -> float {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = compute1();
|
let x = compute1();
|
||||||
debug!(x);
|
info!(x);
|
||||||
assert_eq!(x, -4f);
|
assert_eq!(x, -4f);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ enum color { rgb(int, int, int), rgba(int, int, int, int), }
|
||||||
fn main() {
|
fn main() {
|
||||||
let red: color = rgb(255, 0, 0);
|
let red: color = rgb(255, 0, 0);
|
||||||
match red {
|
match red {
|
||||||
rgb(r, g, b) => { debug!("rgb"); }
|
rgb(r, g, b) => { info!("rgb"); }
|
||||||
hsl(h, s, l) => { debug!("hsl"); }
|
hsl(h, s, l) => { info!("hsl"); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ fn a() {
|
||||||
|
|
||||||
p[0] = 5; //~ ERROR cannot assign
|
p[0] = 5; //~ ERROR cannot assign
|
||||||
|
|
||||||
debug!("%d", *q);
|
info!("%d", *q);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn borrow(_x: &[int], _f: &fn()) {}
|
fn borrow(_x: &[int], _f: &fn()) {}
|
||||||
|
|
|
@ -18,14 +18,14 @@ fn box_imm() {
|
||||||
let v = ~3;
|
let v = ~3;
|
||||||
let _w = &v;
|
let _w = &v;
|
||||||
do task::spawn {
|
do task::spawn {
|
||||||
debug!("v=%d", *v);
|
info!("v=%d", *v);
|
||||||
//~^ ERROR cannot move `v` into closure
|
//~^ ERROR cannot move `v` into closure
|
||||||
}
|
}
|
||||||
|
|
||||||
let v = ~3;
|
let v = ~3;
|
||||||
let _w = &v;
|
let _w = &v;
|
||||||
task::spawn(|| {
|
task::spawn(|| {
|
||||||
debug!("v=%d", *v);
|
info!("v=%d", *v);
|
||||||
//~^ ERROR cannot move
|
//~^ ERROR cannot move
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ pub fn main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let z = copy tail[0];
|
let z = copy tail[0];
|
||||||
debug!(fmt!("%?", z));
|
info!(fmt!("%?", z));
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
::std::util::unreachable();
|
::std::util::unreachable();
|
||||||
|
|
|
@ -12,5 +12,5 @@ fn main() {
|
||||||
let x: int = 3;
|
let x: int = 3;
|
||||||
let y: &mut int = &mut x; //~ ERROR cannot borrow
|
let y: &mut int = &mut x; //~ ERROR cannot borrow
|
||||||
*y = 5;
|
*y = 5;
|
||||||
debug!(*y);
|
info!(*y);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,5 +13,5 @@
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
return;
|
return;
|
||||||
debug!("Paul is dead"); //~ ERROR: unreachable
|
info!("Paul is dead"); //~ ERROR: unreachable
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
// error-pattern: unresolved name `this_does_nothing_what_the`.
|
// error-pattern: unresolved name `this_does_nothing_what_the`.
|
||||||
fn main() { debug!("doing"); this_does_nothing_what_the; debug!("boing"); }
|
fn main() { info!("doing"); this_does_nothing_what_the; info!("boing"); }
|
||||||
|
|
|
@ -15,7 +15,7 @@ mod foo {
|
||||||
}
|
}
|
||||||
|
|
||||||
mod bar {
|
mod bar {
|
||||||
fn x() { debug!("x"); }
|
fn x() { info!("x"); }
|
||||||
|
|
||||||
pub fn y() { }
|
pub fn y() { }
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,5 +12,5 @@
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let a = if true { true };
|
let a = if true { true };
|
||||||
debug!(a);
|
info!(a);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,10 @@
|
||||||
use module_of_many_things::*;
|
use module_of_many_things::*;
|
||||||
|
|
||||||
mod module_of_many_things {
|
mod module_of_many_things {
|
||||||
pub fn f1() { debug!("f1"); }
|
pub fn f1() { info!("f1"); }
|
||||||
pub fn f2() { debug!("f2"); }
|
pub fn f2() { info!("f2"); }
|
||||||
fn f3() { debug!("f3"); }
|
fn f3() { info!("f3"); }
|
||||||
pub fn f4() { debug!("f4"); }
|
pub fn f4() { info!("f4"); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,13 +12,13 @@
|
||||||
|
|
||||||
mod circ1 {
|
mod circ1 {
|
||||||
pub use circ2::f2;
|
pub use circ2::f2;
|
||||||
pub fn f1() { debug!("f1"); }
|
pub fn f1() { info!("f1"); }
|
||||||
pub fn common() -> uint { return 0u; }
|
pub fn common() -> uint { return 0u; }
|
||||||
}
|
}
|
||||||
|
|
||||||
mod circ2 {
|
mod circ2 {
|
||||||
pub use circ1::f1;
|
pub use circ1::f1;
|
||||||
pub fn f2() { debug!("f2"); }
|
pub fn f2() { info!("f2"); }
|
||||||
pub fn common() -> uint { return 1u; }
|
pub fn common() -> uint { return 1u; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,6 @@
|
||||||
use zed::bar;
|
use zed::bar;
|
||||||
use zed::baz;
|
use zed::baz;
|
||||||
mod zed {
|
mod zed {
|
||||||
pub fn bar() { debug!("bar"); }
|
pub fn bar() { info!("bar"); }
|
||||||
}
|
}
|
||||||
fn main(args: ~[str]) { bar(); }
|
fn main(args: ~[str]) { bar(); }
|
||||||
|
|
|
@ -13,6 +13,6 @@ use baz::zed::bar; //~ ERROR unresolved import
|
||||||
|
|
||||||
mod baz {}
|
mod baz {}
|
||||||
mod zed {
|
mod zed {
|
||||||
pub fn bar() { debug!("bar3"); }
|
pub fn bar() { info!("bar3"); }
|
||||||
}
|
}
|
||||||
fn main(args: ~[str]) { bar(); }
|
fn main(args: ~[str]) { bar(); }
|
||||||
|
|
|
@ -11,4 +11,4 @@
|
||||||
// error-pattern: unresolved
|
// error-pattern: unresolved
|
||||||
use main::bar;
|
use main::bar;
|
||||||
|
|
||||||
fn main(args: ~[str]) { debug!("foo"); }
|
fn main(args: ~[str]) { info!("foo"); }
|
||||||
|
|
|
@ -13,4 +13,4 @@
|
||||||
mod a { pub use b::foo; }
|
mod a { pub use b::foo; }
|
||||||
mod b { pub use a::foo; }
|
mod b { pub use a::foo; }
|
||||||
|
|
||||||
fn main(args: ~[str]) { debug!("loop"); }
|
fn main(args: ~[str]) { info!("loop"); }
|
||||||
|
|
|
@ -11,5 +11,5 @@
|
||||||
// Regression test for issue #1448 and #1386
|
// Regression test for issue #1448 and #1386
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
debug!("%u", 10i); //~ ERROR mismatched types
|
info!("%u", 10i); //~ ERROR mismatched types
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,4 +10,4 @@
|
||||||
|
|
||||||
// error-pattern: unresolved name `foobar`.
|
// error-pattern: unresolved name `foobar`.
|
||||||
|
|
||||||
fn main(args: ~[str]) { debug!(foobar); }
|
fn main(args: ~[str]) { info!(foobar); }
|
||||||
|
|
|
@ -19,7 +19,7 @@ fn main()
|
||||||
{
|
{
|
||||||
|
|
||||||
let _z = match g(1, 2) {
|
let _z = match g(1, 2) {
|
||||||
g(x, x) => { debug!(x + x); }
|
g(x, x) => { info!(x + x); }
|
||||||
//~^ ERROR Identifier `x` is bound more than once in the same pattern
|
//~^ ERROR Identifier `x` is bound more than once in the same pattern
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,6 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
let i: int;
|
let i: int;
|
||||||
|
|
||||||
debug!(false && { i = 5; true });
|
info!(false && { i = 5; true });
|
||||||
debug!(i); //~ ERROR use of possibly uninitialized variable: `i`
|
info!(i); //~ ERROR use of possibly uninitialized variable: `i`
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,6 @@
|
||||||
// Tests that a function with a ! annotation always actually fails
|
// Tests that a function with a ! annotation always actually fails
|
||||||
// error-pattern: some control paths may return
|
// error-pattern: some control paths may return
|
||||||
|
|
||||||
fn bad_bang(i: uint) -> ! { debug!(3); }
|
fn bad_bang(i: uint) -> ! { info!(3); }
|
||||||
|
|
||||||
fn main() { bad_bang(5u); }
|
fn main() { bad_bang(5u); }
|
||||||
|
|
|
@ -12,6 +12,6 @@ fn force(f: &fn()) { f(); }
|
||||||
fn main() {
|
fn main() {
|
||||||
let x: int;
|
let x: int;
|
||||||
force(|| {
|
force(|| {
|
||||||
debug!(x); //~ ERROR capture of possibly uninitialized variable: `x`
|
info!(x); //~ ERROR capture of possibly uninitialized variable: `x`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,9 @@ fn foo() -> int {
|
||||||
x = 0;
|
x = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug!(x); //~ ERROR use of possibly uninitialized variable: `x`
|
info!(x); //~ ERROR use of possibly uninitialized variable: `x`
|
||||||
|
|
||||||
return 17;
|
return 17;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() { debug!(foo()); }
|
fn main() { info!(foo()); }
|
||||||
|
|
|
@ -16,9 +16,9 @@ fn foo() -> int {
|
||||||
x = 0;
|
x = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug!(x); //~ ERROR use of possibly uninitialized variable: `x`
|
info!(x); //~ ERROR use of possibly uninitialized variable: `x`
|
||||||
|
|
||||||
return 17;
|
return 17;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() { debug!(foo()); }
|
fn main() { info!(foo()); }
|
||||||
|
|
|
@ -9,4 +9,4 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
fn force(f: &fn() -> int) -> int { f() }
|
fn force(f: &fn() -> int) -> int { f() }
|
||||||
fn main() { debug!(force(|| {})); } //~ ERROR mismatched types
|
fn main() { info!(force(|| {})); } //~ ERROR mismatched types
|
||||||
|
|
|
@ -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.
|
||||||
|
|
||||||
fn foo(x: int) { debug!(x); }
|
fn foo(x: int) { info!(x); }
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x: int; if 1 > 2 { x = 10; }
|
let x: int; if 1 > 2 { x = 10; }
|
||||||
|
|
|
@ -8,12 +8,12 @@
|
||||||
// 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.
|
||||||
|
|
||||||
fn foo(x: int) { debug!(x); }
|
fn foo(x: int) { info!(x); }
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x: int;
|
let x: int;
|
||||||
if 1 > 2 {
|
if 1 > 2 {
|
||||||
debug!("whoops");
|
info!("whoops");
|
||||||
} else {
|
} else {
|
||||||
x = 10;
|
x = 10;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ fn main() {
|
||||||
let y: ~int = ~42;
|
let y: ~int = ~42;
|
||||||
let mut x: ~int;
|
let mut x: ~int;
|
||||||
loop {
|
loop {
|
||||||
debug!(y);
|
info!(y);
|
||||||
loop {
|
loop {
|
||||||
loop {
|
loop {
|
||||||
loop {
|
loop {
|
||||||
|
|
|
@ -13,7 +13,7 @@ fn main() {
|
||||||
let y: ~int = ~42;
|
let y: ~int = ~42;
|
||||||
let mut x: ~int;
|
let mut x: ~int;
|
||||||
loop {
|
loop {
|
||||||
debug!(y); //~ ERROR use of moved value: `y`
|
info!(y); //~ ERROR use of moved value: `y`
|
||||||
while true { while true { while true { x = y; copy x; } } }
|
while true { while true { while true { x = y; copy x; } } }
|
||||||
//~^ ERROR use of moved value: `y`
|
//~^ ERROR use of moved value: `y`
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,6 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
let i: int;
|
let i: int;
|
||||||
|
|
||||||
debug!(false || { i = 5; true });
|
info!(false || { i = 5; true });
|
||||||
debug!(i); //~ ERROR use of possibly uninitialized variable: `i`
|
info!(i); //~ ERROR use of possibly uninitialized variable: `i`
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.
|
||||||
|
|
||||||
fn foo(x: int) { debug!(x); }
|
fn foo(x: int) { info!(x); }
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x: int;
|
let x: int;
|
||||||
|
|
|
@ -11,6 +11,6 @@
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = ~5;
|
let x = ~5;
|
||||||
let y = x;
|
let y = x;
|
||||||
debug!(*x); //~ ERROR use of moved value: `x`
|
info!(*x); //~ ERROR use of moved value: `x`
|
||||||
copy y;
|
copy y;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
fn send<T:Send>(ch: _chan<T>, data: T) {
|
fn send<T:Send>(ch: _chan<T>, data: T) {
|
||||||
debug!(ch);
|
info!(ch);
|
||||||
debug!(data);
|
info!(data);
|
||||||
fail!();
|
fail!();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ struct _chan<T>(int);
|
||||||
// message after the send deinitializes it
|
// message after the send deinitializes it
|
||||||
fn test00_start(ch: _chan<~int>, message: ~int, _count: ~int) {
|
fn test00_start(ch: _chan<~int>, message: ~int, _count: ~int) {
|
||||||
send(ch, message);
|
send(ch, message);
|
||||||
debug!(message); //~ ERROR use of moved value: `message`
|
info!(message); //~ ERROR use of moved value: `message`
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() { fail!(); }
|
fn main() { fail!(); }
|
||||||
|
|
|
@ -14,7 +14,7 @@ fn test(cond: bool) {
|
||||||
v = 3;
|
v = 3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
debug!("%d", v); //~ ERROR use of possibly uninitialized variable: `v`
|
info!("%d", v); //~ ERROR use of possibly uninitialized variable: `v`
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
|
|
@ -16,6 +16,6 @@ fn my_fail() -> ! { fail!(); }
|
||||||
fn main() {
|
fn main() {
|
||||||
match true { false => { my_fail(); } true => { } }
|
match true { false => { my_fail(); } true => { } }
|
||||||
|
|
||||||
debug!(x); //~ ERROR unresolved name `x`.
|
info!(x); //~ ERROR unresolved name `x`.
|
||||||
let x: int;
|
let x: int;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,5 +15,5 @@ struct foo {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
debug!(foo{ x: 1 } as int);
|
info!(foo{ x: 1 } as int);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,4 +10,4 @@
|
||||||
|
|
||||||
// error-pattern:literal out of range
|
// error-pattern:literal out of range
|
||||||
|
|
||||||
fn main() { debug!(300u8); }
|
fn main() { info!(300u8); }
|
||||||
|
|
|
@ -32,6 +32,6 @@ fn main() {
|
||||||
let foo = Foo { bar: [1u8, 2, 3, 4, 5], baz: 10i32 };
|
let foo = Foo { bar: [1u8, 2, 3, 4, 5], baz: 10i32 };
|
||||||
unsafe {
|
unsafe {
|
||||||
let oof: Oof<[u8, .. 5], i32> = cast::transmute(foo);
|
let oof: Oof<[u8, .. 5], i32> = cast::transmute(foo);
|
||||||
debug!(oof);
|
info!(oof);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,6 @@ fn main() {
|
||||||
let foo = Foo { bar: 1, baz: 10 };
|
let foo = Foo { bar: 1, baz: 10 };
|
||||||
unsafe {
|
unsafe {
|
||||||
let oof: Oof = cast::transmute(foo);
|
let oof: Oof = cast::transmute(foo);
|
||||||
debug!(oof);
|
info!(oof);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ enum bar { t1((), Option<~[int]>), t2, }
|
||||||
fn foo(t: bar) {
|
fn foo(t: bar) {
|
||||||
match t {
|
match t {
|
||||||
t1(_, Some::<int>(x)) => {
|
t1(_, Some::<int>(x)) => {
|
||||||
debug!(x);
|
info!(x);
|
||||||
}
|
}
|
||||||
_ => { fail!(); }
|
_ => { fail!(); }
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ fn main() {
|
||||||
// Can't do this copy
|
// Can't do this copy
|
||||||
let x = ~~~A {y: r(i)};
|
let x = ~~~A {y: r(i)};
|
||||||
let _z = copy x; //~ ERROR copying a value of non-copyable type
|
let _z = copy x; //~ ERROR copying a value of non-copyable type
|
||||||
debug!(x);
|
info!(x);
|
||||||
}
|
}
|
||||||
error!(*i);
|
error!(*i);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,5 +33,5 @@ fn dog() -> dog {
|
||||||
fn main() {
|
fn main() {
|
||||||
let mut d = dog();
|
let mut d = dog();
|
||||||
d.chase_cat();
|
d.chase_cat();
|
||||||
debug!("cats_chased: %u", d.cats_chased);
|
info!("cats_chased: %u", d.cats_chased);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,6 @@ fn wants_static_fn(_x: &'static fn()) {}
|
||||||
fn main() {
|
fn main() {
|
||||||
let i = 3;
|
let i = 3;
|
||||||
do wants_static_fn { //~ ERROR cannot infer an appropriate lifetime due to conflicting requirements
|
do wants_static_fn { //~ ERROR cannot infer an appropriate lifetime due to conflicting requirements
|
||||||
debug!("i=%d", i);
|
info!("i=%d", i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,5 +24,5 @@ fn return_it<'a>() -> &'a int {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = return_it();
|
let x = return_it();
|
||||||
debug!("foo=%d", *x);
|
info!("foo=%d", *x);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,5 +27,5 @@ fn return_it() -> &int {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let x = return_it();
|
let x = return_it();
|
||||||
debug!("foo=%d", *x);
|
info!("foo=%d", *x);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,5 +14,5 @@ fn test(f: @fn(uint) -> uint) -> uint {
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let f: ~fn(x: uint) -> uint = |x| 4u;
|
let f: ~fn(x: uint) -> uint = |x| 4u;
|
||||||
debug!(test(f)); //~ ERROR expected @ closure, found ~ closure
|
info!(test(f)); //~ ERROR expected @ closure, found ~ closure
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,5 +19,5 @@ impl Drop for r {
|
||||||
fn main() {
|
fn main() {
|
||||||
let i = ~r { b: true };
|
let i = ~r { b: true };
|
||||||
let _j = copy i; //~ ERROR copying a value of non-copyable type
|
let _j = copy i; //~ ERROR copying a value of non-copyable type
|
||||||
debug!(i);
|
info!(i);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,6 @@ fn main() {
|
||||||
f(copy r1, copy r2);
|
f(copy r1, copy r2);
|
||||||
//~^ ERROR copying a value of non-copyable type
|
//~^ ERROR copying a value of non-copyable type
|
||||||
//~^^ ERROR copying a value of non-copyable type
|
//~^^ ERROR copying a value of non-copyable type
|
||||||
debug!((r2, *i1));
|
info!((r2, *i1));
|
||||||
debug!((r1, *i2));
|
info!((r1, *i2));
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,5 +13,5 @@
|
||||||
use std::libc;
|
use std::libc;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
debug!(1.0 as *libc::FILE); // Can't cast float to foreign.
|
info!(1.0 as *libc::FILE); // Can't cast float to foreign.
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
fn f() {
|
fn f() {
|
||||||
let v = ~[1i];
|
let v = ~[1i];
|
||||||
debug!(v.some_field_name); //type error
|
info!(v.some_field_name); //type error
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
|
|
@ -25,5 +25,5 @@ fn main() {
|
||||||
let i = ~[r(0)];
|
let i = ~[r(0)];
|
||||||
let j = ~[r(1)];
|
let j = ~[r(1)];
|
||||||
let k = i + j;
|
let k = i + j;
|
||||||
debug!(j);
|
info!(j);
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,4 +9,4 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
fn blk1(b: &fn()) -> @fn() { return || { }; }
|
fn blk1(b: &fn()) -> @fn() { return || { }; }
|
||||||
fn test1() { (do blk1 { debug!("hi"); })(); }
|
fn test1() { (do blk1 { info!("hi"); })(); }
|
||||||
|
|
|
@ -43,7 +43,7 @@ fn main() {
|
||||||
for 10u.times {
|
for 10u.times {
|
||||||
do task::spawn {
|
do task::spawn {
|
||||||
let result = count(5u);
|
let result = count(5u);
|
||||||
debug!("result = %?", result);
|
info!("result = %?", result);
|
||||||
fail!();
|
fail!();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// error-pattern:woe
|
// error-pattern:woe
|
||||||
fn f(a: int) { debug!(a); }
|
fn f(a: int) { info!(a); }
|
||||||
|
|
||||||
fn main() { f(fail!("woe")); }
|
fn main() { f(fail!("woe")); }
|
||||||
|
|
|
@ -17,7 +17,7 @@ fn even(x: uint) -> bool {
|
||||||
|
|
||||||
fn foo(x: uint) {
|
fn foo(x: uint) {
|
||||||
if even(x) {
|
if even(x) {
|
||||||
debug!(x);
|
info!(x);
|
||||||
} else {
|
} else {
|
||||||
fail!("Number is odd");
|
fail!("Number is odd");
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,7 +19,7 @@ fn f<A:Copy + 'static>(a: A, b: u16) -> @fn() -> (A, u16) {
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let (a, b) = f(22_u64, 44u16)();
|
let (a, b) = f(22_u64, 44u16)();
|
||||||
debug!("a=%? b=%?", a, b);
|
info!("a=%? b=%?", a, b);
|
||||||
assert_eq!(a, 22u64);
|
assert_eq!(a, 22u64);
|
||||||
assert_eq!(b, 44u16);
|
assert_eq!(b, 44u16);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ pub fn main() {
|
||||||
let z = f(~x, y);
|
let z = f(~x, y);
|
||||||
make_cycle(z);
|
make_cycle(z);
|
||||||
let (a, b) = z();
|
let (a, b) = z();
|
||||||
debug!("a=%u b=%u", *a as uint, b as uint);
|
info!("a=%u b=%u", *a as uint, b as uint);
|
||||||
assert_eq!(*a, x);
|
assert_eq!(*a, x);
|
||||||
assert_eq!(b, y);
|
assert_eq!(b, y);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,6 @@
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let a: int = 10;
|
let a: int = 10;
|
||||||
debug!(a);
|
info!(a);
|
||||||
assert_eq!(a * (a - 1), 90);
|
assert_eq!(a * (a - 1), 90);
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,6 @@ pub fn main() {
|
||||||
assert_eq!(i32_b << 1, i32_b << 1);
|
assert_eq!(i32_b << 1, i32_b << 1);
|
||||||
assert_eq!(i32_b >> 1, i32_b >> 1);
|
assert_eq!(i32_b >> 1, i32_b >> 1);
|
||||||
assert_eq!(i32_b & i32_b << 1, 0);
|
assert_eq!(i32_b & i32_b << 1, 0);
|
||||||
debug!(i32_b | i32_b << 1);
|
info!(i32_b | i32_b << 1);
|
||||||
assert_eq!(i32_b | i32_b << 1, 0x30303030);
|
assert_eq!(i32_b | i32_b << 1, 0x30303030);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,6 +19,6 @@ struct Triple { x: int, y: int, z: int }
|
||||||
fn f<T:Copy,U:Copy>(x: T, y: U) -> Pair<T, U> { return Pair {a: x, b: y}; }
|
fn f<T:Copy,U:Copy>(x: T, y: U) -> Pair<T, U> { return Pair {a: x, b: y}; }
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
debug!("%?", f(Triple {x: 3, y: 4, z: 5}, 4).a.x);
|
info!("%?", f(Triple {x: 3, y: 4, z: 5}, 4).a.x);
|
||||||
debug!("%?", f(5, 6).a);
|
info!("%?", f(5, 6).a);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,8 @@ fn general() {
|
||||||
a ^= b;
|
a ^= b;
|
||||||
b ^= a;
|
b ^= a;
|
||||||
a = a ^ b;
|
a = a ^ b;
|
||||||
debug!(a);
|
info!(a);
|
||||||
debug!(b);
|
info!(b);
|
||||||
assert_eq!(b, 1);
|
assert_eq!(b, 1);
|
||||||
assert_eq!(a, 2);
|
assert_eq!(a, 2);
|
||||||
assert_eq!(!0xf0 & 0xff, 0xf);
|
assert_eq!(!0xf0 & 0xff, 0xf);
|
||||||
|
|
|
@ -23,7 +23,7 @@ pub fn main() {
|
||||||
|
|
||||||
x = @F {f: ~4};
|
x = @F {f: ~4};
|
||||||
|
|
||||||
debug!("ptr::to_unsafe_ptr(*b_x) = %x",
|
info!("ptr::to_unsafe_ptr(*b_x) = %x",
|
||||||
ptr::to_unsafe_ptr(&(**b_x)) as uint);
|
ptr::to_unsafe_ptr(&(**b_x)) as uint);
|
||||||
assert_eq!(**b_x, 3);
|
assert_eq!(**b_x, 3);
|
||||||
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(**b_x)));
|
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(**b_x)));
|
||||||
|
|
|
@ -28,7 +28,7 @@ pub fn main() {
|
||||||
assert_eq!(ptr::to_unsafe_ptr(&(*x.f)), ptr::to_unsafe_ptr(&(*b_x)));
|
assert_eq!(ptr::to_unsafe_ptr(&(*x.f)), ptr::to_unsafe_ptr(&(*b_x)));
|
||||||
x = @F {f: ~4};
|
x = @F {f: ~4};
|
||||||
|
|
||||||
debug!("ptr::to_unsafe_ptr(*b_x) = %x",
|
info!("ptr::to_unsafe_ptr(*b_x) = %x",
|
||||||
ptr::to_unsafe_ptr(&(*b_x)) as uint);
|
ptr::to_unsafe_ptr(&(*b_x)) as uint);
|
||||||
assert_eq!(*b_x, 3);
|
assert_eq!(*b_x, 3);
|
||||||
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(*b_x)));
|
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(*b_x)));
|
||||||
|
|
|
@ -23,7 +23,7 @@ pub fn main() {
|
||||||
|
|
||||||
*x = @F {f: ~4};
|
*x = @F {f: ~4};
|
||||||
|
|
||||||
debug!("ptr::to_unsafe_ptr(*b_x) = %x",
|
info!("ptr::to_unsafe_ptr(*b_x) = %x",
|
||||||
ptr::to_unsafe_ptr(&(**b_x)) as uint);
|
ptr::to_unsafe_ptr(&(**b_x)) as uint);
|
||||||
assert_eq!(**b_x, 3);
|
assert_eq!(**b_x, 3);
|
||||||
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(**b_x)));
|
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(**b_x)));
|
||||||
|
|
|
@ -28,7 +28,7 @@ pub fn main() {
|
||||||
assert_eq!(ptr::to_unsafe_ptr(&(*x.f)), ptr::to_unsafe_ptr(&(*b_x)));
|
assert_eq!(ptr::to_unsafe_ptr(&(*x.f)), ptr::to_unsafe_ptr(&(*b_x)));
|
||||||
*x = @F{f: ~4};
|
*x = @F{f: ~4};
|
||||||
|
|
||||||
debug!("ptr::to_unsafe_ptr(*b_x) = %x",
|
info!("ptr::to_unsafe_ptr(*b_x) = %x",
|
||||||
ptr::to_unsafe_ptr(&(*b_x)) as uint);
|
ptr::to_unsafe_ptr(&(*b_x)) as uint);
|
||||||
assert_eq!(*b_x, 3);
|
assert_eq!(*b_x, 3);
|
||||||
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(*b_x)));
|
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(*b_x)));
|
||||||
|
|
|
@ -26,7 +26,7 @@ pub fn main() {
|
||||||
assert_eq!(ptr::to_unsafe_ptr(&(*x)), ptr::to_unsafe_ptr(&(*b_x)));
|
assert_eq!(ptr::to_unsafe_ptr(&(*x)), ptr::to_unsafe_ptr(&(*b_x)));
|
||||||
x = @22;
|
x = @22;
|
||||||
|
|
||||||
debug!("ptr::to_unsafe_ptr(*b_x) = %x",
|
info!("ptr::to_unsafe_ptr(*b_x) = %x",
|
||||||
ptr::to_unsafe_ptr(&(*b_x)) as uint);
|
ptr::to_unsafe_ptr(&(*b_x)) as uint);
|
||||||
assert_eq!(*b_x, 3);
|
assert_eq!(*b_x, 3);
|
||||||
assert!(ptr::to_unsafe_ptr(&(*x)) != ptr::to_unsafe_ptr(&(*b_x)));
|
assert!(ptr::to_unsafe_ptr(&(*x)) != ptr::to_unsafe_ptr(&(*b_x)));
|
||||||
|
|
|
@ -25,13 +25,13 @@ fn testfn(cond: bool) {
|
||||||
exp = 4;
|
exp = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
debug!("*r = %d, exp = %d", *r, exp);
|
info!("*r = %d, exp = %d", *r, exp);
|
||||||
assert_eq!(*r, exp);
|
assert_eq!(*r, exp);
|
||||||
|
|
||||||
x = @5;
|
x = @5;
|
||||||
y = @6;
|
y = @6;
|
||||||
|
|
||||||
debug!("*r = %d, exp = %d", *r, exp);
|
info!("*r = %d, exp = %d", *r, exp);
|
||||||
assert_eq!(*r, exp);
|
assert_eq!(*r, exp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ pub fn main() {
|
||||||
assert_eq!(ptr::to_unsafe_ptr(&(*x.f)), ptr::to_unsafe_ptr(&(*b_x)));
|
assert_eq!(ptr::to_unsafe_ptr(&(*x.f)), ptr::to_unsafe_ptr(&(*b_x)));
|
||||||
x = @F {f: ~4};
|
x = @F {f: ~4};
|
||||||
|
|
||||||
debug!("ptr::to_unsafe_ptr(*b_x) = %x",
|
info!("ptr::to_unsafe_ptr(*b_x) = %x",
|
||||||
ptr::to_unsafe_ptr(&(*b_x)) as uint);
|
ptr::to_unsafe_ptr(&(*b_x)) as uint);
|
||||||
assert_eq!(*b_x, 3);
|
assert_eq!(*b_x, 3);
|
||||||
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(*b_x)));
|
assert!(ptr::to_unsafe_ptr(&(*x.f)) != ptr::to_unsafe_ptr(&(*b_x)));
|
||||||
|
|
|
@ -17,6 +17,6 @@ fn unbox<T:Copy>(b: Box<T>) -> T { return copy *b.c; }
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let foo: int = 17;
|
let foo: int = 17;
|
||||||
let bfoo: Box<int> = Box {c: @foo};
|
let bfoo: Box<int> = Box {c: @foo};
|
||||||
debug!("see what's in our box");
|
info!("see what's in our box");
|
||||||
assert_eq!(unbox::<int>(bfoo), foo);
|
assert_eq!(unbox::<int>(bfoo), foo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,5 +12,5 @@ use std::borrow;
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let x = 3;
|
let x = 3;
|
||||||
debug!("&x=%x", borrow::to_uint(&x));
|
info!("&x=%x", borrow::to_uint(&x));
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,6 @@ use cci_borrow_lib::foo;
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
let p = @22u;
|
let p = @22u;
|
||||||
let r = foo(p);
|
let r = foo(p);
|
||||||
debug!("r=%u", r);
|
info!("r=%u", r);
|
||||||
assert_eq!(r, 22u);
|
assert_eq!(r, 22u);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,13 +16,13 @@ use cci_impl_lib::uint_helpers;
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
//let bt0 = sys::frame_address();
|
//let bt0 = sys::frame_address();
|
||||||
//debug!("%?", bt0);
|
//info!("%?", bt0);
|
||||||
|
|
||||||
do 3u.to(10u) |i| {
|
do 3u.to(10u) |i| {
|
||||||
print(fmt!("%u\n", i));
|
print(fmt!("%u\n", i));
|
||||||
|
|
||||||
//let bt1 = sys::frame_address();
|
//let bt1 = sys::frame_address();
|
||||||
//debug!("%?", bt1);
|
//info!("%?", bt1);
|
||||||
//assert!(bt0 == bt1);
|
//assert!(bt0 == bt1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ extern mod cci_iter_lib;
|
||||||
|
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
//let bt0 = sys::rusti::frame_address(1u32);
|
//let bt0 = sys::rusti::frame_address(1u32);
|
||||||
//debug!("%?", bt0);
|
//info!("%?", bt0);
|
||||||
do cci_iter_lib::iter(~[1, 2, 3]) |i| {
|
do cci_iter_lib::iter(~[1, 2, 3]) |i| {
|
||||||
print(fmt!("%d", *i));
|
print(fmt!("%d", *i));
|
||||||
//assert!(bt0 == sys::rusti::frame_address(2u32));
|
//assert!(bt0 == sys::rusti::frame_address(2u32));
|
||||||
|
|
|
@ -21,12 +21,12 @@ pub fn main() {
|
||||||
// sys::frame_address() to determine if we are inlining is
|
// sys::frame_address() to determine if we are inlining is
|
||||||
// actually working.
|
// actually working.
|
||||||
//let bt0 = sys::frame_address();
|
//let bt0 = sys::frame_address();
|
||||||
//debug!("%?", bt0);
|
//info!("%?", bt0);
|
||||||
do iter(~[1u, 2u, 3u]) |i| {
|
do iter(~[1u, 2u, 3u]) |i| {
|
||||||
print(fmt!("%u\n", i));
|
print(fmt!("%u\n", i));
|
||||||
|
|
||||||
//let bt1 = sys::frame_address();
|
//let bt1 = sys::frame_address();
|
||||||
//debug!("%?", bt1);
|
//info!("%?", bt1);
|
||||||
|
|
||||||
//assert!(bt0 != bt1);
|
//assert!(bt0 != bt1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ use cci_class_cast::kitty::*;
|
||||||
|
|
||||||
fn print_out(thing: @ToStr, expected: ~str) {
|
fn print_out(thing: @ToStr, expected: ~str) {
|
||||||
let actual = thing.to_str();
|
let actual = thing.to_str();
|
||||||
debug!("%s", actual);
|
info!("%s", actual);
|
||||||
assert_eq!(actual, expected);
|
assert_eq!(actual, expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue