Uh oh!
There was an error while loading. Please reload this page.
Use different numbers of #s when expanding documentation comments - #27499
Conversation
rust-highfive
commented
Aug 3, 2015
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
brson
commented
Aug 4, 2015
This solution seems ok since the pretty-printer isn't relied on for its fidelity, but an alternate approach would be to store this information somewhere so the roundtrip doesn't lose information. Edit: I think I misunderstood this patch. |
brson
commented
Aug 4, 2015
By looking at the test case exercising this with |
huonw
commented
Aug 4, 2015
By stable rust source, you mean code will actually stop compiling? |
brson
commented
Aug 4, 2015
@huonw I don't know, maybe. The same way barosol can verify that the pretty printer (which is mostly not part of the Rust language itself) behaves this way via a test case, I'm imagining somebody might be able to write code that compiles and runs that can also detect this behavior - in which case the exact behavior requires more careful consideration than an implementation detail would. |
huonw
commented
Aug 4, 2015
Yeah, I guess code could theoretically have an |
brson
commented
Aug 5, 2015
Yes, agree it's better, but not sure if it's the solution that we want to put in the spec. Maybe we can get some other eyes. |
barosl
commented
Aug 9, 2015
So, the thing is that the "encoding" of documentation comments in macros has already been changed heavily recently.
Therefore, the problems I think are:
|
steveklabnik
commented
Oct 28, 2015
@rust-lang/lang, this has been waiting on a decision for two (almost three) months now. |
pnkfelix
commented
Oct 28, 2015
nominating |
nikomatsakis
commented
Oct 29, 2015
Discussed at lang team meeting. Consensus was: I do think @brson raised a good point, but I also feel comfortable with this solution. It seems like a strict improvement on the status quo -- we desugar |
steveklabnik
commented
Nov 3, 2015
@barosl would you mind adding the comments that @nikomatsakis referred to, before we merge this? |
barosl
commented
Nov 3, 2015
Ok, so I guess Also, do you think this PR itself is a breaking change? In that case, I will have to append |
nikomatsakis
commented
Nov 4, 2015
@barosl I don't consider this a breaking change, personally. It seems POSSIBLE that someone is relying on this, but highly unlikely, so an annotation seems more likely to produce noise than be of use. But others may have another POV. |
steveklabnik
commented
Nov 4, 2015
I feel the same as @nikomatsakis |
bors
commented
Nov 6, 2015
☔ The latest upstream changes (presumably #29582) made this pull request unmergeable. Please resolve the merge conflicts. |
durka
commented
Dec 16, 2015
Was there a decision on this? |
nikomatsakis
commented
Dec 22, 2015
@durka yes: #27499 (comment) PR is considered OK. |
steveklabnik
commented
Dec 31, 2015
@barosl can you rebase this so we can FINALLY get it merged? :) |
8597e59 to
928fdb2CompareAny 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. Fixesrust-lang#27489.
928fdb2 to
1a8cdc0CompareThere was a problem hiding this comment.
Rebased, sorry for the huge delay.
Also I added this comment. Please tell me if it lacks some information.
alexcrichton
commented
Jan 27, 2016
(ping) Does this just need a re-review to move forward? |
nikomatsakis
commented
Feb 2, 2016
@bors r+ |
bors
commented
Feb 2, 2016
📌 Commit 1a8cdc0 has been approved by |
nikomatsakis
commented
Feb 2, 2016
@bors rollup |
…nikomatsakis 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. Fixesrust-lang#27489.
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.