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

chore: upgrade to rust 1.85.0 #5537

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:experimental

FROM rust:1.80.1 as builder
FROM rust:1.85.0 as builder
WORKDIR /usr/src

# 1a: Prepare for static linking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ where
&'a self,
method: &'a str,
params: &'a Value,
) -> FuturesUnordered<impl Future<Output = Result<Value, HttpClientError>> + Sized + '_> {
) -> FuturesUnordered<impl Future<Output = Result<Value, HttpClientError>> + Sized + 'a> {
let unordered = FuturesUnordered::new();
self.inner
.providers
Expand Down
2 changes: 1 addition & 1 deletion rust/main/hyperlane-core/src/accumulator/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ impl MerkleTree {
Zero(_) => {
*self = MerkleTree::create(&[elem], depth);
}
Node(ref mut hash, ref mut left, ref mut right) => {
Node(hash, left, right) => {
let left: &mut MerkleTree = &mut *left;
let right: &mut MerkleTree = &mut *right;
match (&*left, &*right) {
Expand Down
4 changes: 2 additions & 2 deletions rust/main/hyperlane-core/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub struct ContractLocator<'a> {
}

#[cfg(feature = "strum")]
impl<'a> std::fmt::Display for ContractLocator<'a> {
impl std::fmt::Display for ContractLocator<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(
f,
Expand Down Expand Up @@ -93,7 +93,7 @@ impl<'de> Deserialize<'de> for ReorgPeriod {

struct ReorgPeriodVisitor;

impl<'de> de::Visitor<'de> for ReorgPeriodVisitor {
impl de::Visitor<'_> for ReorgPeriodVisitor {
type Value = ReorgPeriod;

fn expecting(&self, f: &mut Formatter) -> std::fmt::Result {
Expand Down
1 change: 0 additions & 1 deletion rust/main/hyperlane-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#![warn(missing_docs)]
#![deny(unsafe_code)]
#![allow(unknown_lints)] // TODO: `rustc` 1.80.1 clippy issue
#![forbid(where_clauses_object_safety)]
extern crate core;

pub use chain::*;
Expand Down
1 change: 1 addition & 0 deletions rust/main/hyperlane-core/src/types/primitive_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#![allow(clippy::assign_op_pattern)]
#![allow(clippy::reversed_empty_ranges)]
#![allow(unexpected_cfgs)]

use std::{
ops::{Div, Mul},
Expand Down
4 changes: 2 additions & 2 deletions rust/main/hyperlane-core/src/types/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ pub enum ExpectedLen<'a> {
Between(usize, &'a mut [u8]),
}

impl<'a> fmt::Display for ExpectedLen<'a> {
impl fmt::Display for ExpectedLen<'_> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
match *self {
ExpectedLen::Exact(ref v) => write!(fmt, "{} bytes", v.len()),
Expand Down Expand Up @@ -271,7 +271,7 @@ where
len: ExpectedLen<'a>,
}

impl<'a, 'b> de::Visitor<'b> for Visitor<'a> {
impl<'b> de::Visitor<'b> for Visitor<'_> {
type Value = usize;

fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
Expand Down
1 change: 0 additions & 1 deletion rust/main/hyperlane-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#![forbid(unsafe_code)]
#![cfg_attr(test, warn(missing_docs))]
#![allow(unknown_lints)] // TODO: `rustc` 1.80.1 clippy issue
#![forbid(where_clauses_object_safety)]

/// Mock contracts
pub mod mocks;
2 changes: 1 addition & 1 deletion rust/main/rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.80.1"
channel = "1.85.0"
profile = "default"
22 changes: 4 additions & 18 deletions rust/main/utils/abigen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::ffi::OsStr;
use std::fs::{self, File};
use std::io::Write;
use std::path::Path;
use std::path::PathBuf;

use inflector::Inflector;

Expand Down Expand Up @@ -140,26 +141,11 @@ fn fmt_file(path: &Path) {

/// Get the rustfmt binary path.
#[cfg(feature = "fmt")]
fn rustfmt_path() -> &'static Path {
use std::path::PathBuf;

// lazy static var
static mut PATH: Option<PathBuf> = None;

if let Some(path) = unsafe { PATH.as_ref() } {
return path;
}

fn rustfmt_path() -> PathBuf {
if let Ok(path) = std::env::var("RUSTFMT") {
unsafe {
PATH = Some(PathBuf::from(path));
PATH.as_ref().unwrap()
}
PathBuf::from(path)
} else {
// assume it is in PATH
unsafe {
PATH = Some(which::which("rustmft").unwrap_or_else(|_| "rustfmt".into()));
PATH.as_ref().unwrap()
}
which::which("rustmft").unwrap_or_else(|_| "rustfmt".into())
}
}
1 change: 1 addition & 0 deletions rust/sealevel/programs/helloworld/src/processor.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! HelloWorld program.
#![allow(unexpected_cfgs)]

use access_control::AccessControl;
use account_utils::{create_pda_account, SizedData};
Expand Down
Loading