From 140f6a2d468e726afce0d7623a0c2d7ef19b43dd Mon Sep 17 00:00:00 2001 From: Matthew Orris <--help> Date: Tue, 15 Aug 2023 11:13:04 -0600 Subject: [PATCH] feat: update to stable rust --- .rustfmt.toml | 8 ++++++++ Makefile | 7 ++++--- pallets/capacity/src/lib.rs | 2 +- pallets/frequency-tx-payment/src/lib.rs | 2 +- pallets/handles/src/lib.rs | 2 +- pallets/messages/src/lib.rs | 2 +- pallets/msa/src/lib.rs | 2 +- pallets/schemas/src/lib.rs | 2 +- pallets/stateful-storage/src/lib.rs | 2 +- pallets/time-release/src/lib.rs | 2 +- rust-toolchain.toml | 2 +- 11 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.rustfmt.toml b/.rustfmt.toml index 3018614bb1..049643883a 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -21,3 +21,11 @@ spaces_around_ranges = false trailing_comma = "Vertical" trailing_semicolon = false use_field_init_shorthand = true + +# Unstable (nightly-only) +# imports_granularity = "Crate" +# reorder_imports = true +# spaces_around_ranges = false +# binop_separator = "Back" +# match_arm_blocks = false +# reorder_impl_items = false \ No newline at end of file diff --git a/Makefile b/Makefile index dd9a36a9b2..07db9173f2 100644 --- a/Makefile +++ b/Makefile @@ -66,15 +66,16 @@ specs-rococo-local: .PHONY: format format: - cargo fmt + cargo +nightly fmt +# cargo fmt requires a toolchain version ^nightly-2022-11-15 because of unstable features # cargo doc requires a toolchain version ^nightly-2022-11-15 because of a bug that causes a panic # When the toolchain is updated to ^nightly-2023-06-01, `rustup run nightly-2023-06-01` can be removed .PHONY: lint lint: - cargo fmt --check + cargo +nightly-2023-06-01 fmt --check SKIP_WASM_BUILD=1 env -u RUSTFLAGS cargo clippy --features runtime-benchmarks,frequency-lint-check -- -D warnings - RUSTDOCFLAGS="--enable-index-page --check -Zunstable-options" rustup run nightly-2023-06-01 cargo doc --no-deps --features frequency + RUSTDOCFLAGS="--enable-index-page --check -Zunstable-options" cargo +nightly-2023-06-01 doc --no-deps --features frequency lint-audit: cargo deny check -c .cargo-deny.toml diff --git a/pallets/capacity/src/lib.rs b/pallets/capacity/src/lib.rs index a8f143b4a8..3fffa4db3e 100644 --- a/pallets/capacity/src/lib.rs +++ b/pallets/capacity/src/lib.rs @@ -40,7 +40,7 @@ // Substrate macros are tripping the clippy::expect_used lint. #![allow(clippy::expect_used)] #![cfg_attr(not(feature = "std"), no_std)] -#![feature(rustdoc_missing_doc_code_examples)] +// #![feature(rustdoc_missing_doc_code_examples)] // Strong Documentation Lints #![deny( rustdoc::broken_intra_doc_links, diff --git a/pallets/frequency-tx-payment/src/lib.rs b/pallets/frequency-tx-payment/src/lib.rs index f054453c79..fbbd1d8075 100644 --- a/pallets/frequency-tx-payment/src/lib.rs +++ b/pallets/frequency-tx-payment/src/lib.rs @@ -22,7 +22,7 @@ // Substrate macros are tripping the clippy::expect_used lint. #![allow(clippy::expect_used)] #![cfg_attr(not(feature = "std"), no_std)] -#![feature(rustdoc_missing_doc_code_examples)] +// #![feature(rustdoc_missing_doc_code_examples)] use codec::{Decode, Encode}; use frame_support::{ diff --git a/pallets/handles/src/lib.rs b/pallets/handles/src/lib.rs index 4bb097fbda..037baedb68 100644 --- a/pallets/handles/src/lib.rs +++ b/pallets/handles/src/lib.rs @@ -29,7 +29,7 @@ // Substrate macros are tripping the clippy::expect_used lint. #![allow(clippy::expect_used)] #![cfg_attr(not(feature = "std"), no_std)] -#![feature(rustdoc_missing_doc_code_examples)] +// #![feature(rustdoc_missing_doc_code_examples)] // Strong Documentation Lints #![deny( rustdoc::broken_intra_doc_links, diff --git a/pallets/messages/src/lib.rs b/pallets/messages/src/lib.rs index f3e65eb641..c6ccd32149 100644 --- a/pallets/messages/src/lib.rs +++ b/pallets/messages/src/lib.rs @@ -36,7 +36,7 @@ #![allow(clippy::expect_used)] // Ensure we're `no_std` when compiling for Wasm. #![cfg_attr(not(feature = "std"), no_std)] -#![feature(rustdoc_missing_doc_code_examples)] +// #![feature(rustdoc_missing_doc_code_examples)] // Strong Documentation Lints #![deny( rustdoc::broken_intra_doc_links, diff --git a/pallets/msa/src/lib.rs b/pallets/msa/src/lib.rs index 2acb2bff2a..28f054c44f 100644 --- a/pallets/msa/src/lib.rs +++ b/pallets/msa/src/lib.rs @@ -47,7 +47,7 @@ // Substrate macros are tripping the clippy::expect_used lint. #![allow(clippy::expect_used)] #![cfg_attr(not(feature = "std"), no_std)] -#![feature(rustdoc_missing_doc_code_examples)] +// #![feature(rustdoc_missing_doc_code_examples)] // Strong Documentation Lints #![deny( rustdoc::broken_intra_doc_links, diff --git a/pallets/schemas/src/lib.rs b/pallets/schemas/src/lib.rs index 1677879e04..1f0e55c315 100644 --- a/pallets/schemas/src/lib.rs +++ b/pallets/schemas/src/lib.rs @@ -43,7 +43,7 @@ // Substrate macros are tripping the clippy::expect_used lint. #![allow(clippy::expect_used)] #![cfg_attr(not(feature = "std"), no_std)] -#![feature(rustdoc_missing_doc_code_examples)] +// #![feature(rustdoc_missing_doc_code_examples)] #![allow(rustdoc::private_intra_doc_links)] // Strong Documentation Lints #![deny( diff --git a/pallets/stateful-storage/src/lib.rs b/pallets/stateful-storage/src/lib.rs index 6c3d4c26c9..179dd65201 100644 --- a/pallets/stateful-storage/src/lib.rs +++ b/pallets/stateful-storage/src/lib.rs @@ -44,7 +44,7 @@ #![allow(clippy::expect_used)] // Ensure we're `no_std` when compiling for Wasm. #![cfg_attr(not(feature = "std"), no_std)] -#![feature(rustdoc_missing_doc_code_examples)] +// #![feature(rustdoc_missing_doc_code_examples)] // Strong Documentation Lints #![deny( rustdoc::broken_intra_doc_links, diff --git a/pallets/time-release/src/lib.rs b/pallets/time-release/src/lib.rs index 7cfa7fef87..798a7bf747 100644 --- a/pallets/time-release/src/lib.rs +++ b/pallets/time-release/src/lib.rs @@ -28,7 +28,7 @@ // Substrate macros are tripping the clippy::expect_used lint. #![allow(clippy::expect_used)] #![cfg_attr(not(feature = "std"), no_std)] -#![feature(rustdoc_missing_doc_code_examples)] +// #![feature(rustdoc_missing_doc_code_examples)] // Strong Documentation Lints #![deny( rustdoc::broken_intra_doc_links, diff --git a/rust-toolchain.toml b/rust-toolchain.toml index c3267efe3f..e7598b6a25 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,5 +1,5 @@ [toolchain] -channel = "nightly-2022-11-15" +channel = "stable" components = [ "clippy", "rust-docs", "rustfmt","rustc-dev", "rustc"] targets = [ "wasm32-unknown-unknown" ] profile = "minimal"