]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #33272 - Manishearth:rollup, r=Manishearth
authorbors <bors@rust-lang.org>
Fri, 29 Apr 2016 13:49:45 +0000 (06:49 -0700)
committerbors <bors@rust-lang.org>
Fri, 29 Apr 2016 13:49:45 +0000 (06:49 -0700)
Rollup of 4 pull requests

- Successful merges: #33239, #33248, #33253, #33258
- Failed merges:

src/doc/style/style/comments.md
src/doc/style/style/features.md
src/libcollections/fmt.rs
src/librustc_save_analysis/dump_visitor.rs

index bf8cf653dbb168519c05747ea7090d8f12910543..af02d87cc8da89d43dc3ef7ea557a75fa0869fc9 100644 (file)
@@ -1,4 +1,4 @@
-% Comments [FIXME: needs RFC]
+% Comments [RFC #505]
 
 ### Avoid block comments.
 
@@ -74,7 +74,25 @@ For example:
 
 ### Code snippets
 
-> **[FIXME]**
+Only use inner doc comments `//!` to write crate and module-level documentation,
+nothing else. When using `mod` blocks, prefer `///` outside of the block:
+
+```rust
+/// This module contains tests
+mod test {
+    // ...
+}
+```
+
+over
+
+```rust
+mod test {
+    //! This module contains tests
+
+    // ...
+}
+```
 
 ### Avoid inner doc comments.
 
index 578270fbdc256898c0573d40a74a384230993842..13cc37fc236ca4a6508227e17f111ce7e118ee37 100644 (file)
@@ -1,4 +1,4 @@
-## `return` [FIXME: needs RFC]
+## `return` [RFC #968]
 
 Terminate `return` statements with semicolons:
 
index e30e0b213afa161eb3da80c251349bd90af865f7..710a30ff2364ecdbdd076b40ac0b0c2da0f2fb9b 100644 (file)
 //! `0`.
 //!
 //! The value for the width can also be provided as a `usize` in the list of
-//! parameters by using the `2$` syntax indicating that the second argument is a
-//! `usize` specifying the width.
+//! parameters by using the dollar syntax indicating that the second argument is
+//! a `usize` specifying the width, for example:
+//!
+//! ```
+//! // All of these print "Hello x    !"
+//! println!("Hello {:5}!", "x");
+//! println!("Hello {:1$}!", "x", 5);
+//! println!("Hello {1:0$}!", 5, "x");
+//! ```
+//!
+//! Referring to an argument with the dollar syntax does not affect the "next
+//! argument" counter, so it's usually a good idea to refer to all arguments by
+//! their position explicitly.
 //!
 //! ## Precision
 //!
index a4efb68e63c25f78ca9c80934c223fc5a60d4c83..724bd7341e312eb316fd2a344a0353fc344db70d 100644 (file)
@@ -1032,8 +1032,8 @@ fn visit_item(&mut self, item: &ast::Item) {
                         }
 
                         let sub_span = self.span
-                                           .sub_span_of_token(path.span, token::BinOp(token::Star));
-                        if !self.span.filter_generated(sub_span, path.span) {
+                                           .sub_span_of_token(item.span, token::BinOp(token::Star));
+                        if !self.span.filter_generated(sub_span, item.span) {
                             self.dumper.use_glob(UseGlobData {
                                 span: sub_span.expect("No span found for use glob"),
                                 id: item.id,