Uh oh!
There was an error while loading. Please reload this page.
Fix rendering of const keyword for functions - #44254
Conversation
QuietMisdreavus
commented
Sep 2, 2017
So there's something weird i noticed when digging into this. I saw that you took out the import for It turns out, associated fns use a different check altogether: However, this doesn't stop constness from showing up in the stable std docs. I'm starting to think the check here to make sure we don't print constness on stable builds is superfluous. We try to compile the crate anyway; if it builds, we're on a nightly build (or a bootstrap build), by definition. If we can't hide constness from the stable std docs, then we should just leave it in and treat it like the way we treat other unstable things in the stable docs: give people a chance to look into it and shape it. cc @rust-lang/docs Pulling in the rest of the team here; what do y'all think about this idea? |
GuillaumeGomez
commented
Sep 10, 2017
Any news in here? |
steveklabnik
commented
Sep 11, 2017
👍 from me; we also had previously printed |
QuietMisdreavus
commented
Sep 11, 2017
We talked about this on IRC, and are generally in favor of printing constness all the time. To this end, i'd like it if you took out the check for bare functions, right here so it doesn't even try to mask it (this is the check that doesn't work and always prints it). |
67e8c01 to
15d1d7bCompareQuietMisdreavus
commented
Sep 11, 2017
travis failure: |
15d1d7b to
77b5a6aCompareGuillaumeGomez
commented
Sep 11, 2017
What failure? :p |
There was a problem hiding this comment.
Would you mind adding something to this test to make sure we're rendering "const" on associated functions too? Something like this is what i have in mind:
// @has foo/struct.Foo.html// @has - '//*[@class="method"]' 'pub const fn new()'pubstructFoo(usize);implFoo{pubconstfnnew() -> Foo{Foo(0)}}77b5a6a to
742ff5aCompareQuietMisdreavus
commented
Sep 12, 2017
r=me pending travis |
QuietMisdreavus
commented
Sep 12, 2017
@bors r+ rollup |
bors
commented
Sep 12, 2017
📌 Commit 742ff5a has been approved by |
…=QuietMisdreavus Fix rendering of const keyword for functions Fixesrust-lang#44187. r? @QuietMisdreavus
…=QuietMisdreavus Fix rendering of const keyword for functions Fixesrust-lang#44187. r? @QuietMisdreavus
…=QuietMisdreavus Fix rendering of const keyword for functions Fixesrust-lang#44187. r? @QuietMisdreavus
Fixes#44187.
r? @QuietMisdreavus