Skip to content

Commit

Permalink
ci: upgrade to rust 1.85.0 (#6979)
Browse files Browse the repository at this point in the history
## Description


## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
  • Loading branch information
sdankel authored Mar 4, 2025
1 parent ccba9b1 commit ba7c4a9
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ concurrency:
env:
CARGO_TERM_COLOR: always
REGISTRY: ghcr.io
RUST_VERSION: 1.82.0
RUST_VERSION: 1.85.0
NIGHTLY_RUST_VERSION: nightly-2024-10-21

jobs:
Expand Down
2 changes: 1 addition & 1 deletion forc-plugins/forc-debug/src/cli/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ pub async fn cmd_step(state: &mut State, mut args: Vec<String>) -> Result<()> {
// Determine whether to enable or disable single stepping
let enable = args
.first()
.map_or(true, |v| !["off", "no", "disable"].contains(&v.as_str()));
.is_none_or(|v| !["off", "no", "disable"].contains(&v.as_str()));

// Call the client
state
Expand Down
1 change: 1 addition & 0 deletions forc-plugins/forc-debug/tests/cli_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::process::Command;
#[test]
fn test_cli() {
let port = portpicker::pick_unused_port().expect("No ports free");
#[allow(clippy::zombie_processes)]
let mut fuel_core = Command::new("fuel-core")
.arg("run")
.arg("--debug")
Expand Down
2 changes: 1 addition & 1 deletion forc-plugins/forc-migrate/src/migrations/partial_eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ use super::{ContinueMigrationProcess, DryRun, MigrationStep, MigrationStepKind,
// changed by the introduction of `PartialEq`. Changing `Eq` constraint to `PartialEq`
// to lower the constraint is done in the `core` and `std`, where appropriate.
// Suggesting to developers doing this replacement in their projects is mentioned
/// in the tracking issue: https://github.com/FuelLabs/sway/issues/6883.
// in the tracking issue: https://github.com/FuelLabs/sway/issues/6883.

pub(super) const IMPLEMENT_EXPERIMENTAL_PARTIAL_EQ_AND_EQ_TRAITS: MigrationStep = MigrationStep {
title: "Implement experimental `PartialEq` and `Eq` traits",
Expand Down
2 changes: 1 addition & 1 deletion forc-plugins/forc-migrate/src/modifying/annotated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use sway_types::{Span, Spanned};

use super::Modifier;

impl<'a, T> Modifier<'a, Annotated<T>> {
impl<T> Modifier<'_, Annotated<T>> {
/// From `self`, removes [AttributeDecl] that contains an [Attribute]
/// whose span equals `attribute_span`.
///
Expand Down
2 changes: 1 addition & 1 deletion forc-plugins/forc-migrate/src/modifying/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::assert_insert_span;
use super::{Modifier, New};

#[allow(dead_code)]
impl<'a> Modifier<'a, Attribute> {
impl Modifier<'_, Attribute> {
pub(crate) fn set_name<S: AsRef<str> + ?Sized>(&mut self, name: &S) -> &mut Self {
// We preserve the current span of the name.
let insert_span = self.element.name.span();
Expand Down
2 changes: 1 addition & 1 deletion forc-plugins/forc-migrate/src/modifying/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::assert_insert_span;

use super::{Modifier, New};

impl<'a> Modifier<'a, ItemFn> {
impl Modifier<'_, ItemFn> {
pub(crate) fn set_name<S: AsRef<str> + ?Sized>(&mut self, name: &S) -> &mut Self {
// We preserve the current span of the name.
let insert_span = self.element.fn_signature.name.span();
Expand Down
2 changes: 1 addition & 1 deletion forc-plugins/forc-migrate/src/modifying/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use sway_types::{Span, Spanned};
use super::Modifier;

#[allow(dead_code)]
impl<'a> Modifier<'a, Module> {
impl Modifier<'_, Module> {
/// Removes an [Annotated<ItemKind>] from `self`.
/// The item to remove is identified by its [Span], `annotated_item_span`.
pub(crate) fn remove_annotated_item(&mut self, annotated_item_span: &Span) -> &mut Self {
Expand Down
2 changes: 1 addition & 1 deletion forc-plugins/forc-migrate/src/modifying/storage_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ impl ToInKey for Expr {
}

#[allow(dead_code)]
impl<'a> Modifier<'a, StorageField> {
impl Modifier<'_, StorageField> {
pub(crate) fn set_in_key<K: ToInKey>(&mut self, key: K) -> &mut Self {
// If the `in` token already exists, just replace the key and leave the `in`
// token as is. Place the key after the `in` token.
Expand Down
1 change: 1 addition & 0 deletions forc-plugins/forc-node/tests/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ async fn start_local_node_check_health() {
mode: Mode::Local(local_cmd),
};

#[allow(clippy::zombie_processes)]
let mut handle = op::run(cmd).await.unwrap().unwrap();
// Wait for node to start grapqhl service
sleep(Duration::from_secs(2)).await;
Expand Down
6 changes: 3 additions & 3 deletions sway-core/src/asm_generation/fuel/fuel_asm_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1821,7 +1821,7 @@ impl<'ir, 'eng> FuelAsmBuilder<'ir, 'eng> {
// XXX not required after we have FuelVM specific verifier.
if !key
.get_type(self.context)
.map_or(true, |key_ty| key_ty.is_ptr(self.context))
.is_none_or(|key_ty| key_ty.is_ptr(self.context))
{
return Err(CompileError::Internal(
"Key value for state clear is not a pointer.",
Expand Down Expand Up @@ -1923,7 +1923,7 @@ impl<'ir, 'eng> FuelAsmBuilder<'ir, 'eng> {
// XXX not required after we have FuelVM specific verifier.
if !key
.get_type(self.context)
.map_or(true, |key_ty| key_ty.is_ptr(self.context))
.is_none_or(|key_ty| key_ty.is_ptr(self.context))
{
return Err(CompileError::Internal(
"Key value for state load word is not a pointer.",
Expand Down Expand Up @@ -1993,7 +1993,7 @@ impl<'ir, 'eng> FuelAsmBuilder<'ir, 'eng> {

if stored_val
.get_type(self.context)
.map_or(true, |ty| !self.is_copy_type(&ty))
.is_none_or(|ty| !self.is_copy_type(&ty))
{
Err(CompileError::Internal(
"Attempt to store a non-copy type.",
Expand Down
6 changes: 3 additions & 3 deletions sway-core/src/control_flow_analysis/dead_code_analysis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ impl<'cfg> ControlFlowGraph<'cfg> {
connections_count
.get(n)
.cloned()
.map_or(true, |count| count <= 1)
.is_none_or(|count| count <= 1)
}
ControlFlowGraphNode::FunctionParameter { .. } => {
// Consider variables declarations dead when count is not greater than 1
// Function param always has the function pointing to them
connections_count
.get(n)
.cloned()
.map_or(true, |count| count <= 1)
.is_none_or(|count| count <= 1)
}
_ => false,
}
Expand Down Expand Up @@ -192,7 +192,7 @@ impl<'cfg> ControlFlowGraph<'cfg> {
connections_count
.get(n)
.cloned()
.map_or(true, |count| count > 1)
.is_none_or(|count| count > 1)
}
}
ControlFlowGraphNode::ProgramNode {
Expand Down
4 changes: 2 additions & 2 deletions sway-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ pub(crate) fn is_ty_module_cache_up_to_date(
let cache_up_to_date = build_config
.and_then(|x| x.lsp_mode.as_ref())
.and_then(|lsp| lsp.file_versions.get(path.as_ref()))
.map_or(true, |version| {
.is_none_or(|version| {
version.map_or(true, |v| typed.version.is_some_and(|tv| v <= tv))
});

Expand Down Expand Up @@ -802,7 +802,7 @@ pub fn compile_to_ast(
};

// If tests are not enabled, exclude them from `parsed_program`.
if build_config.map_or(true, |config| !config.include_tests) {
if build_config.is_none_or(|config| !config.include_tests) {
parsed_program.exclude_tests(engines);
}

Expand Down
2 changes: 1 addition & 1 deletion sway-core/src/query_engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ impl QueryEngine {
ident
.span()
.source_id()
.map_or(true, |id| id.program_id() != *program_id)
.is_none_or(|id| id.program_id() != *program_id)
});
}

Expand Down
4 changes: 2 additions & 2 deletions sway-core/src/type_system/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1869,10 +1869,10 @@ impl TypeEngine {
F: Fn(&SourceId) -> bool,
{
self.slab
.retain(|_, tsi| tsi.source_id.as_ref().map_or(true, &keep));
.retain(|_, tsi| tsi.source_id.as_ref().is_none_or(&keep));
self.shareable_types
.write()
.retain(|tsi, _| tsi.source_id.as_ref().map_or(true, &keep));
.retain(|tsi, _| tsi.source_id.as_ref().is_none_or(&keep));
}

/// Removes all data associated with `program_id` from the type engine.
Expand Down
22 changes: 11 additions & 11 deletions sway-ir/src/optimize/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,17 +239,17 @@ pub fn is_small_fn(
}

move |context: &Context, function: &Function, _call_site: &Value| -> bool {
max_blocks.map_or(true, |max_block_count| {
function.num_blocks(context) <= max_block_count
}) && max_instrs.map_or(true, |max_instrs_count| {
function.num_instructions_incl_asm_instructions(context) <= max_instrs_count
}) && max_stack_size.map_or(true, |max_stack_size_count| {
function
.locals_iter(context)
.map(|(_name, ptr)| count_type_elements(context, &ptr.get_inner_type(context)))
.sum::<usize>()
<= max_stack_size_count
})
max_blocks.is_none_or(|max_block_count| function.num_blocks(context) <= max_block_count)
&& max_instrs.is_none_or(|max_instrs_count| {
function.num_instructions_incl_asm_instructions(context) <= max_instrs_count
})
&& max_stack_size.is_none_or(|max_stack_size_count| {
function
.locals_iter(context)
.map(|(_name, ptr)| count_type_elements(context, &ptr.get_inner_type(context)))
.sum::<usize>()
<= max_stack_size_count
})
}
}

Expand Down
4 changes: 2 additions & 2 deletions sway-lsp/src/core/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ pub fn parse_project(
// Check if the last result is None or if results is empty, indicating an error occurred in the compiler.
// If we don't return an error here, then we will likely crash when trying to access the Engines
// during traversal or when creating runnables.
if results.last().map_or(true, |(value, _)| value.is_none()) {
if results.last().is_none_or(|(value, _)| value.is_none()) {
return Err(LanguageServerError::ProgramsIsNone);
}

Expand Down Expand Up @@ -711,7 +711,7 @@ impl BuildPlanCache {
.as_ref()
.and_then(|path| path.metadata().ok()?.modified().ok())
.map_or(cache.is_none(), |time| {
cache.as_ref().map_or(true, |&(_, last)| time > last)
cache.as_ref().is_none_or(|&(_, last)| time > last)
})
};

Expand Down
5 changes: 1 addition & 4 deletions sway-lsp/tests/integration/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,10 +718,7 @@ pub fn create_did_change_params(
}
}

pub(crate) async fn inlay_hints_request<'a>(
server: &ServerState,
uri: &Url,
) -> Option<Vec<InlayHint>> {
pub(crate) async fn inlay_hints_request(server: &ServerState, uri: &Url) -> Option<Vec<InlayHint>> {
let params = InlayHintParams {
text_document: TextDocumentIdentifier { uri: uri.clone() },
range: Range {
Expand Down

0 comments on commit ba7c4a9

Please sign in to comment.