1.1 Comments

모든 프로그램이 필요로 하는 주석을 Rust는 몇 가지 다양한 방식으로 지원한다:

  • 일반적인 주석 은 컴파일러에게 무시된다:
    • // 줄 주석은 라인 끝까지 포함
    • /* 블록 주석은 구분자가 끝날 때까지 포함 */
  • 문서 주석 은 HTML 라이브러리 문서로 번역된다.
    • /// 해당 아이템에 대한 라이브러리 문서를 생성.
    • `//! 둘러싼 아이템을 위한 라이브러리 문서를 생성
  • Regular comments which are ignored by the compiler:
    • // Line comments which go to the end of the line.
    • /* Block comments which go to the closing delimiter. */
  • Doc comments which are parsed into HTML library documentation:
    • /// Generate library docs for the following item.
    • //! Generate library docs for the enclosing item.
fn main() {
//
//
//
// println!("Hello, world!");
// . .
/*
* .
*
*
* . /* /* , */ */
* .
* main() /*/*/* ! */*/*/
*/
/*
, '*' .
.
*/
// .
// .
// :
let x = 5 + /* 90 + */ 5;
println!("Is `x` 10 or 100? x = {}", x);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

See also:

Library documentation

results matching ""

    No results matching ""