Skip to content

Commit 5cbd3fa

Browse files
authored
Merge pull request #7 from saethlin/fmt
Format, fix features, fix a test
2 parents 94d50af + d601e80 commit 5cbd3fa

11 files changed

Lines changed: 26 additions & 14 deletions

File tree

abi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "abi"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

difftest/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "difftest"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

difftest/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(iter_intersperse)]
2-
#![feature(let_chains)]
32

43
pub mod backends;
54

difftest/src/main.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
#![feature(iter_intersperse)]
22

33
use core::panic;
4-
use std::{collections::HashMap, io::{self, Read}, path::PathBuf, process::ExitCode, str::FromStr};
4+
use std::{
5+
collections::HashMap,
6+
io::{self, Read},
7+
path::PathBuf,
8+
process::ExitCode,
9+
str::FromStr,
10+
};
511

612
use clap::{Arg, Command};
713
use config::Config;
@@ -88,7 +94,9 @@ fn main() -> ExitCode {
8894

8995
let source = if source == "-" {
9096
let mut code = String::new();
91-
io::stdin().read_to_string(&mut code).expect("can read source code from stdin");
97+
io::stdin()
98+
.read_to_string(&mut code)
99+
.expect("can read source code from stdin");
92100
Source::Stdin(code)
93101
} else {
94102
Source::File(PathBuf::from_str(source).expect("is valid path"))
@@ -111,10 +119,7 @@ fn main() -> ExitCode {
111119
ExitCode::SUCCESS
112120
} else {
113121
let results = results.to_string();
114-
error!(
115-
"{} didn't pass:\n{results}",
116-
source,
117-
);
122+
error!("{} didn't pass:\n{results}", source,);
118123
ExitCode::FAILURE
119124
}
120125
}

generate/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "generate"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

generate/src/generation/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ impl GenerationCtx {
495495
local
496496
}
497497

498+
#[allow(dead_code)]
498499
fn generate_storage_live(&self) -> Result<Statement> {
499500
let local = self
500501
.current_decls()
@@ -505,6 +506,7 @@ impl GenerationCtx {
505506
Ok(Statement::StorageLive(local))
506507
}
507508

509+
#[allow(dead_code)]
508510
fn generate_storage_dead(&self) -> Result<Statement> {
509511
let local = self
510512
.current_decls()
@@ -515,6 +517,7 @@ impl GenerationCtx {
515517
Ok(Statement::StorageDead(local))
516518
}
517519

520+
#[allow(dead_code)]
518521
fn generate_deinit(&self) -> Result<Statement> {
519522
let place = PlaceSelector::for_operand(self.tcx.clone())
520523
.into_iter_place(&self.pt)
@@ -523,6 +526,7 @@ impl GenerationCtx {
523526
Ok(Statement::Deinit(place))
524527
}
525528

529+
#[allow(dead_code)]
526530
fn generate_set_discriminant(&self) -> Result<Statement> {
527531
let enum_tys: Vec<TyId> = self
528532
.tcx

generate/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#![feature(iter_advance_by)]
33
#![feature(variant_count)]
44
#![feature(test)]
5-
#![feature(let_chains)]
65
#![feature(try_blocks)]
76
#![feature(box_patterns)]
87

generate/src/mem/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ impl Run {
7373
}
7474
}
7575

76+
#[allow(dead_code)]
7677
pub fn size(&self) -> Size {
7778
Size::from_bytes(self.bytes.len())
7879
}
@@ -235,6 +236,7 @@ struct Allocation {
235236
live: bool,
236237
}
237238

239+
#[allow(dead_code)]
238240
impl Allocation {
239241
fn runs_and_sizes(&self) -> impl Iterator<Item = (RunId, Size)> + '_ {
240242
self.runs
@@ -322,6 +324,7 @@ impl RunPointer {
322324
self.run_and_offset.1
323325
}
324326

327+
#[allow(dead_code)]
325328
pub fn len(&self) -> Size {
326329
self.size
327330
}

generate/src/pgraph.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ impl PlaceGraph {
208208

209209
/// Returns whether the selection of function call arguments will not cause
210210
/// UB. Must be called while we are still in the Caller
211+
#[allow(dead_code)]
211212
pub fn arguments_ok(&self, args: &[Operand], return_dest: &Place) -> bool {
212213
// Check if the move of any places would invalidate any reference
213214
let mut ok = true;
@@ -1142,6 +1143,7 @@ impl PlaceGraph {
11421143
}
11431144
}
11441145

1146+
#[allow(dead_code)]
11451147
pub fn place_count(&self) -> usize {
11461148
self.places.node_count()
11471149
}
@@ -1564,8 +1566,8 @@ mod tests {
15641566
root_ty, // (i8, (i16, i32), i64)
15651567
TyCtxt::I8, // i8
15661568
b_ty, // (i16, 132)
1567-
TyCtxt::I16, // i16
15681569
TyCtxt::I32, // i32
1570+
TyCtxt::I16, // i16
15691571
TyCtxt::I64, // i64
15701572
]
15711573
);

mir/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "mir"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
77

0 commit comments

Comments
 (0)