summaryrefslogtreecommitdiffstats
path: root/library/stdarch/crates/stdarch-test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:43 +0000
commit3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245 (patch)
treedaf049b282ab10e8c3d03e409b3cd84ff3f7690c /library/stdarch/crates/stdarch-test
parentAdding debian version 1.68.2+dfsg1-1. (diff)
downloadrustc-3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245.tar.xz
rustc-3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245.zip
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'library/stdarch/crates/stdarch-test')
-rw-r--r--library/stdarch/crates/stdarch-test/Cargo.toml2
-rw-r--r--library/stdarch/crates/stdarch-test/src/disassembly.rs8
-rw-r--r--library/stdarch/crates/stdarch-test/src/lib.rs10
3 files changed, 10 insertions, 10 deletions
diff --git a/library/stdarch/crates/stdarch-test/Cargo.toml b/library/stdarch/crates/stdarch-test/Cargo.toml
index 012b4e959..23bddeda6 100644
--- a/library/stdarch/crates/stdarch-test/Cargo.toml
+++ b/library/stdarch/crates/stdarch-test/Cargo.toml
@@ -2,7 +2,7 @@
name = "stdarch-test"
version = "0.1.0"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
-edition = "2018"
+edition = "2021"
[dependencies]
assert-instr-macro = { path = "../assert-instr-macro" }
diff --git a/library/stdarch/crates/stdarch-test/src/disassembly.rs b/library/stdarch/crates/stdarch-test/src/disassembly.rs
index 3ace6b20e..8e4d57d4e 100644
--- a/library/stdarch/crates/stdarch-test/src/disassembly.rs
+++ b/library/stdarch/crates/stdarch-test/src/disassembly.rs
@@ -81,7 +81,7 @@ pub(crate) fn disassemble_myself() -> HashSet<Function> {
.args(add_args)
.arg(&me)
.output()
- .unwrap_or_else(|_| panic!("failed to execute objdump. OBJDUMP={}", objdump));
+ .unwrap_or_else(|_| panic!("failed to execute objdump. OBJDUMP={objdump}"));
println!(
"{}\n{}",
output.status,
@@ -103,7 +103,7 @@ fn parse(output: &str) -> HashSet<Function> {
lines.clone().count()
);
for line in output.lines().take(100) {
- println!("{}", line);
+ println!("{line}");
}
let mut functions = HashSet::new();
@@ -112,9 +112,9 @@ fn parse(output: &str) -> HashSet<Function> {
if !header.ends_with(':') || !header.contains("stdarch_test_shim") {
continue;
}
- eprintln!("header: {}", header);
+ eprintln!("header: {header}");
let symbol = normalize(header);
- eprintln!("normalized symbol: {}", symbol);
+ eprintln!("normalized symbol: {symbol}");
let mut instructions = Vec::new();
while let Some(instruction) = lines.next() {
if instruction.ends_with(':') {
diff --git a/library/stdarch/crates/stdarch-test/src/lib.rs b/library/stdarch/crates/stdarch-test/src/lib.rs
index eba17771c..e0cf46cb4 100644
--- a/library/stdarch/crates/stdarch-test/src/lib.rs
+++ b/library/stdarch/crates/stdarch-test/src/lib.rs
@@ -64,10 +64,10 @@ pub fn assert(shim_addr: usize, fnname: &str, expected: &str) {
// Make sure that the shim is not removed
black_box(shim_addr);
- //eprintln!("shim name: {}", fnname);
+ //eprintln!("shim name: {fnname}");
let function = &DISASSEMBLY
.get(&Function::new(fnname))
- .unwrap_or_else(|| panic!("function \"{}\" not found in the disassembly", fnname));
+ .unwrap_or_else(|| panic!("function \"{fnname}\" not found in the disassembly"));
//eprintln!(" function: {:?}", function);
let mut instrs = &function.instrs[..];
@@ -165,9 +165,9 @@ pub fn assert(shim_addr: usize, fnname: &str, expected: &str) {
// Help debug by printing out the found disassembly, and then panic as we
// didn't find the instruction.
- println!("disassembly for {}: ", fnname,);
+ println!("disassembly for {fnname}: ",);
for (i, instr) in instrs.iter().enumerate() {
- println!("\t{:2}: {}", i, instr);
+ println!("\t{i:2}: {instr}");
}
if !found {
@@ -194,7 +194,7 @@ pub fn assert_skip_test_ok(name: &str) {
if env::var("STDARCH_TEST_EVERYTHING").is_err() {
return;
}
- panic!("skipped test `{}` when it shouldn't be skipped", name);
+ panic!("skipped test `{name}` when it shouldn't be skipped");
}
// See comment in `assert-instr-macro` crate for why this exists