refactor: clear clippy code lints across the workspace
Machine-applicable clippy fixes plus three by-hand cleanups; all semantics-preserving (full workspace test suite green). Auto-applied (cargo clippy --fix): - dropped `.clone()` on the Copy type ParamMode (ret_mode/param_mode) - map_or(false, p) -> is_some_and(p) - removed redundant closures and an explicit .into_iter() - useless format!, a needless deref, an as_bytes-after-slice By hand: - ailang-codegen: named the loop-frame tuple types (LoopFrame / LoopBinderSlot) instead of the bare nested Vec<(String, Vec<(String, String, String, Type)>)>, clearing the type-complexity lint and documenting what each slot holds. - ailang-check: collapsed the two identical pass-through arms of the Type-Con qualifier (already-dotted / primitive) into one `||` guard. - ailang-core: converted a stale `///` block (it described a test that was relocated, documenting nothing) back to a plain `//` comment. Remaining clippy output is 16 markdown list-indentation nits in prose doc comments — doc formatting, not code, left for a docs pass.
This commit is contained in:
@@ -1005,7 +1005,7 @@ impl<'a> Emitter<'a> {
|
||||
(vars, Type::Con { args, .. })
|
||||
if !vars.is_empty() && vars.len() == args.len() =>
|
||||
{
|
||||
vars.iter().cloned().zip(args.into_iter()).collect()
|
||||
vars.iter().cloned().zip(args).collect()
|
||||
}
|
||||
_ => BTreeMap::new(),
|
||||
};
|
||||
|
||||
@@ -741,6 +741,15 @@ fn main_is_void(t: &Type) -> bool {
|
||||
}
|
||||
}
|
||||
|
||||
/// One loop binder's storage on the recur stack: `(binder name, its
|
||||
/// alloca SSA, the LLVM type string, the AILang type)`.
|
||||
type LoopBinderSlot = (String, String, String, Type);
|
||||
|
||||
/// A loop frame: `(loop header block label, the binder slots active in
|
||||
/// that loop)`. Pushed on entry to a `Term::Loop`, popped on exit, and
|
||||
/// read by `Term::Recur` to store back into the right allocas.
|
||||
type LoopFrame = (String, Vec<LoopBinderSlot>);
|
||||
|
||||
struct Emitter<'a> {
|
||||
module: &'a Module,
|
||||
/// Typed fn bodies for this module (the post-mono `MTerm` per
|
||||
@@ -917,7 +926,7 @@ struct Emitter<'a> {
|
||||
/// it. Saved/reset/restored at the lambda-lowering boundary
|
||||
/// alongside `binder_allocas` (a `recur` cannot cross a lambda
|
||||
/// boundary).
|
||||
loop_frames: Vec<(String, Vec<(String, String, String, Type)>)>,
|
||||
loop_frames: Vec<LoopFrame>,
|
||||
/// Side buffer for `alloca` instructions emitted during body
|
||||
/// lowering but hoisted to the fn's entry block. Flushed once
|
||||
/// into `self.body` at `entry_block_end_marker` after
|
||||
|
||||
Reference in New Issue
Block a user