Skip to content

Instantly share code, notes, and snippets.

@pnkfelix
Created February 26, 2013 16:25
Show Gist options
  • Save pnkfelix/5039801 to your computer and use it in GitHub Desktop.
Save pnkfelix/5039801 to your computer and use it in GitHub Desktop.
Demo of how to use `mod math { mod mat; }`
% cat math/mat.rs
pub struct Mat4<T> { x:T }
% cat main.rs
// // Don't do this:
// use math::mat::*;
// // Do this:
mod math { mod mat; }
fn main() {
use math::mat::Mat4;
let _m : Mat4<int>;
io::println("Hello World");
}%
% cat math/mat.rs
pub struct Mat4<T> { x:T }
% cat main.rs
// // Don't do this:
// use math::mat::*;
// // Do this:
mod math { mod mat; }
fn main() {
use math::mat::Mat4;
let _m : Mat4<int>;
io::println("Hello World");
}
% rustc main.rs
warning: no debug symbols in executable (-arch x86_64)
% ./main
Hello World
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment