docs

You are reading the docs for v0.1.2. Nabi 0.1.2 is no longer supported. Latest release: v0.1.3 →

#E0016: visibility where it has no meaning

pub was written where it changes nothing: on a function or item inside a block (it is visible only in that block) or on an enum variant (variants take the enum's visibility). Remove it.

nabi
enum Color { pub Red, Blue }
error[E0016]: enum variants take the enum's visibility; remove the visibility keyword
  --> main.nabi:1:14
   |
 1 | enum Color { pub Red, Blue }
   |              ^^^

Remove pub from the variant; to make the variants visible, mark the enum pub.

nabi
#[derive(Debug)]
pub enum Color { Red, Blue }
println(f"{Color::Red:?}");
Red

Related: E0034 item is private

Found a mistake? Edit this page on GitHub. Last updated