From 1a8cdc0f2f6a9f513cefbed36e5f57c1c45b8039 Mon Sep 17 00:00:00 2001 From: Barosl Lee Date: Tue, 4 Aug 2015 02:01:15 +0900 Subject: Use different numbers of `#`s when expanding documentation comments Any documentation comments that contain raw-string-looking sequences may pretty-print invalid code when expanding them, as the current logic always uses the `r"literal"` form, without appending any `#`s. This commit calculates the minimum number of `#`s required to wrap a comment correctly and appends `#`s appropriately. Fixes #27489. --- src/libstd/macros.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libstd') diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index 0917346213f..b7afd12d8e5 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -365,6 +365,9 @@ pub mod builtin { /// stringification of all the tokens passed to the macro. No restrictions /// are placed on the syntax of the macro invocation itself. /// + /// Note that the expanded results of the input tokens may change in the + /// future. You should be careful if you rely on the output. + /// /// # Examples /// /// ``` -- cgit 1.4.1-3-g733a5