You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Comments are pieces of code that is usually ignored and can be placed anywhere. Doc comments in most languages are usually ignored by the compiler/interpreter. But Rust's so-called "doc comments" are different from normal comments:
Under every outer doc (/// ..., /** ... */, or #[doc = "..."]) must be a language item. Otherwise, it is a syntax error.
Every inner doc (//! ..., /*! ... */, or #![doc = "..."]) must be placed within a language item. Otherwise, it is a syntax error.
Doc comment is just syntactic sugar for the #[doc] attribute.
Suggestion
Doc comment in Rust is a flavor of Markdown, therefore it should be highlighted as a Markdown code snippet.
The text was updated successfully, but these errors were encountered:
From @KSXGitHub
Comments are pieces of code that is usually ignored and can be placed anywhere. Doc comments in most languages are usually ignored by the compiler/interpreter. But Rust's so-called "doc comments" are different from normal comments:
/// ...
,/** ... */
, or#[doc = "..."]
) must be a language item. Otherwise, it is a syntax error.//! ...
,/*! ... */
, or#![doc = "..."]
) must be placed within a language item. Otherwise, it is a syntax error.#[doc]
attribute.Suggestion
Doc comment in Rust is a flavor of Markdown, therefore it should be highlighted as a Markdown code snippet.
The text was updated successfully, but these errors were encountered: