Skip to content

Commit

Permalink
chore: bump rust version to 1.71 (FuelLabs#4805)
Browse files Browse the repository at this point in the history
## Description

Rust v1.71 is
[released](https://blog.rust-lang.org/2023/07/13/Rust-1.71.0.html). This
PR bumps rust version used in CI and fixes warnings returned from
clippy's new version.
  • Loading branch information
kayagokalp authored Jul 17, 2023
1 parent 7d77490 commit 8600cce
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 12 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.70.0
RUST_VERSION: 1.71.0
NIGHTLY_RUST_VERSION: nightly-2023-02-08

jobs:
Expand Down
3 changes: 1 addition & 2 deletions sway-ir/src/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,8 +513,7 @@ impl Function {
let mut res = format!("digraph {} {{\n", self.get_name(context));

worklist.push(entry);
while !worklist.is_empty() {
let n = worklist.pop().unwrap();
while let Some(n) = worklist.pop() {
visited.insert(n);
for BranchToWithArgs { block: n_succ, .. } in n.successors(context) {
let _ = writeln!(
Expand Down
4 changes: 1 addition & 3 deletions sway-ir/src/optimize/dce.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,7 @@ pub fn dce(

let mut modified = false;
let mut cemetery = FxHashSet::default();
while !worklist.is_empty() {
let dead = worklist.pop().unwrap();

while let Some(dead) = worklist.pop() {
if !can_eliminate_instruction(context, dead, &num_symbol_uses, escaped_symbols)
|| cemetery.contains(&dead)
{
Expand Down
3 changes: 1 addition & 2 deletions sway-ir/src/optimize/mem2reg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ pub fn promote_to_registers(
}
}
// Transitively add PHIs, till nothing more to do.
while !worklist.is_empty() {
let (local, ty, known_def) = worklist.pop().unwrap();
while let Some((local, ty, known_def)) = worklist.pop() {
for df in dom_fronts[&known_def].iter() {
if !new_phi_tracker.contains(&(local.clone(), *df)) && liveins[df].contains(&local) {
// Insert PHI for this local at block df.
Expand Down
3 changes: 1 addition & 2 deletions sway-ir/src/optimize/memcpyopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,7 @@ fn is_clobbered(
let mut worklist: Vec<(Block, Box<dyn Iterator<Item = Value>>)> =
vec![(store_block, Box::new(iter))];
let mut visited = FxHashSet::default();
'next_job: while !worklist.is_empty() {
let (block, iter) = worklist.pop().unwrap();
'next_job: while let Some((block, iter)) = worklist.pop() {
visited.insert(block);
for inst in iter {
if inst == load_val || inst == store_val {
Expand Down
3 changes: 1 addition & 2 deletions sway-ir/src/optimize/simplify_cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ fn remove_dead_blocks(context: &mut Context, function: &Function) -> Result<bool
worklist.push(entry_block);

// Mark reachable nodes.
while !worklist.is_empty() {
let block = worklist.pop().unwrap();
while let Some(block) = worklist.pop() {
let succs = block.successors(context);
for BranchToWithArgs { block: succ, .. } in succs {
// If this isn't already marked reachable, we mark it and add to the worklist.
Expand Down

0 comments on commit 8600cce

Please sign in to comment.