This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gfx_parameters!( Uniforms { | |
// projection stuff | |
u_Model@ model: [[f32; 4]; 4], | |
u_View@ view: [[f32; 4]; 4], | |
u_Proj@ proj: [[f32; 4]; 4], | |
// texture data | |
t_CharMap@ char_map: [f32; 16384], | |
t_Tile@ tile: gfx::shade::TextureParam<R>, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn print(v: &BigRational) -> ~str { | |
match v.is_integer() { | |
true => v.numer().to_str(), | |
false => { | |
let whole_val = v.numer() / *v.denom(); | |
let remainder_val = v.numer() % *v.denom(); | |
let denom_fl: f64 = FromStr::from_str(v.denom().to_str()) | |
.expect("should be able to convert denom to float"); | |
let remainder_fl: f64 = FromStr::from_str(remainder_val.to_str()) | |
.expect("should be able to convert remainder to float"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn fact(n: i64) -> i64 { | |
if n <= 1 { 1 } | |
else { n * fact(n-1) } | |
} | |
fn main() { | |
println!("fact 10: {}", fact(10)); | |
println!("fact 100: {}", fact(100)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[test] | |
fn an_if_test_that_returns_a_None_out_expr_should_run_the_conseq_branch() { | |
let mut env = Env::new( | |
Some(vec!(~"x")), Some(vec!(Atom(Integer(42)))), | |
None); | |
let in_expr = parse_str(~"(if (set! x 37) (quote conseq) (quote alt))"); | |
let out_expr = { | |
let env_borrow = &mut env; | |
eval(in_expr, env_borrow).expect("should return an Expr") | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jeff@mbp:~/src/dungeongame (master)$ make | |
check: formatting | |
make -C p2d -f Makefile | |
check: formatting | |
rustc -L lib --opt-level=3 --out-dir lib -D warnings --dep-info .rust/p2dux.deps.mk src/p2dux/lib.rs | |
src/p2dux/view/mod.rs:61:29: 61:37 error: cannot borrow `*passives` as mutable more than once at a time | |
src/p2dux/view/mod.rs:61 for view in passives.mut_iter() { | |
^~~~~~~~ | |
src/p2dux/view/mod.rs:71:67: 71:75 note: previous borrow of `*passives` occurs here; the mutable borrow prevents subsequent moves, borrows, or modification of | |
`*passives` until the borrow ends |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
^~~~~~~~~ | |
error: linking with `cc` failed: exit code: 1 | |
note: cc arguments: '-m64' '-L/Users/jeff/lib/rustlib/x86_64-apple-darwin/lib' '-o' 'client' 'client.o' '-nodefaultlibs' '-Lp2d/lib' '-Llib' '-L/Users/jeff/src/dungeongame/.rust' '-L/Users/jeff/src/dungeongame' '-L/Users/jeff/src/.rust' '-L/Users/jeff/.rust' '-framework' 'SDL2' '/Users/jeff/lib/rustlib/x86_64-apple-darwin/lib/libstd-966edb7e-0.10-pre.rlib' '/Users/jeff/lib/rustlib/x86_64-apple-darwin/lib/libgreen-80d9e76a-0.10-pre.rlib' '/Users/jeff/lib/rustlib/x86_64-apple-darwin/lib/librustuv-09e0b925-0.10-pre.rlib' '/Users/jeff/lib/rustlib/x86_64-apple-darwin/lib/libnative-51515d1a-0.10-pre.rlib' '/Users/jeff/lib/rustlib/x86_64-apple-darwin/lib/libsync-7bf3a0fc-0.10-pre.rlib' '/Users/jeff/lib/rustlib/x86_64-apple-darwin/lib/libserialize-d01a48ca-0.10-pre.rlib' '/Users/jeff/lib/rustlib/x86_64-apple-darwin/lib/libcollections-6cc47867-0.10-pre.rlib' '/Users/jeff/lib/rustlib/x86_64-apple-darwin/lib/libgetopts-f2d8d0e7-0.10-pre |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// will pull in libserialize here in stage1+ | |
#[cfg(stage1, stage2, stage3)] | |
extern mod serialize = "serialize"; | |
// reexport extra::serialize in stage0 | |
#[cfg(stage0)] | |
pub mod serialize; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the offending code: | |
pub fn populate_world(world: &mut World<Agent>) -> Uuid { | |
let zone_a_id = world.new_zone(24, setup_zone); | |
// .... | |
} | |
/* | |
the error: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src/client/hf/ux/mod.rs:20:19: 20:20 error: cannot infer an appropriate lifetime for automatic coercion due to conflicting requirements | |
src/client/hf/ux/mod.rs:20 world: w, | |
^ | |
src/client/hf/ux/mod.rs:18:69: 23:5 note: first, the lifetime cannot outlive the lifetime &'a as defined on the block at 18:69... | |
src/client/hf/ux/mod.rs:18 pub fn new<'a>(w: &'a mut World, d: &'a GameDisplay) -> ZoneView { | |
src/client/hf/ux/mod.rs:19 ZoneView { | |
src/client/hf/ux/mod.rs:20 world: w, | |
src/client/hf/ux/mod.rs:21 display: d | |
src/client/hf/ux/mod.rs:22 } | |
src/client/hf/ux/mod.rs:23 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drwxr-xr-x 3 daemon daemon 36864 Oct 31 04:37 files |
NewerOlder