Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove unneeded validation
  • Loading branch information
arihant2math committed Apr 15, 2025
commit c7042fd8470ad8d9ca4c33246d6b390b74855b85
10 changes: 0 additions & 10 deletions compiler/codegen/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2185,16 +2185,6 @@

let nargs = patterns.len();
let n_attrs = kwd_attrs.len();
let nkwd_patterns = kwd_patterns.len();

// Validate that keyword attribute names and patterns match in length.
if n_attrs != nkwd_patterns {
let msg = format!(
"kwd_attrs ({}) / kwd_patterns ({}) length mismatch in class pattern",
n_attrs, nkwd_patterns
);
unreachable!("{}", msg);
}

// Check for too many sub-patterns.
if nargs > u32::MAX as usize || (nargs + n_attrs).saturating_sub(1) > i32::MAX as usize {
Expand Down Expand Up @@ -2483,10 +2473,10 @@

// Adjust the final captures.
let nstores = control.as_ref().unwrap().len();
let nrots = nstores + 1 + pc.on_top + pc.stores.len();

Check warning on line 2476 in compiler/codegen/src/compile.rs

View workflow job for this annotation

GitHub Actions / Check Rust code with rustfmt and clippy

Unknown word (nrots)
for i in 0..nstores {
// Rotate the capture to its proper place.
self.pattern_helper_rotate(nrots)?;

Check warning on line 2479 in compiler/codegen/src/compile.rs

View workflow job for this annotation

GitHub Actions / Check Rust code with rustfmt and clippy

Unknown word (nrots)
let name = &control.as_ref().unwrap()[i];
// Check for duplicate binding.
if pc.stores.iter().any(|n| n == name) {
Expand Down
Loading