Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax: implement cfg!() which evaluates to true/false where #[cfg] would keep/remove. #8188

Closed
wants to merge 1 commit into from

Conversation

huonw
Copy link
Member

@huonw huonw commented Aug 1, 2013

Example:

if cfg!(test) {
   calculation_to_run_only_when_testing();
}

Closes #8130.

…ould keep/remove.

Example:

   if cfg!(test) {
      calculation_to_run_only_when_testing();
   }
@huonw huonw mentioned this pull request Aug 1, 2013
@bblum
Copy link
Contributor

bblum commented Aug 1, 2013

Do commas in the cfg list represent conjunction or disjunction?

@huonw
Copy link
Member Author

huonw commented Aug 1, 2013

Same as #[cfg]: conjunction.

bors added a commit that referenced this pull request Aug 2, 2013
Example:

    if cfg!(test) {
       calculation_to_run_only_when_testing();
    }

Closes #8130.
@bors bors closed this Aug 2, 2013
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

if_test!() macro
4 participants