<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="generator" content="rustdoc"> <title>Comments</title> <link rel="stylesheet" type="text/css" href="../rust.css"> <link rel="shortcut icon" href="https://www.rust-lang.org/favicon.ico"> </head> <body class="rustdoc"> <!--[if lte IE 8]> <div class="warning"> This old browser is unsupported and will most likely display funky things. </div> <![endif]--> <div id="versioninfo"> <img src="https://www.rust-lang.org/logos/rust-logo-32x32-blk.png" width="32" height="32" alt="Rust logo"><br> <span class="white-sticker"><a href="https://www.rust-lang.org">Rust</a> 1.25.0</span><br> <a href="https://github.com/rust-lang/rust/commit/" class="hash white-sticker"></a> </div> <h1 class="title">Comments</h1> <nav id="TOC"><ul></ul></nav><p><small>There is a new edition of the book and this is an old link.</small></p> <blockquote> <p>Comments must start with two slashes and continue until the end of the line. For comments that extend beyond a single line, you’ll need to include // on each line.</p> </blockquote> <pre class="rust rust-example-rendered"> <span class="comment">// So we’re doing something complicated here, long enough that we need</span> <span class="comment">// multiple lines of comments to do it! Whew! Hopefully, this comment will</span> <span class="comment">// explain what’s going on.</span><a class="test-arrow" target="_blank" href="https://play.rust-lang.org/?code=%23!%5Ballow(unused)%5D%0Afn%20main()%20%7B%0A%2F%2F%20So%20we%E2%80%99re%20doing%20something%20complicated%20here%2C%20long%20enough%20that%20we%20need%0A%2F%2F%20multiple%20lines%20of%20comments%20to%20do%20it!%20Whew!%20Hopefully%2C%20this%20comment%20will%0A%2F%2F%20explain%20what%E2%80%99s%20going%20on.%0A%7D">Run</a></pre> <hr /> <p>Here are the relevant sections in the new and old books:</p> <ul> <li><strong><a href="second-edition/ch03-04-comments.html">In the second edition: Ch 3.04 — Comments</a></strong></li> <li><small><a href="first-edition/comments.html">In the first edition: Ch 3.4 — Comments</a></small></li> </ul> <footer><p> Copyright © 2011 The Rust Project Developers. Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a> or the <a href="https://opensource.org/licenses/MIT">MIT license</a>, at your option. </p><p> This file may not be copied, modified, or distributed except according to those terms. </p></footer> </body> </html>