Skip to content

Commit

Permalink
chore: Migrate to Rust 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
sorairolake committed Feb 22, 2025
1 parent 6f76cf5 commit d4c8b91
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion rustowl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "rustowl"
version = "0.1.4"
edition = "2021"
edition = "2024"
authors = ["cordx56 <cordx56@cordx.cx>"]
description = "Visualize Ownership and Lifetimes in Rust"
documentation = "https://github.com/cordx56/rustowl/blob/main/README.md"
Expand Down
2 changes: 1 addition & 1 deletion rustowl/src/bin/cargo-owl.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use rustowl::toolchain_version;
use std::env;
use std::path::PathBuf;
use std::process::{exit, Command};
use std::process::{Command, exit};

#[allow(unused)]
use toolchain_version::TOOLCHAIN_VERSION;
Expand Down
7 changes: 4 additions & 3 deletions rustowl/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ use rustc_middle::{
mir::BorrowCheckResult, query::queries::mir_borrowck::ProvidedValue, ty::TyCtxt,
util::Providers,
};
use rustc_session::{config, EarlyDiagCtxt};
use rustc_session::{EarlyDiagCtxt, config};
use rustowl::models::*;
use std::collections::HashMap;
use std::sync::{atomic::AtomicBool, LazyLock, Mutex};
use std::sync::{LazyLock, Mutex, atomic::AtomicBool};
use tokio::{
runtime::{Builder, Handle, Runtime},
task::JoinSet,
Expand Down Expand Up @@ -67,7 +67,8 @@ fn mir_borrowck(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ProvidedValue<'_> {
};
if current == mir_len {
RUNTIME.lock().unwrap().block_on(async move {
while let Some(task) = { TASKS.lock().unwrap().join_next() }.await {
let mut locked = TASKS.lock().unwrap();
while let Some(task) = { locked.join_next() }.await {
let (filename, analyzed) = task.unwrap().analyze();
log::info!("analyzed one item of {}", filename);
let ws = Workspace(HashMap::from([(
Expand Down
8 changes: 4 additions & 4 deletions rustowl/src/core/analyze.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use super::from_rustc::LocationTableSim;
use polonius_engine::FactTypes;
use rustc_borrowck::consumers::{
get_body_with_borrowck_facts, BorrowIndex, ConsumerOptions, PoloniusInput, PoloniusOutput,
RichLocation, RustcFacts,
BorrowIndex, ConsumerOptions, PoloniusInput, PoloniusOutput, RichLocation, RustcFacts,
get_body_with_borrowck_facts,
};
use rustc_hir::def_id::LocalDefId;
use rustc_middle::{
Expand All @@ -12,7 +12,7 @@ use rustc_middle::{
},
ty::TyCtxt,
};
use rustc_span::{source_map::SourceMap, Span};
use rustc_span::{Span, source_map::SourceMap};
use rustowl::models::*;
use std::collections::{BTreeSet, HashMap};
use std::future::Future;
Expand Down Expand Up @@ -308,7 +308,7 @@ where
target_local_index: local.as_u32(),
range: range_from_span(source, statement.source_info.span, offset),
}),
StatementKind::Assign(ref v) => {
StatementKind::Assign(v) => {
let (place, rval) = &**v;
let target_local_index = place.local.as_u32();
let rv = match rval {
Expand Down

0 comments on commit d4c8b91

Please sign in to comment.