syntax: implement cfg!() which evaluates to true/false where #[cfg] would keep/remove.#8188
Closed
huonw wants to merge 1 commit intorust-lang:masterfrom
Closed
syntax: implement cfg!() which evaluates to true/false where #[cfg] would keep/remove.#8188huonw wants to merge 1 commit intorust-lang:masterfrom
huonw wants to merge 1 commit intorust-lang:masterfrom
Conversation
…ould keep/remove.
Example:
if cfg!(test) {
calculation_to_run_only_when_testing();
}
Closed
Contributor
|
Do commas in the cfg list represent conjunction or disjunction? |
Contributor
Author
|
Same as |
bors
added a commit
that referenced
this pull request
Aug 2, 2013
Example:
if cfg!(test) {
calculation_to_run_only_when_testing();
}
Closes #8130.
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Feb 24, 2022
…steffen new lint: `recursive_format_impl` The to_string_in_display lint is renamed to recursive_format_impl A check is added for the use of self formatted with Display or Debug inside any format string in the same impl The to_string_in_display check is kept as is - like in the format_in_format_args lint This is my first contribution so please check it for better / more idiomatic checks + error messages. Note the format macro paths are shared with the `format_in_format_args` lint - maybe those could be moved to clippy utils too. This relates to issues rust-lang#2691 and rust-lang#7830 ------ changelog: Renamed `to_string_in_display` lint to [`recursive_format_impl`] with new check for any use of self as Display or Debug inside the same format trait impl.
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.
Example:
Closes #8130.