Skip to content

Commit ba7c4a9

Browse files
authored
ci: upgrade to rust 1.85.0 (#6979)
## 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.
1 parent ccba9b1 commit ba7c4a9

File tree

18 files changed

+35
-36
lines changed

18 files changed

+35
-36
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ concurrency:
1515
env:
1616
CARGO_TERM_COLOR: always
1717
REGISTRY: ghcr.io
18-
RUST_VERSION: 1.82.0
18+
RUST_VERSION: 1.85.0
1919
NIGHTLY_RUST_VERSION: nightly-2024-10-21
2020

2121
jobs:

forc-plugins/forc-debug/src/cli/commands.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ pub async fn cmd_step(state: &mut State, mut args: Vec<String>) -> Result<()> {
298298
// Determine whether to enable or disable single stepping
299299
let enable = args
300300
.first()
301-
.map_or(true, |v| !["off", "no", "disable"].contains(&v.as_str()));
301+
.is_none_or(|v| !["off", "no", "disable"].contains(&v.as_str()));
302302

303303
// Call the client
304304
state

forc-plugins/forc-debug/tests/cli_integration.rs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use std::process::Command;
66
#[test]
77
fn test_cli() {
88
let port = portpicker::pick_unused_port().expect("No ports free");
9+
#[allow(clippy::zombie_processes)]
910
let mut fuel_core = Command::new("fuel-core")
1011
.arg("run")
1112
.arg("--debug")

forc-plugins/forc-migrate/src/migrations/partial_eq.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ use super::{ContinueMigrationProcess, DryRun, MigrationStep, MigrationStepKind,
4949
// changed by the introduction of `PartialEq`. Changing `Eq` constraint to `PartialEq`
5050
// to lower the constraint is done in the `core` and `std`, where appropriate.
5151
// Suggesting to developers doing this replacement in their projects is mentioned
52-
/// in the tracking issue: https://github.com/FuelLabs/sway/issues/6883.
52+
// in the tracking issue: https://github.com/FuelLabs/sway/issues/6883.
5353

5454
pub(super) const IMPLEMENT_EXPERIMENTAL_PARTIAL_EQ_AND_EQ_TRAITS: MigrationStep = MigrationStep {
5555
title: "Implement experimental `PartialEq` and `Eq` traits",

forc-plugins/forc-migrate/src/modifying/annotated.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use sway_types::{Span, Spanned};
88

99
use super::Modifier;
1010

11-
impl<'a, T> Modifier<'a, Annotated<T>> {
11+
impl<T> Modifier<'_, Annotated<T>> {
1212
/// From `self`, removes [AttributeDecl] that contains an [Attribute]
1313
/// whose span equals `attribute_span`.
1414
///

forc-plugins/forc-migrate/src/modifying/attribute.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use crate::assert_insert_span;
1515
use super::{Modifier, New};
1616

1717
#[allow(dead_code)]
18-
impl<'a> Modifier<'a, Attribute> {
18+
impl Modifier<'_, Attribute> {
1919
pub(crate) fn set_name<S: AsRef<str> + ?Sized>(&mut self, name: &S) -> &mut Self {
2020
// We preserve the current span of the name.
2121
let insert_span = self.element.name.span();

forc-plugins/forc-migrate/src/modifying/function.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::assert_insert_span;
88

99
use super::{Modifier, New};
1010

11-
impl<'a> Modifier<'a, ItemFn> {
11+
impl Modifier<'_, ItemFn> {
1212
pub(crate) fn set_name<S: AsRef<str> + ?Sized>(&mut self, name: &S) -> &mut Self {
1313
// We preserve the current span of the name.
1414
let insert_span = self.element.fn_signature.name.span();

forc-plugins/forc-migrate/src/modifying/module.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use sway_types::{Span, Spanned};
77
use super::Modifier;
88

99
#[allow(dead_code)]
10-
impl<'a> Modifier<'a, Module> {
10+
impl Modifier<'_, Module> {
1111
/// Removes an [Annotated<ItemKind>] from `self`.
1212
/// The item to remove is identified by its [Span], `annotated_item_span`.
1313
pub(crate) fn remove_annotated_item(&mut self, annotated_item_span: &Span) -> &mut Self {

forc-plugins/forc-migrate/src/modifying/storage_field.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ impl ToInKey for Expr {
3535
}
3636

3737
#[allow(dead_code)]
38-
impl<'a> Modifier<'a, StorageField> {
38+
impl Modifier<'_, StorageField> {
3939
pub(crate) fn set_in_key<K: ToInKey>(&mut self, key: K) -> &mut Self {
4040
// If the `in` token already exists, just replace the key and leave the `in`
4141
// token as is. Place the key after the `in` token.

forc-plugins/forc-node/tests/local.rs

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ async fn start_local_node_check_health() {
2424
mode: Mode::Local(local_cmd),
2525
};
2626

27+
#[allow(clippy::zombie_processes)]
2728
let mut handle = op::run(cmd).await.unwrap().unwrap();
2829
// Wait for node to start grapqhl service
2930
sleep(Duration::from_secs(2)).await;

sway-core/src/asm_generation/fuel/fuel_asm_builder.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,7 @@ impl<'ir, 'eng> FuelAsmBuilder<'ir, 'eng> {
18211821
// XXX not required after we have FuelVM specific verifier.
18221822
if !key
18231823
.get_type(self.context)
1824-
.map_or(true, |key_ty| key_ty.is_ptr(self.context))
1824+
.is_none_or(|key_ty| key_ty.is_ptr(self.context))
18251825
{
18261826
return Err(CompileError::Internal(
18271827
"Key value for state clear is not a pointer.",
@@ -1923,7 +1923,7 @@ impl<'ir, 'eng> FuelAsmBuilder<'ir, 'eng> {
19231923
// XXX not required after we have FuelVM specific verifier.
19241924
if !key
19251925
.get_type(self.context)
1926-
.map_or(true, |key_ty| key_ty.is_ptr(self.context))
1926+
.is_none_or(|key_ty| key_ty.is_ptr(self.context))
19271927
{
19281928
return Err(CompileError::Internal(
19291929
"Key value for state load word is not a pointer.",
@@ -1993,7 +1993,7 @@ impl<'ir, 'eng> FuelAsmBuilder<'ir, 'eng> {
19931993

19941994
if stored_val
19951995
.get_type(self.context)
1996-
.map_or(true, |ty| !self.is_copy_type(&ty))
1996+
.is_none_or(|ty| !self.is_copy_type(&ty))
19971997
{
19981998
Err(CompileError::Internal(
19991999
"Attempt to store a non-copy type.",

sway-core/src/control_flow_analysis/dead_code_analysis.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ impl<'cfg> ControlFlowGraph<'cfg> {
140140
connections_count
141141
.get(n)
142142
.cloned()
143-
.map_or(true, |count| count <= 1)
143+
.is_none_or(|count| count <= 1)
144144
}
145145
ControlFlowGraphNode::FunctionParameter { .. } => {
146146
// Consider variables declarations dead when count is not greater than 1
147147
// Function param always has the function pointing to them
148148
connections_count
149149
.get(n)
150150
.cloned()
151-
.map_or(true, |count| count <= 1)
151+
.is_none_or(|count| count <= 1)
152152
}
153153
_ => false,
154154
}
@@ -192,7 +192,7 @@ impl<'cfg> ControlFlowGraph<'cfg> {
192192
connections_count
193193
.get(n)
194194
.cloned()
195-
.map_or(true, |count| count > 1)
195+
.is_none_or(|count| count > 1)
196196
}
197197
}
198198
ControlFlowGraphNode::ProgramNode {

sway-core/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ pub(crate) fn is_ty_module_cache_up_to_date(
448448
let cache_up_to_date = build_config
449449
.and_then(|x| x.lsp_mode.as_ref())
450450
.and_then(|lsp| lsp.file_versions.get(path.as_ref()))
451-
.map_or(true, |version| {
451+
.is_none_or(|version| {
452452
version.map_or(true, |v| typed.version.is_some_and(|tv| v <= tv))
453453
});
454454

@@ -802,7 +802,7 @@ pub fn compile_to_ast(
802802
};
803803

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

sway-core/src/query_engine/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl QueryEngine {
220220
ident
221221
.span()
222222
.source_id()
223-
.map_or(true, |id| id.program_id() != *program_id)
223+
.is_none_or(|id| id.program_id() != *program_id)
224224
});
225225
}
226226

sway-core/src/type_system/engine.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1869,10 +1869,10 @@ impl TypeEngine {
18691869
F: Fn(&SourceId) -> bool,
18701870
{
18711871
self.slab
1872-
.retain(|_, tsi| tsi.source_id.as_ref().map_or(true, &keep));
1872+
.retain(|_, tsi| tsi.source_id.as_ref().is_none_or(&keep));
18731873
self.shareable_types
18741874
.write()
1875-
.retain(|tsi, _| tsi.source_id.as_ref().map_or(true, &keep));
1875+
.retain(|tsi, _| tsi.source_id.as_ref().is_none_or(&keep));
18761876
}
18771877

18781878
/// Removes all data associated with `program_id` from the type engine.

sway-ir/src/optimize/inline.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -239,17 +239,17 @@ pub fn is_small_fn(
239239
}
240240

241241
move |context: &Context, function: &Function, _call_site: &Value| -> bool {
242-
max_blocks.map_or(true, |max_block_count| {
243-
function.num_blocks(context) <= max_block_count
244-
}) && max_instrs.map_or(true, |max_instrs_count| {
245-
function.num_instructions_incl_asm_instructions(context) <= max_instrs_count
246-
}) && max_stack_size.map_or(true, |max_stack_size_count| {
247-
function
248-
.locals_iter(context)
249-
.map(|(_name, ptr)| count_type_elements(context, &ptr.get_inner_type(context)))
250-
.sum::<usize>()
251-
<= max_stack_size_count
252-
})
242+
max_blocks.is_none_or(|max_block_count| function.num_blocks(context) <= max_block_count)
243+
&& max_instrs.is_none_or(|max_instrs_count| {
244+
function.num_instructions_incl_asm_instructions(context) <= max_instrs_count
245+
})
246+
&& max_stack_size.is_none_or(|max_stack_size_count| {
247+
function
248+
.locals_iter(context)
249+
.map(|(_name, ptr)| count_type_elements(context, &ptr.get_inner_type(context)))
250+
.sum::<usize>()
251+
<= max_stack_size_count
252+
})
253253
}
254254
}
255255

sway-lsp/src/core/session.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ pub fn parse_project(
477477
// Check if the last result is None or if results is empty, indicating an error occurred in the compiler.
478478
// If we don't return an error here, then we will likely crash when trying to access the Engines
479479
// during traversal or when creating runnables.
480-
if results.last().map_or(true, |(value, _)| value.is_none()) {
480+
if results.last().is_none_or(|(value, _)| value.is_none()) {
481481
return Err(LanguageServerError::ProgramsIsNone);
482482
}
483483

@@ -711,7 +711,7 @@ impl BuildPlanCache {
711711
.as_ref()
712712
.and_then(|path| path.metadata().ok()?.modified().ok())
713713
.map_or(cache.is_none(), |time| {
714-
cache.as_ref().map_or(true, |&(_, last)| time > last)
714+
cache.as_ref().is_none_or(|&(_, last)| time > last)
715715
})
716716
};
717717

sway-lsp/tests/integration/lsp.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -718,10 +718,7 @@ pub fn create_did_change_params(
718718
}
719719
}
720720

721-
pub(crate) async fn inlay_hints_request<'a>(
722-
server: &ServerState,
723-
uri: &Url,
724-
) -> Option<Vec<InlayHint>> {
721+
pub(crate) async fn inlay_hints_request(server: &ServerState, uri: &Url) -> Option<Vec<InlayHint>> {
725722
let params = InlayHintParams {
726723
text_document: TextDocumentIdentifier { uri: uri.clone() },
727724
range: Range {

0 commit comments

Comments
 (0)