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

Upgrades rust stable toolchain to 1.80.0 #2386

Closed
wants to merge 1 commit into from

Conversation

brooksprumo
Copy link

@brooksprumo
Copy link
Author

There's a lot of new warnings, but the overwhelming majority are these two, which are both about unexpected cfgs:

warning: unexpected `cfg` condition value: `solana`
 --> sdk/program-memory/src/lib.rs:6:7
  |
6 | #[cfg(target_os = "solana")]
  |       ^^^^^^^^^^^^^^^^^^^^
  |
  = note: expected values for `target_os` are: `aix`, `android`, `cuda`, `dragonfly`, `emscripten`, `espidf`, `freebsd`, `fuchsia`, `haiku`, `hermit`, `horizon`, `hurd`, `illumos`, `ios`, `l4re`, `linux`, `macos`, `netbsd`, `none`, `nto`, `openbsd`, `psp`, `redox`, `solaris`, `solid_asp3`, `teeos`, `tvos`, `uefi`, `unknown`, `visionos`, `vita`, `vxworks`, `wasi`, `watchos`, and `windows` and 2 more
  = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
  = note: `#[warn(unexpected_cfgs)]` on by default

and

warning: unexpected `cfg` condition name: `RUSTC_WITH_SPECIALIZATION`
 --> short-vec/src/lib.rs:2:13
  |
2 | #![cfg_attr(RUSTC_WITH_SPECIALIZATION, feature(min_specialization))]
  |             ^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: expected names are: `clippy`, `debug_assertions`, `doc`, `docsrs`, `doctest`, `feature`, `miri`, `overflow_checks`, `panic`, `proc_macro`, `relocation_model`, `rustfmt`, `sanitize`, `sanitizer_cfi_generalize_pointers`, `sanitizer_cfi_normalize_integers`, `target_abi`, `target_arch`, `target_endian`, `target_env`, `target_family`, `target_feature`, `target_has_atomic`, `target_has_atomic_equal_alignment`, `target_has_atomic_load_store`, `target_os`, `target_pointer_width`, `target_thread_local`, `target_vendor`, `test`, `ub_checks`, `unix`, and `windows`
  = help: consider using a Cargo feature instead
  = help: or consider adding in `Cargo.toml` the `check-cfg` lint config for the lint:
           [lints.rust]
           unexpected_cfgs = { level = "warn", check-cfg = ['cfg(RUSTC_WITH_SPECIALIZATION)'] }
  = help: or consider adding `println!("cargo::rustc-check-cfg=cfg(RUSTC_WITH_SPECIALIZATION)");` to the top of the `build.rs`
  = note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
  = note: `#[warn(unexpected_cfgs)]` on by default

These lints will need to be resolved before upgrading will succeed.

Here's the full log when running the new clippy:
clippy-rust-1.80.0.log

@brooksprumo
Copy link
Author

@yihau FYI

@brooksprumo
Copy link
Author

To fix the "unexpected cfgs" lint:

Add this to the workspace Cargo.toml file:

[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))', 'cfg(RUSTC_WITH_SPECIALIZATION)'] }

And add this to all the package Cargo.toml files:

[lints]
workspace = true

References:

@yihau
Copy link
Member

yihau commented Aug 1, 2024

uploaded the docker image but got the cfg warning in this PR. iirc our py script will complain about this new lint field

@brooksprumo
Copy link
Author

uploaded the docker image but got the cfg warning in this PR. iirc our py script will complain about this new lint field

Yep yep. Can your team pick up this PR to get the rust version upgraded? There are other lints to fix as well. Lots were related to docs formatting. Maybe there are others that actually touch code too.

@yihau
Copy link
Member

yihau commented Aug 1, 2024

okay. I think I will take over this one!

@yihau yihau mentioned this pull request Aug 8, 2024
@brooksprumo brooksprumo deleted the rust/1.80.0 branch October 18, 2024 14:29
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.

2 participants