docs

您正在閱讀 v0.1.0 的文件。Nabi 0.1.0 已停止支援。 最新版本:v0.1.3 →

本頁尚未翻譯,以下為英文原文。

#E0015: doc comment documents nothing

A doc comment (/// or /** */) goes right before the item it documents. Move it there, or make it a plain comment (//).

nabi
fn f() {}
/// The answer.
error[E0015]: doc comment documents nothing: it must come before an item; use `//` for a plain comment
  --> main.nabi:2:1
   |
 2 | /// The answer.
   | ^^^^^^^^^^^^^^^

Move the doc comment onto the item it describes:

nabi
/// The answer.
fn answer() -> i32 { 42 }
println(f"{answer()}");
42

Related: E0010 unexpected token

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