-
Notifications
You must be signed in to change notification settings - Fork 616
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
Fix LTO setting and a clippy::use_self finding #1973
Conversation
Per upstream docs[0] and a warning in my IDE, the `lto` setting's valid options are: false, true, "fat", "thin", or "off". This commit changes our "yes" value to true.
``` warning: unnecessary structure name repetition --> rustls/src/msgs/handshake.rs:1385:52 | 1385 | pub(crate) fn new(cert: CertificateDer<'a>) -> CertificateEntry<'a> { | ^^^^^^^^^^^^^^^^^^^^ help: use the applicable keyword: `Self` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#use_self note: the lint level is defined here --> rustls/src/lib.rs:310:5 | 310 | clippy::use_self, | ^^^^^^^^^^^^^^^^ ```
@@ -25,4 25,4 @@ resolver = "2" | |||
|
|||
[profile.bench] | |||
codegen-units = 1 | |||
lto = "yes" | |||
lto = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol, i got "yes" from https://doc.rust-lang.org/rustc/codegen-options/index.html#lto which is actually documenting the rustc CLI :lolsob:
Benchmark resultsInstruction countsSignificant differencesClick to expand
Other differencesClick to expand
Wall-timeSignificant differencesThere are no significant wall-time differences Other differencesClick to expand
Additional informationCheckout details:
|
So it looks like there's a couple things going on with nightly clippy. Looking at a recent main job: a) we're throwing a lot of "rustc-check-cfg" warnings (also seeing these locally). I think my "fix" from #1942 was sufficient to fix stable, but isn't appeasing nightly. If I had to guess, I'd say it's related to the workaround I mentioned:
b) there are a lot of warnings that aren't failing the build, including the one fixed in this branch. It looks like we use I would be in favour of fixing B, but it will be blocked on figuring out A. I can take a crack at both in a little while after more pressing work. |
@djc This feels like something you are likely to have thoughts on :-) |
Yes, that was intentional. The stable ones only change every six weeks but nightly clippy can change everyday and can contain regressions (like false positives) that will get fixed before release. So getting warnings from nightly clippy feels like the right trade-off to me. |
That's fair, I just think they're hard to notice in practice unless you search them out. That's probably still the right trade-off. |
cargo: fix bench profile LTO setting
Per upstream docs and a warning in my IDE, the
lto
setting's valid options are: false, true, "fat", "thin", or "off". This commit changes our "yes" value to true.msgs: fix clippy::use_self finding
I'm not sure yet why CI didn't flag this, but I see it locally: