diff options
| author | bors <bors@rust-lang.org> | 2016-04-29 06:49:45 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-04-29 06:49:45 -0700 |
| commit | e07e34c4b0ccdc0feecd49091682e6cc365b279a (patch) | |
| tree | d2543fc9a925d84c0d85368971bcfc3bbd0185fd | |
| parent | c0c08e2d77a4dab0414b08c4e9008113bf3fee67 (diff) | |
| parent | f30058facff3c60e3d9c8fd22b40aae10bb8e022 (diff) | |
| download | rust-e07e34c4b0ccdc0feecd49091682e6cc365b279a.tar.gz rust-e07e34c4b0ccdc0feecd49091682e6cc365b279a.zip | |
Auto merge of #33272 - Manishearth:rollup, r=Manishearth
Rollup of 4 pull requests - Successful merges: #33239, #33248, #33253, #33258 - Failed merges:
| -rw-r--r-- | src/doc/style/style/comments.md | 22 | ||||
| -rw-r--r-- | src/doc/style/style/features.md | 2 | ||||
| -rw-r--r-- | src/libcollections/fmt.rs | 15 | ||||
| -rw-r--r-- | src/librustc_save_analysis/dump_visitor.rs | 4 |
4 files changed, 36 insertions, 7 deletions
diff --git a/src/doc/style/style/comments.md b/src/doc/style/style/comments.md index bf8cf653dbb..af02d87cc8d 100644 --- a/src/doc/style/style/comments.md +++ b/src/doc/style/style/comments.md @@ -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. diff --git a/src/doc/style/style/features.md b/src/doc/style/style/features.md index 578270fbdc2..13cc37fc236 100644 --- a/src/doc/style/style/features.md +++ b/src/doc/style/style/features.md @@ -1,4 +1,4 @@ -## `return` [FIXME: needs RFC] +## `return` [RFC #968] Terminate `return` statements with semicolons: diff --git a/src/libcollections/fmt.rs b/src/libcollections/fmt.rs index e30e0b213af..710a30ff236 100644 --- a/src/libcollections/fmt.rs +++ b/src/libcollections/fmt.rs @@ -395,8 +395,19 @@ //! `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 //! diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs index a4efb68e63c..724bd7341e3 100644 --- a/src/librustc_save_analysis/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -1032,8 +1032,8 @@ impl<'v, 'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor<'v> for DumpVisitor<'l, 'tcx, } 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, |
