Skip to content

Commit 7194625

Browse files
brockelmoreclaude
andcommitted
feat: unused return value warnings, empty body fix, test consolidation
- Add compiler warning for unused return values (function called as statement when it returns a value) - Fix panic in lower_code_block when function body reduces to empty stmts - Consolidate e2e, evm-tests, and lexer test files into single binaries via main.rs + suites/ directories (~50 binaries → ~19) - Fix clippy duplicate_mod in lexer test consolidation - Add docs for external calls type spec Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 461e63e commit 7194625

50 files changed

Lines changed: 641 additions & 10 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

crates/driver/src/compiler.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ impl Compiler {
193193
CompileError::Aborted
194194
})?;
195195

196+
// Emit any warnings from IR lowering
197+
for warning in &ir_program.warnings {
198+
self.session.emit_warning(warning.clone());
199+
}
200+
196201
if emit == EmitKind::Ir || emit == EmitKind::PrettyIr {
197202
return Ok(CompileOutput {
198203
tokens: None,
@@ -226,6 +231,7 @@ impl Compiler {
226231
&edge_ir::EvmProgram {
227232
contracts: vec![contract.clone()],
228233
free_functions: Vec::new(),
234+
warnings: Vec::new(),
229235
},
230236
self.session.config.optimization_level,
231237
self.session.config.optimize_for,
@@ -254,6 +260,7 @@ impl Compiler {
254260
let single_program = edge_ir::EvmProgram {
255261
contracts: vec![contract.clone()],
256262
free_functions: Vec::new(),
263+
warnings: Vec::new(),
257264
};
258265
let bytecode = edge_codegen::compile(
259266
&single_program,

crates/e2e/tests/main.rs

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#![allow(missing_docs)]
2+
3+
#[path = "suites/access_exec.rs"]
4+
mod access_exec;
5+
#[path = "suites/calldata_args.rs"]
6+
mod calldata_args;
7+
#[path = "suites/counter.rs"]
8+
mod counter;
9+
#[path = "suites/erc20.rs"]
10+
mod erc20;
11+
#[path = "suites/examples.rs"]
12+
mod examples;
13+
#[path = "suites/expressions.rs"]
14+
mod expressions;
15+
#[path = "suites/features_exec.rs"]
16+
mod features_exec;
17+
#[path = "suites/finance_exec.rs"]
18+
mod finance_exec;
19+
#[path = "suites/generics_exec.rs"]
20+
mod generics_exec;
21+
#[path = "suites/generics_negative.rs"]
22+
mod generics_negative;
23+
#[path = "suites/inline_asm_exec.rs"]
24+
mod inline_asm_exec;
25+
#[path = "suites/packed_exec.rs"]
26+
mod packed_exec;
27+
#[path = "suites/packed_storage_exec.rs"]
28+
mod packed_storage_exec;
29+
#[path = "suites/packed_transient_exec.rs"]
30+
mod packed_transient_exec;
31+
#[path = "suites/patterns_exec.rs"]
32+
mod patterns_exec;
33+
#[path = "suites/tokens_exec.rs"]
34+
mod tokens_exec;
35+
#[path = "suites/traits_exec.rs"]
36+
mod traits_exec;
37+
#[path = "suites/traits_negative.rs"]
38+
mod traits_negative;
39+
#[path = "suites/type_demos_exec.rs"]
40+
mod type_demos_exec;
41+
#[path = "suites/types_exec.rs"]
42+
mod types_exec;
43+
#[path = "suites/utils_exec.rs"]
44+
mod utils_exec;
45+
#[path = "suites/warnings.rs"]
46+
mod warnings;

0 commit comments

Comments
 (0)