## Keyboard shortcuts

Press `←` or `→` to navigate between chapters

Press `S` or `/` to search in the book

Press `?` to show this help

Press `Esc` to hide this help

# Error code E0659

An item usage is ambiguous.

Erroneous code example:

    pub mod moon {
        pub fn foo() {}
    }

    pub mod earth {
        pub fn foo() {}
    }

    mod collider {
        pub use crate::moon::*;
        pub use crate::earth::*;
    }

    fn main() {
        crate::collider::foo(); // ERROR: `foo` is ambiguous
    }

This error generally appears when two items with the same name are imported into a module. Here, the `foo` functions are imported and reexported from the `collider` module and therefore, when we're using `collider::foo()`, both functions collide.

To solve this error, the best solution is generally to keep the path before the item when using it. Example:

    pub mod moon {
        pub fn foo() {}
    }

    pub mod earth {
        pub fn foo() {}
    }

    mod collider {
        pub use crate::moon;
        pub use crate::earth;
    }

    fn main() {
        crate::collider::moon::foo(); // ok!
        crate::collider::earth::foo(); // ok!
    }