Question: I am working on a certain problem where given a URL I need to map it to a country. Even if I can reliably answer the question "Is this particular URL relevant to United States?" that should be sufficient. 

I am happy to have false negatives but never a false positive. 

Currently I am considering the following approach.

* See if the domain name of the URL is in top 1000 .com domains on Alexa for USA.
* Check if the the link was shared by US users on Facebook or twitter.

Has anyone solved this kind of problem before ?

Answer: 
This answer is outdated as of Rust 1.1.0-stable.

---

You need to add `#![macro_escape]` at the top of `macros.rs` and include it using `mod macros;` as mentioned in the [Macros Guide](http://doc.rust-lang.org/guide-macros.html#scoping-and-macro-import/export).

```
$ cat macros.rs
#![macro_escape]

#[macro_export]
macro_rules! my_macro {
    () => { println!("hi"); }
}

$ cat something.rs
#![feature(macro_rules)]
mod macros;

fn main() {
    my_macro!();
}

$ rustc something.rs
$ ./something
hi

```

For future reference,

```
$ rustc -v
rustc 0.13.0-dev (2790505c1 2014-11-03 14:17:26 +0000)

```
Adding `#![macro_use]` to the top of your file containing macros will cause all macros to be pulled into main.rs.

For example, let's assume this file is called node.rs:

```
#![macro_use]

macro_rules! test {
    () => { println!("Nuts"); }
}

macro_rules! best {
    () => { println!("Run"); }
}

pub fn fun_times() {
    println!("Is it really?");
}

```

Your main.rs would look sometime like the following:

```
mod node;  //We're using node.rs
mod toad;  //Also using toad.rs

fn main() {
    test!();
    best!();
    toad::a_thing();
}

```

Finally let's say you have a file called toad.rs that also requires these macros:

```
use node; //Notice this is 'use' not 'mod'

pub fn a_thing() {
  test!();

  node::fun_times();
}

```

Notice that once files are pulled into main.rs with `mod`, the rest of your files have access to them through the `use` keyword.