From 9ec051d3b37ccd7c89781f7319d58dce19f6fa23 Mon Sep 17 00:00:00 2001 From: Ergenekon Yigit Date: Thu, 28 Apr 2016 11:22:11 +0300 Subject: [PATCH 1/4] update comments RFC and code snippets --- src/doc/style/style/comments.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/doc/style/style/comments.md b/src/doc/style/style/comments.md index bf8cf653dbb16..af02d87cc8da8 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. From 0e698ed2c6b53a09dd03cafaa28e54f1cbd7f75b Mon Sep 17 00:00:00 2001 From: Ergenekon Yigit Date: Thu, 28 Apr 2016 11:22:54 +0300 Subject: [PATCH 2/4] update features RFC --- src/doc/style/style/features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/style/style/features.md b/src/doc/style/style/features.md index 578270fbdc256..13cc37fc236ca 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: From 815987b4ce9c1649133263b388903322dd77ea6c Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Thu, 28 Apr 2016 17:49:10 +0200 Subject: [PATCH 3/4] Clarify std::fmt width docs w.r.t. dollar syntax and give example. --- src/libcollections/fmt.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/libcollections/fmt.rs b/src/libcollections/fmt.rs index e30e0b213afa1..710a30ff2364e 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 //! From e9c42257d5642b5a57a1bac4bb9904e24b80188f Mon Sep 17 00:00:00 2001 From: Jeffrey Seyfried Date: Wed, 27 Apr 2016 22:57:19 +0000 Subject: [PATCH 4/4] Fix #33213, a bug in which glob imports are not included in save-analysis data --- src/librustc_save_analysis/dump_visitor.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs index a4efb68e63c25..724bd7341e312 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,