Add documentation for conditional compilation#12220
Closed
tbu- wants to merge 1 commit intorust-lang:masterfrom
Closed
Add documentation for conditional compilation#12220tbu- wants to merge 1 commit intorust-lang:masterfrom
tbu- wants to merge 1 commit intorust-lang:masterfrom
Conversation
src/doc/rust.md
Outdated
Member
|
Thanks for doing this! I'm glad that these attributes are finally getting some documentation :) |
Contributor
|
FWIW, I don't think the current form of I don't think that should stop us from adding these docs though. |
This documents in-source conditions using #[cfg(...)] and configurations pre-defined by the compiler. Fix rust-lang#7962.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 25, 2022
…arzg Fix `character` semantic token type definition The semantic token type for character literals is called `character`: https://github.com/rust-lang/rust-analyzer/blob/94fa8a6534cf93276ad7e205026402f24d41a0b2/crates/rust-analyzer/src/semantic_tokens.rs#L51 and yet the definition in `package.json` uses `char`. In practice this means trying to highlight `char` doesn’t have any effect, while `character` doesn’t have any hover documentation and doesn’t appear in autocomplete. The definition also defines the fallback semantic token type as `type`; luckily since it currently references the non-existent `char` this doesn’t have any effect, since it doesn’t really make sense to highlight character literals as types. This PR fixes the definition in `package.json` to correctly reference `character`, and also defines the fallback type as `number`. I’d say character literals are closer to a shorthand for writing a number than a string, though this is debatable and I’d be happy to change it to `string`, or anything else.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add documentation for conditional compilation
This documents in-source conditions using #[cfg(...)] and configurations
pre-defined by the compiler.
Fix #7962.