Error code E0704

An incorrect visibility restriction was specified.

Erroneous code example:

mod foo {
    pub(foo) struct Bar {
        x: i32
    }
}
Run

To make struct Bar only visible in module foo the in keyword should be used:

mod foo {
    pub(in crate::foo) struct Bar {
        x: i32
    }
}
Run

For more information see the Rust Reference on Visibility.

Back to list of error codes