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

Set C standard version using cc::Build::std #1322

Merged
merged 2 commits into from
Mar 6, 2024
Merged

Set C standard version using cc::Build::std #1322

merged 2 commits into from
Mar 6, 2024

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Mar 6, 2024

Based on #1321.

I am not certain whether this is better. For example, would this change be problematic if someone has been using a C compiler that does not support -std=c 20, but had enabled our "cxx/c 20" Cargo feature, yet was not using any C 20 features in their headers? It would have silently worked before by noop-ing the flag_if_supported, but maybe it shouldn't have.

    warning: returning the result of a `let` binding from a block
      --> flags/src/impl.rs:14:5
       |
    3  |     let mut flag = "c  11";
       |     ----------------------- unnecessary `let` binding
    ...
    14 |     flag
       |     ^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
       = note: `-W clippy::let-and-return` implied by `-W clippy::all`
       = help: to override `-W clippy::all` add `#[allow(clippy::let_and_return)]`
    help: return the expression directly
       |
    3  ~
    4  |
     ...
    13 |
    14 ~     ("c  11") as _
       |
@dtolnay dtolnay merged commit 3930a42 into master Mar 6, 2024
29 checks passed
@dtolnay dtolnay deleted the std branch March 6, 2024 08:09
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.

None yet

1 participant