W3cubDocs

/Rust

Error code E0704

An incorrect visibility restriction was specified.

Erroneous code example:

#![allow(unused)]
fn main() {
mod foo {
    pub(foo) struct Bar {
        x: i32
    }
}
}

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
    }
}
fn main() {}

For more information see the Rust Reference on Visibility.

© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/error_codes/E0704.html