Skip to content

Commit e07e34c

Browse files
committed
Auto merge of #33272 - Manishearth:rollup, r=Manishearth
Rollup of 4 pull requests - Successful merges: #33239, #33248, #33253, #33258 - Failed merges:
2 parents c0c08e2 + f30058f commit e07e34c

File tree

4 files changed

+36
-7
lines changed

4 files changed

+36
-7
lines changed

src/doc/style/style/comments.md

+20-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
% Comments [FIXME: needs RFC]
1+
% Comments [RFC #505]
22

33
### Avoid block comments.
44

@@ -74,7 +74,25 @@ For example:
7474

7575
### Code snippets
7676

77-
> **[FIXME]**
77+
Only use inner doc comments `//!` to write crate and module-level documentation,
78+
nothing else. When using `mod` blocks, prefer `///` outside of the block:
79+
80+
```rust
81+
/// This module contains tests
82+
mod test {
83+
// ...
84+
}
85+
```
86+
87+
over
88+
89+
```rust
90+
mod test {
91+
//! This module contains tests
92+
93+
// ...
94+
}
95+
```
7896

7997
### Avoid inner doc comments.
8098

src/doc/style/style/features.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## `return` [FIXME: needs RFC]
1+
## `return` [RFC #968]
22

33
Terminate `return` statements with semicolons:
44

src/libcollections/fmt.rs

+13-2
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,19 @@
395395
//! `0`.
396396
//!
397397
//! The value for the width can also be provided as a `usize` in the list of
398-
//! parameters by using the `2$` syntax indicating that the second argument is a
399-
//! `usize` specifying the width.
398+
//! parameters by using the dollar syntax indicating that the second argument is
399+
//! a `usize` specifying the width, for example:
400+
//!
401+
//! ```
402+
//! // All of these print "Hello x !"
403+
//! println!("Hello {:5}!", "x");
404+
//! println!("Hello {:1$}!", "x", 5);
405+
//! println!("Hello {1:0$}!", 5, "x");
406+
//! ```
407+
//!
408+
//! Referring to an argument with the dollar syntax does not affect the "next
409+
//! argument" counter, so it's usually a good idea to refer to all arguments by
410+
//! their position explicitly.
400411
//!
401412
//! ## Precision
402413
//!

src/librustc_save_analysis/dump_visitor.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1032,8 +1032,8 @@ impl<'v, 'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor<'v> for DumpVisitor<'l, 'tcx,
10321032
}
10331033

10341034
let sub_span = self.span
1035-
.sub_span_of_token(path.span, token::BinOp(token::Star));
1036-
if !self.span.filter_generated(sub_span, path.span) {
1035+
.sub_span_of_token(item.span, token::BinOp(token::Star));
1036+
if !self.span.filter_generated(sub_span, item.span) {
10371037
self.dumper.use_glob(UseGlobData {
10381038
span: sub_span.expect("No span found for use glob"),
10391039
id: item.id,

0 commit comments

Comments
 (0)